• 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: RTF incompatibilites Windows/NSAttributesString RTFFromRange:...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RTF incompatibilites Windows/NSAttributesString RTFFromRange:...


  • Subject: Re: RTF incompatibilites Windows/NSAttributesString RTFFromRange:...
  • From: Fredrik Olsson <email@hidden>
  • Date: Wed, 28 Jun 2006 16:21:40 +0200

Fredrik Olsson skrev:
I have trouble saving conforming RTF-documents from a NSAttributedString.

Windows XP's Wordpad refuses the fonts, and even more stangely refuses to change the fonts in the loaded document. Replacing all fonts with a scaled bitmap system font. I use standrd fonts such as Times New Roman and Comix Sans MS that are available, so it is not that.

Further more bullet lists are ignored when opening documents saved from Wordpad, and then converted to a NSAttributesString.


Investigating the rtf files as plain text reveals that the header and list definitions differ quite allot. Is there something I have missed on Cocoa's part when it comes to readon and writing more Win compatible files?
Cocoa is more forgiving only failing with reading lists, so writing more compatible files is more of a priority.


Some clarifications:
AppKit seems not to cre if a font is called "LucidaSans" or "LucidaSans" nor "TimesNewRomanPSMT" or "Times New Roman". It simply gets the best match, that is my guess after experimenting. Windows (Wordpad and RechTextBox provided by Delphi and VB6, I assume hey share common code a they behave the same) apply no intelligence at all on font matching.
Solution; Make AppKit write the most probably Windows font name, not the "correct" one?


AppKit saves bulletlists using "{\listtext \'a5 }" that is stated as "Word 97" numberng according to http://www.biblioscape.com/rtf15_spec.htm, that also says it should safely be ignored by readers that do not understand Word 97 numbering. Well, Wordpad do ignore it, safely, but not pretty.
Wordpad saves lists using "{\pntext\f4\'B7\tab}", or what the spec says is Word 6.0/95 numbering.



Some more or less intelligent search and replace would solve the bullets, how to solve the font in a good manner is beyond me this late in the afternoon.


So I guess the question is; is there a way to force AppKit to read and write Word 95 formatted RTF-files, and write more Windows friendly font names?

// Fredrik Olsson


// Fredrik Olsson

ps. I attach two files, one win and one mac, with the same content, but much different formatting on either platform.
------------------------------------------------------------------------


 _______________________________________________
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
References: 
 >RTF incompatibilites Windows/NSAttributesString RTFFromRange:... (From: Fredrik Olsson <email@hidden>)

  • Prev by Date: Implementing a TCP port listener in Cocoa
  • Next by Date: Re: One of the children has a bad / missing connection
  • Previous by thread: RTF incompatibilites Windows/NSAttributesString RTFFromRange:...
  • Next by thread: QuartzComposerWWDC
  • Index(es):
    • Date
    • Thread