discuss-gnustep
[Top][All Lists]
Advanced

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

Re: System fonts


From: Fred Kiefer
Subject: Re: System fonts
Date: Fri, 27 Aug 2004 22:56:42 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040114

MJ Ray wrote:
"Yen-Ju Chen" <address@hidden> wrote:

And there is one which use Xft (freetype) and/or fontconfig to draw character (XftDrawString16).

[...]

AntiAlias: YES, FontSet: NO => XftDrawString16(), create font cache if fontconfig doesn't exist


Are you sure about this? I think it's my situation. If I set NSFont to
"sans" (an alias defined in fonts.conf) then it just can't be found. Why?
How can I debug this?


My feeling here is that some of the discussion on NSFont implementations here is caused by wrong expectations. NSFont, and its backend implementations, are there to provide two functionalities. One is obvious, visibility of glyphs in the output, eg the computer monitor. For the output it surely would be nicer, if every character would be displayed indepened of the specified font. The other functionality seems to be overlooked here, it is that every font is able to provide some information about itself, that includes for example the font name, the family, the weight and traits, ascender, descender and so on.

The later is only possible if the font restricts itself to a specific set of glyphs it is able to display. That is why the specification, and most of the implementations in GNUstep, of NSFont is very close to a specific font and does not reflect arbitrary defined font sets. To still be able to display as many characters as possible on the output device the Cocoa specification relies on the method [NSMutableAttributeString fixFontAttributeInRange:] to correct the font assigned to a character and on the text system, which should generate an exisiting glyph for one or multiple characters by selecting an apropriate font.

Some of this is currently missing in GNUstep, which really is a shame (and not the great fontconfig implementation in xlib by Derek Zhou). If you really need this functionality don't complain about the NSFont implementations, sit down and write this missing code.




reply via email to

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