Replacing Font/Size of NSMutableAttributedString, but not styles
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.