• 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: -glyphWithName:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -glyphWithName:


  • Subject: Re: -glyphWithName:
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Sun, 24 Aug 2014 17:30:44 +0700

On 24 Aug 2014, at 02:00, Holmberg Bertil <email@hidden> wrote:

> The first part of this method shows how to get the glyph from any character
> Works fine with non-Latin characters such as Japanese too

Does it also work with aChar starting with the Japanese HIRAGANA LETTER ARCHAIC YE (U+1B001) ?
Hint: chars[0] will contain part of a surrogate pair.

> - (UIBezierPath *)bezierPathFromChar:(NSString *)aChar inFont:(CTFontRef)aFont {
>    // Buffers
>    unichar chars[1];
>    CGGlyph glyphs[1];
>
>    // Copy the character into the buffer
>    chars[0] = [aChar characterAtIndex:0];
>
>    // Encode the glyph for the single character into another buffer
>    CTFontGetGlyphsForCharacters(aFont, chars, glyphs, 1);
>
>    // Get the single glyph
>    CGGlyph aGlyph = glyphs[0];
>
>    // Find a reference to the Core Graphics path for the glyph
>    CGPathRef glyphPath = CTFontCreatePathForGlyph(aFont, aGlyph, NULL);
>
>    // Create a bezier path from the CG path
>    UIBezierPath *glyphBezierPath = [UIBezierPath bezierPath];
>    [glyphBezierPath moveToPoint:CGPointZero];
>    [glyphBezierPath appendPath:[UIBezierPath bezierPathWithCGPath:glyphPath]];
>
>    CGPathRelease(glyphPath);
>
>    return glyphBezierPath;
> }
>

Gerriet.


_______________________________________________

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


  • Prev by Date: Re: Which NSWindow methods have asynchronous operation?
  • Next by Date: How to synchronize my MacOS-X application with Core-Data automatic Undo management?
  • Previous by thread: Re: -glyphWithName:
  • Next by thread: Bad EXC_BAD_INSTRUCTION on drawRect call in Swift
  • Index(es):
    • Date
    • Thread