RTFFromRange:documentAttributes: and Windows incompatibility?
RTFFromRange:documentAttributes: and Windows incompatibility?
- Subject: RTFFromRange:documentAttributes: and Windows incompatibility?
- From: Fredrik Olsson <email@hidden>
- Date: Fri, 14 Jul 2006 15:09:16 +0200
How can I force Cocoa to write font names that Windows Wordpad can
recognize?
Example: Cocoa writes ArialMT. Windows 2k will not recognize it but use
Arial instead. Windows XP will not recognize it either and do even
worse: it will use a bitmapped system font.
The hidden class NSRTFWriter have a private method called
_plainFontNameForFont:, and it do return "ArialMT" for [NSFont
fontWithName:@"Arial" size:10.0] argument. So I guess this is pretty
close to where the blame is. But how can I whip up a remedy?
I attach three files, all with he same visual content. All three render
equally in TextEdit, or any other Cocoa app tested.
test_macrtf.rtf - Is saved from TextEdit, using
RTFFromRange:documentAttributes: in code gives same result. Displays ok
with win2k, terrible with winxp.
test_winrtf.rtf - Is saved from Wordpad, it can be opened and displays
identically with Cocoa and Wordpad for both 2k and xp.
// Fredrik Olsson
Attachment:
test_winrtf.rtf
Description: RTF file
Attachment:
test_macrtf.rtf
Description: RTF file
_______________________________________________
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