Re: Unlocalises displayName for NSFont?
Re: Unlocalises displayName for NSFont?
- Subject: Re: Unlocalises displayName for NSFont?
- From: Aki Inoue <email@hidden>
- Date: Mon, 7 Aug 2006 12:30:23 -0700
Override NSRTFWriter's method _plainFontNameForFont: so that it
returns font names that Wordpad for Windows XP like better :).
I have to strongly discourage doing this even though I understand the
reasoning behind this. This could jeopardize both your app's binary
compatibility and RTF file format compatibility with a future version
of Mac OS X.
The default implementation writes for example; ArialMT, Wordpad
expects Arial. Other examples: ComicSansMS => Comic Sans MS and
TimesNewRomanPSMT => Times New Roman.
Cocoa have no problem figuring out the font using either name, but
Wordpad (Or any application using the RuchEdit control) only
recognizes the latter.
For majority of cases, the family name should suffice your purpose.
Aki
On Aug 6, 2006, at 11:35 PM, Fredrik Olsson wrote:
Aki Inoue skrev:
Fredrik,
It's unclear your intention here. The font's fullname (accessible
via -displayName) is coming from an independent entry in the font's
name database independent from other names such as family names.
In other words, font designers are free to have names that don't
conform to the rule you're using here to derive the font name (and
there are tons of irregular fonts out there).
What's your intended use of the derived name ?
Override NSRTFWriter's method _plainFontNameForFont: so that it
returns font names that Wordpad for Windows XP like better :).
The default implementation writes for example; ArialMT, Wordpad
expects Arial. Other examples: ComicSansMS => Comic Sans MS and
TimesNewRomanPSMT => Times New Roman.
Cocoa have no problem figuring out the font using either name, but
Wordpad (Or any application using the RuchEdit control) only
recognizes the latter.
// Fredrik Olsson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden