• 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
Replacing Font/Size of NSMutableAttributedString, but not styles
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Replacing Font/Size of NSMutableAttributedString, but not styles


  • Subject: Replacing Font/Size of NSMutableAttributedString, but not styles
  • From: Dan Wood <email@hidden>
  • Date: Mon, 05 Aug 2002 14:37:14 -0700

I have an attributed string that I have initialized from HTML. If
there is no <font> tag in the HTML, it comes out in a too-small Times
Roman font. I want to change the typeface and size -- but not lose the
styles (e.g. bold, italic) that are in the text already.

I've found that I can just put <font> tags around the HTML before
converting, and it comes close -- but I don't quite have the control
over the font sizes that I want. So I've tried to use
-[NSMutableAttributedString addAttributes], but then the styles get
wiped out.

Any suggestions for either (a) parsing the HTML with a particular base
font, rather than Times Roman, or (b) cleanly replacing the typeface
and size, without the styles?

Regards,
Dan Wood


--
Dan Wood
Karelia Software, LLC
email@hidden
http://www.karelia.com/
Watson for Mac OS X: http://www.karelia.com/watson/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: NSArray vs. embedded loop in C?
  • Next by Date: Re: Accessor methods and (auto)release: conclusion
  • Previous by thread: Another try: removing the focus from an NSTextField
  • Next by thread: Re: Replacing Font/Size of NSMutableAttributedString, but not styles
  • Index(es):
    • Date
    • Thread