• 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
Default attributes when creating NSAttributedString from HTML?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Default attributes when creating NSAttributedString from HTML?


  • Subject: Default attributes when creating NSAttributedString from HTML?
  • From: Jim Correia <email@hidden>
  • Date: Tue, 7 Mar 2006 21:30:47 -0500

The documentation for NSAttributedString says that if NSWebPreferencesDocumentOption is unset that a default set of preferences are used. Is that default set documented?

It appears different than the WebKit/Safari default. If I load an unstyled HTML document into TextEdit, the basefont size appears to be Times 12. That same document loaded into Safari results in Times 16.

Is this intentional?

By adding either of the following to the document options (in my modified copy of TextEdit)

WebPreferences *webPreferences = [WebPreferences standardPreferences];
[options setObject: webPreferences forKey: NSWebPreferencesDocumentOption];


-or-

[options setObject: [NSNumber numberWithFloat: 96.0/72.0f] forKey: NSTextSizeMultiplierDocumentOption];

the basefont used ends up being identical to Safari.

Thanks,
Jim
_______________________________________________
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


  • Prev by Date: Re: Copying a view from one nib to another
  • Next by Date: Re: NSOutlineView selectedRow error?
  • Previous by thread: Localized date placeholder not "sticking" at run time
  • Next by thread: Plus and minus images
  • Index(es):
    • Date
    • Thread