• 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: NSTextView, Mail, and umlauts / combining marks / diacriticals
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView, Mail, and umlauts / combining marks / diacriticals


  • Subject: Re: NSTextView, Mail, and umlauts / combining marks / diacriticals
  • From: Aki Inoue <email@hidden>
  • Date: Thu, 18 Oct 2007 09:39:59 -0700

Dominik,

The Mail (or WebView) behavior is not a feature, but rather a limitation of the rendering engine 8-).
Since XML contents (including HTML) are recommended to be maximally precomposed, WebKit is favoring not to bother accent compositions in certain cases to gain performance.


There are several ways to achieve what you're looking for here.

If what your users are requesting really is an ability to edit accent marks, you could use -deleteBackwardByDecomposingPreviousCharacter: method (it's bound to Control-Delete key by default).
The variant of -deleteBackward: method treats accent characters individually.


If you really need to display the base character and accents separately, you could subclass NSTextStorage and dynamically switch the content of string returned. For example, you could insert a space between the base character and accent characters when displaying them separately. Conventionally Unicode suggests the space character (U +0020) as the spacer.

A little more involved approach is to unmarking combining marks so that the rendering engine treats them as normal.
NSGlyphGenerator marks combining marks as NSGlyphInscribeOverstrike indicating the need for rendering time composition.
You could have a custom NSGlyphGenerator subclass that filters the flag out. One gotcha here is that there are some fonts that use negative glyph advancement by default for combining marks. You might have to tweak the glyph position for these cases.


Aki

On 2007/10/18, at 6:31, Dominik Wagner tcm wrote:


On 18.10.2007, at 15:21, Ricky Sharp wrote:


On Thursday, October 18, 2007, at 07:17AM, "Manfred Schwind" <email@hidden > wrote:
What our customers want is to clearly be able to see and edit every
codepoint of unicode. so they see a a" if  it has two codepoints
and a รค if it has one.

Would it help to insert e.g. a "Zero Width No-Break Space" (Unicode 0001) between every codepoint?

Regards,
Mani

I would not recommend doing that. ZWNBS happens to also be used for the UTF-16 BOM. There is another character to used instead should you need to go this route (see unicode.org "BOM" FAQ)


Having said that, a proper solution I think would be to step down to lower-level text APIs and not use the higher-level ones.

Since i don't want to do that and still have seen that mail actually does seperate the a and the " in its plain text mode: Doug or Aki, can you tell me how this is achieved?


Best,
 dom


-- Dominik Wagner Mail: email@hidden TheCodingMonkeys http://www.codingmonkeys.de/ Blog - DasGenie: !Scrap http://scrap.dasgenie.com/


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSTextView, Mail, and umlauts / combining marks / diacriticals (From: Dominik Wagner tcm <email@hidden>)
 >Re: NSTextView, Mail, and umlauts / combining marks / diacriticals (From: Half Activist <email@hidden>)
 >Re: NSTextView, Mail, and umlauts / combining marks / diacriticals (From: Dominik Wagner tcm <email@hidden>)
 >Re: NSTextView, Mail, and umlauts / combining marks / diacriticals (From: Manfred Schwind <email@hidden>)
 >Re: NSTextView, Mail, and umlauts / combining marks / diacriticals (From: Ricky Sharp <email@hidden>)
 >Re: NSTextView, Mail, and umlauts / combining marks / diacriticals (From: Dominik Wagner tcm <email@hidden>)

  • Prev by Date: Re: Problems with bindings and "continuously updates"
  • Next by Date: Trouble using createFileAtPath method to create file (revisited)
  • Previous by thread: Re: NSTextView, Mail, and umlauts / combining marks / diacriticals
  • Next by thread: Problems with bindings and "continuously updates"
  • Index(es):
    • Date
    • Thread