• 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
A couple of NSFont questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A couple of NSFont questions


  • Subject: A couple of NSFont questions
  • From: Steve Sims <email@hidden>
  • Date: Wed, 5 May 2004 19:59:36 -0400

OK gang,

Within the documentation for NSFont we have two class methods called preferredFontNames and setPreferredFontNames:. The documentation implies that in circumstances when Cocoa comes across a character/glyph that's not encoded within the currently selected font then it will search through the fonts until it finds one containing the requested glyph. However I can't work out how to make use of this functionality.

In my app I am making use of NSFont along with an NSMutableString in an NSTextStorage object hooked up to an NSTextContainer and NSLayoutManager and then extracting glyphs to use with NSBezierPath's appendBezierPathWithGlyph:inFont: call. This is all fine and dandy, except when I come to try to get beziers for characters that aren't in the font I'm using - then I get odd results.

You can see this font switching stuff in action in text input fields - Lucinda Grande, the system font, doesn't contain Korean or Japanese characters, but you can input a string that contains English, Korean, and Japanese characters.

What I can't work out is how to make use of this functionality. Do I have to check each glyph by hand, or is there a way to ask the text layout system what's the appropriate font for me to use for each glyph?

My second NSFont query is about NSFont's fontWithName:matrix: call. When I use this with differing size parameters for x and y scale I end up with very very large letter beziers. The spacing actually seems to be about right, but the letters are way too large. I've checked my code and the matrix passed to NSFont seems fine plus it works properly when the two size parameters are the same. Do you guys think this is a bug with NSBezierPath, or NSFont, or am I just doing something wrong?

Steve
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: A couple of NSFont questions
      • From: Douglas Davidson <email@hidden>
  • Prev by Date: Array operators (was: Custom canRemove binding)
  • Next by Date: OutlineView to TableView to TextView binding, oh my...
  • Previous by thread: Re: Another NSText... problem: a sticky attribute
  • Next by thread: Re: A couple of NSFont questions
  • Index(es):
    • Date
    • Thread