discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fonts (not only in Gorm)


From: Stefan Urbanek
Subject: Fonts (not only in Gorm)
Date: Thu, 14 Feb 2002 19:20:21 +0100

Hi again,

Still playing with Gorm :o)

There was a discussion about themes some time ago. In Gorm, if you set font of
a control, you set it to say 'Helvetica-Normal 12pt'. In GNUstep we have
System Font, Label Font, Message Font,... (see NSFont documentation). I think,
it will be good, to be able to set font to theese kinds of fonts. AFAIK,
currently when you send, for example, systemFontOfSize: to NSFont, you get
concrete font. It is not good, because when you archive/unarchive that object,
you archive/unarchive 'Helvetica 12pt' font, not system font. But, if we had
something like abstract NSSystemFont with one instance variable 'concreteFont'
and we archive/unarchive this object we still get system font set by user
preferences.

@interface NSAbstractFont:NSFont
{
  NSFont *concreteFont;
}
@end

in NSSystemFont:NSAbstractFont you put:

-init
{
  concreteFont = NSFont from users defaults NSSystemFont and NSSystemFontSize
  ...
}

In ohter methods, you just forward that message to concreteFont and in methods
for archiving and unarchiving you do not store that concrete font, but
abstract font name like 'NSSystemFont'

One more thing... It seems that some cells (NSButtonCell, NSMenuItemCells (in
Gorm palette), NSBox - title, NSForm field titles) are using NSUserFont
instead of NSSystemFont as they should. (Try to set user and system font to be
different). Also I think, that NSSystemFont should be used in text fields and
NSUserFont only in NSTextView (as it is). I do not know, how it is on MOSX,
can anybody check that?

What do you think?

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]