[etoys-dev] All fallback fonts restored after installing a font package
yoshiki at vpri.org
Sat Nov 13 23:37:39 EST 2010
At Wed, 27 Oct 2010 23:13:21 +0800,
Xin Wang wrote:
> Hi all,
> When trying to make a Chinese font SAR package, I encountered a problem.
> After comparing display result of TTCFont and StrikeFont, I decided to
> use TTCFont to display Chinese character, so I have to install Chinese
> font as fallbackFont of BitstreamVeraSans. But in Locale
> class>>switchAndInstallFontToID:, when font package is successfully
> installed, StrikeFont class>>setupDefaultFallbackTextStyle will be
> called. Then all fonts' fallbackFont will be restored to StrikeFont
> class>>defaultFallbackTextStyle, so as BitstreamVeraSans, then Chinese
> character will not be displayed.
> What I can do now is setting newly installed font as
> TextConstants>>#DefaultFallbackFont, which is examined by StrikeFont
> class>>defaultFallbackTextStyle. But after that, when users try to
> change to another language, following the similar process, all fonts'
> fallbackFont will be set to TextConstants>>#DefaultFallbackFont
> instead of Accuny, as a result, characters in that language can not be
> I think it's better to call StrikeFont
> class>>setupDefaultFallbackTextStyle in font package, so different
> font packages can decide to whether call it or not. Or there is a
> better way to solve this problem?
Not much so far, but I think this is a good idea. I'd have these
methods in each LanguageEnvironment subclasses and put default font
setting be the responsibility there.
More information about the etoys-dev