• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Mixing Chinese and Japanese text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mixing Chinese and Japanese text


  • Subject: Re: Mixing Chinese and Japanese text
  • From: Douglas Davidson <email@hidden>
  • Date: Fri, 15 Sep 2006 12:58:37 -0700


On Sep 15, 2006, at 9:05 AM, Jakob Olesen wrote:

On 15/09/2006, at 16.08, John Stiles wrote:

Explicitly set the font for the Japanese text to a Japanese font, and the font for the Chinese text to a Chinese font. This should solve it.

I think I might have to do something like that. The problem is that modern Chinese and Japanese contains quite a bit of Latin characters too, check out http://www.sinomac.com/ and http:// www.vodafone.jp/


The Chinese and Japanese fonts typically contain limited support for Latin characters: US-ASCII and a few accents, but not all. Then I have the opposite problem with font substitution for Latin text.

I guess I could scan the text for ideographic characters + kana and set the proper CJK font only for those characters.

Right now it sounds like you're using the default font (Lucida/ Helvetica) and relying on the system to do font substitution. Font substitution works pretty well, but as you've seen, it is not perfect—given a CJK character which is shared between Chinese and Japanese, it has to guess whether it should use a Chinese font or a Japanese font, and it guesses by looking at your International prefs.

You are right, I am relying on the system font substitution. It works really well when it knows the language, so I was hoping for a way to tell it about the language rather than reinventing the wheel.

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.


Douglas Davidson

_______________________________________________
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


  • Follow-Ups:
    • Re: Mixing Chinese and Japanese text
      • From: Jakob Olesen <email@hidden>
References: 
 >Mixing Chinese and Japanese text (From: Jakob Olesen <email@hidden>)
 >Re: Mixing Chinese and Japanese text (From: John Stiles <email@hidden>)
 >Re: Mixing Chinese and Japanese text (From: Jakob Olesen <email@hidden>)

  • Prev by Date: Re: writing huge C-array to a file
  • Next by Date: Mail.app outline view font
  • Previous by thread: Re: Mixing Chinese and Japanese text
  • Next by thread: Re: Mixing Chinese and Japanese text
  • Index(es):
    • Date
    • Thread