• 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
Bug in 10.12 drawing glyph from labelFont or systemFont with bezier path
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in 10.12 drawing glyph from labelFont or systemFont with bezier path


  • Subject: Bug in 10.12 drawing glyph from labelFont or systemFont with bezier path
  • From: Jerome Krinock <email@hidden>
  • Date: Thu, 11 Aug 2016 16:21:08 -0700

If you create a font using -labelFontOfSize: or -systemFontOfSize:, then send it a -glyphWithName message, then pass the resulting glyph and the font to -[NSBezierPath appendBezierPathWithGlyph:font:], the resulting bezier path draws several horizontal bars instead of the expected character glyph.

This code works as expected in 10.11, but fails when run in 10.12 Beta 4 or Beta 5.

NSFont* font = [NSFont labelFontOfSize:100] ;
NSGlyph g = [font glyphWithName:glyphName] ;
NSRect glyphRect = [font boundingRectForGlyph:g] ;
CGFloat offsetX = NSMidX(glyphRect) - halfWidth ;
CGFloat offsetY = NSMidY(glyphRect) - 50 ;
[path moveToPoint:NSMakePoint(-offsetX,-offsetY)] ;
[path appendBezierPathWithGlyph:g
                         inFont:font] ;

Anything wrong with that?

Workaround is to name font @“Helvetica” using -fontWithName:size:, instead of -labelFontOfSize: or systemFontOfSize:.

Apple Bug 27813593.  Demo:

https://github.com/jerrykrinock/SSYVectorImageTester.git


_______________________________________________

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: NSTask Open Word File
  • Next by Date: Re: Objective-C basics - (Why NSNumber conforms to NSCopying protocol)
  • Previous by thread: Re: NSTask Open Word File
  • Next by thread: Re: awakeFromFetch behaviour change in 10.12?
  • Index(es):
    • Date
    • Thread