On Tue, 28 Aug 2007 10:47:30 +0200,
Paolo Scoppola (email@hidden) wrote:
>I'm developing on OSX 10.4 and I need to draw accented chars like:
>à,è,é,ì,ò,ù. I'm using char arrays with UTF-8 encoding.
>
>Here's the code:
>
>ATSUFindFontFromName(fontName, strlen(fontName),
> kFontFamilyName,
> kFontNoPlatformCode,
> kFontNoScript,
> kFontNoLanguage, &font);
>
>ATSUCreateStyle(style);
>
>// setting bold/italic/condensed...
>ATSUSetAttributes(style, iAttributeCount, iTag, iValueSize, iValue);
>
>// set on kDiacriticsType flag
>ATSUSetFontFeatures(style, 1, &type, &sel);
ATSUSetFontFeatures has little or nothing to do with the ability
to draw accented characters.
>ATSUCreateTextLayoutWithTextPtr((ConstUniCharArrayPtr)myString,
> kATSUFromTextBeginning,
> kATSUToTextEnd, length, 1, &length, style, layout);
How do you declare and initialize myString? It's not shown in the
code you posted. However, you mention using UTF-8-encoded buffers,
so I wonder if you're converting those to UTF-16 before feeding them
to ATSUCreateTextLayoutWithTextPtr().
>I know that one solution could be overlapping the diacritical glyph on
>the char glyph like:
>
>è = e + '
>
>but this solution fails on char 'i' because the accent doesn't overlap
>fine the point on the char 'i'
>
>ì = i + '
Works fine for me. The second character is U+0300 COMBINING GRAVE ACCENT,
right?
-- marco
--
It's not the data universe only, it's human conversation.
They want to turn it into a one-way flow that they have entirely
monetized. I look at the collective human mind as a kind of
ecosystem. They want to clear cut it. They want to go into the
rainforest of human thought and mow the thing down.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden
This email sent to email@hidden