Re: Mixing Chinese and Japanese text
Re: Mixing Chinese and Japanese text
- Subject: Re: Mixing Chinese and Japanese text
- From: Jakob Olesen <email@hidden>
- Date: Sat, 16 Sep 2006 12:51:44 +0200
On 15/09/2006, at 21.58, Douglas Davidson wrote:
Setting an appropriate font based on the characters is probably the
easiest option at the moment. The standard font substitution is
necessarily imperfect. It is possible to override it, however, by
using a custom NSTextStorage and overriding -
fixFontAttributeInRange:. That would allow you to implement a
custom language attribute that you could use to determine a font to
substitute in each individual case.
Thanks,
So I can override the font substitution, but there is no way of
injecting a different locale into the default algorithm. The
situation seems to be the same with ATSUI - I can place a font list
in front of the default, but no locale injection.
In that case, I will pre-substitute a locale-appropriate font for
ideographic characters (and possibly kana), and let the default
algorithm handle the rest. I should probably also set
NSCharacterShapeAttributeName to one of
kTraditionalCharactersSelector, kSimplifiedCharactersSelector, or
kJIS1990CharactersSelector. I am guessing
kTraditionalCharactersSelector for Korean and Vietnamese, not sure
about that, though.
Out of curiosity: is there any way of determining the intended locale
of a CJK font, or do you have to know?
Back in the late 80's, I was the proud owner of an Amstrad DMP2000
dot matrix printer. I had been localized to Danish by replacing the
characters [|] with the Danish letters æøå. This was before Latin1.
Whoever did the localization was clearly clueless about Danish
typography. The letter ø looked like a small circle with a slash, not
an o with a slash. In running text it stod out like a sore thumb. I
was so annoyed by this that I eventually took out the firmware PROM,
reverse engineered the font bitmaps, and replaced it with an EPROM
containing a proper ø.
OK, so I had a lot of time on my hands back then.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden