• 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: How to find unencoded characters
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to find unencoded characters


  • Subject: Re: How to find unencoded characters
  • From: Matt Gough <email@hidden>
  • Date: Tue, 01 Mar 2011 08:59:06 +0000

>> But as the font name "LastResort" is nowhere documented (or is it?), Apple is free to change it to "LionsLastResort" this summer.

http://developer.apple.com/fonts/LastResortFont/

I doubt they'd rename it, seems they just extend it as necessary:
http://en.wikipedia.org/wiki/Fallback_font#Apple.27s_LastResort_font

Matt

On 1 Mar 2011, at 08:49, Gerriet M. Denkmann wrote:

>
> On 28 Feb 2011, at 19:36, email@hidden wrote:
>
>> There are quite a few characters, which OS X cannot print.
>> E.g. ›« ≈ 0x2b809 (CJK Unified Ideographs Extension D)
>>
>> I would like to have a function or method like:
>> BOOL myComputerCanDisplayThisUnicodeCodePoint( unsigned int codePoint);
>>
>> How can I get this information?
>
> To answer my own question: this code seems to work:
>
> + (BOOL)weCanDisplayTheFirstCharacterIn: (NSString *)aString ;
> {
> 	NSRange oneChar = [ aString rangeOfComposedCharacterSequenceAtIndex: 0 ];
> 	NSString *firstChar = [ aString substringWithRange: oneChar ];
> 	NSMutableAttributedString *attributedString = [ [ NSMutableAttributedString alloc ] initWithString: firstChar ];
> 	[ attributedString fixFontAttributeInRange: NSMakeRange(0,1) ];
> 	NSFont *aFont = [ attributedString attribute: NSFontAttributeName  atIndex: 0  effectiveRange: NULL ];
> 	NSString *fontName = [aFont fontName];
> 	[ attributedString release ];
> 	//NSLog(@"%s \"%@\" → %@",__FUNCTION__, firstChar, fontName);
> 	BOOL weCan = ![ fontName isEqualToString: @"LastResort" ];
> 	return weCan;
> }
>
> But as the font name "LastResort" is nowhere documented (or is it?), Apple is free to change it to "LionsLastResort" this summer.
> Also, this method does not look too efficient.
>
> So: is there an efficient, non-hackish way to get this information?
>
> Kind regards,
>
> 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

_______________________________________________

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: 
 >Re: How to find unencoded characters (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: Subview getting clipped by its parent view when scale transformation done
  • Next by Date: Re: NSAttributedString crashes
  • Previous by thread: Re: How to find unencoded characters
  • Next by thread: Subview getting clipped by its parent view when scale transformation done
  • Index(es):
    • Date
    • Thread