• 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: RTFFromRange:documentAttributes: and Windows incompatibility?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RTFFromRange:documentAttributes: and Windows incompatibility?


  • Subject: Re: RTFFromRange:documentAttributes: and Windows incompatibility?
  • From: Fredrik Olsson <email@hidden>
  • Date: Fri, 14 Jul 2006 15:36:36 +0200

Julio Cesar Silva dos Santos skrev:
You cannot rely on Windows compatibility. Microsoft uses its own implementation of RTF which is, of course, different from the standard implementation. If it is crucial for you to use RTF I recommend a book called 'RTF Pocket Guide' by Sean M. Burke (O'Reilly) that explains what you should avoid when building an 'universal' RTF file. But you should think about PDF files as well, because MS did not create their implementation yet ;).

I need it to send formatted text that works both in the Windows and the
Mac version of the client application. As both Cocoa and Delphi have
standard controls that can consume and produce RTF data we thought it
would be the best bet.

But if I should write my own rtf writer, maybe I should convince the
bosses we should use html instead? And if so, how would I best create
html-streams from a NSAttributesString instance under 10.3?

Must I write my own "whatever format"-writer in either case?


// Fredrik Olsson

The link for the book is:

http://www.amazon.com/gp/product/0596004753/sr=1-1/qid=1152883268/ref=pd_bbs_1/102-2010063-4410561?ie=UTF8&s=books


Julio Cesar Silva dos Santos email@hidden Blogjective-C http://www.jcs.santos.nom.br/wp FetchYourLyrics http://www.jcs.santos.nom.br/fyl/fyl.html

On 14/07/2006, at 10:09, Fredrik Olsson wrote:

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
_______________________________________________
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: 
 >RTFFromRange:documentAttributes: and Windows incompatibility? (From: Fredrik Olsson <email@hidden>)
 >Re: RTFFromRange:documentAttributes: and Windows incompatibility? (From: Julio Cesar Silva dos Santos <email@hidden>)

  • Prev by Date: Re: Detecting Internet
  • Next by Date: Re: Accepting Background Clicks
  • Previous by thread: Re: RTFFromRange:documentAttributes: and Windows incompatibility?
  • Next by thread: Re: RTFFromRange:documentAttributes: and Windows incompatibility?
  • Index(es):
    • Date
    • Thread