discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Font fallback mechanism


From: Adam Fedor
Subject: Re: Font fallback mechanism
Date: Thu, 22 Aug 2002 08:29:37 -0600
User-agent: Mozilla/5.0 (X11; U; Linux ppc; en-US; rv:1.0rc2) Gecko/20020513

Yen-Ju Chen wrote:

 Here is what I thought:
 There are two situations which font fallback will be useful.
 The simple one is that every NSString contain only one kind of script,
but the whole application (or different applications) contain different script.
 The other one is that every NSString might contain more than one script.

 For the first situation, since preferredFontNames is a class methods,
maybe user can add a NSPrefferedFont = (Times, MingTi); in .GNUstepDefaults.
 Then in drawRun: of NSStringDrawing, it will try to use
 the specified font (NSFont, NSUserFont, ...) to convert
 the encoding strictly (using GSUniStrict flag instead).
If it won't work, it will try every preferredFontName with GSUniStrict flag.
 If all of them won't work, it will go back to use the specified font again
 without GSUniStrict as what it does right now.
 This should be easy to implement but involve several classes.
 As long as the list of preferredFont is short
 and the majority of strings are the same script,
 it should work efficiently.

For the second one, Apple move the fixFontAttributeInRange: into NSMutableAttributedString in AppKit. It needs to scan the whole string, seperate the script, and specify the correct font for each script (use preferredFont, too).
 This might need a lot of work to make it efficient,
 but once it works, it should works perfectly with the present GNUstep.
The programmers should remember that every time they set up a NSAttributedString,
 use fixFontAttributeInRange: to support multiple scripts.


This sounds fine with me, if you'd like to try to implement it (at least the first situation for now, which sounds easier).

I was wondering if you would also like to write some (short) documentation on how a user can set up GNUstep for multiple languages (and perhaps how a developer can program for it)? It would be good for me since I don't know much about it. Thanks

--
Adam Fedor, Digital Optics Corp.      | I'm glad I hate spinach, because
http://www.doc.com                    | if I didn't, I'd eat it, and you
                                      | know how I hate the stuff.





reply via email to

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