[etoys-dev] All fallback fonts restored after installing a font package

Xin Wang dram.wang at gmail.com
Wed Oct 27 11:13:21 EDT 2010

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?


Xin Wang

More information about the etoys-dev mailing list