simonmaddox / SMFancyText

iOS text styling with a low overhead
24 stars 3 forks source link

Changing the font #5

Closed ac2099 closed 8 years ago

ac2099 commented 11 years ago

Hi,

I really like this html parser and am using it in my app. However, for the life of me I can't seem to be able to change the font that it displays, only things like italics and bold etc. Changing the font on the back end in my view controller doesn't work, it seems it has to be changed within the parser implementation file. I tried messing around with the UIFont controls in the drawRect part but it just distorted everything, and I couldn't determine why.

Could anyone help me with this?

Best,

Andre

simonmaddox commented 11 years ago

Hey Andre,

I was just responding to your email, but this is much better since it's on public record.

Honestly, the best course of action would be to use NSAttributedString and the -attributedText property on UILabel instead (if you're only supporting iOS 6.0 or later). This library was written before this existed in UIKit.

If you're supporting iOS 5 or earlier, I expect changing the font returned in this switch statement should do the trick.

Is this where you're changing the font already?

Cheers,

Simon

ac2099 commented 11 years ago

Thank you Simon! I appreciate the fast response. I'll see if I can get that to work.

Andre

— Sent from Mailbox for iPhone

On Sun, Oct 6, 2013 at 3:02 PM, Simon Maddox notifications@github.com wrote:

Hey Andre, I was just responding to your email, but this is much better since it's on public record. Honestly, the best course of action would be to use NSAttributedString and the -attributedText property on UILabel instead (if you're only supporting iOS 6.0 or later). This library was written before this existed in UIKit. If you're supporting iOS 5 or earlier, I expect changing the font returned in this switch statement should do the trick. Is this where you're changing the font already? Cheers,

Simon

Reply to this email directly or view it on GitHub: https://github.com/simonmaddox/SMFancyText/issues/5#issuecomment-25774159