1

I need to italicized and bold an NSMutableAttributedString, I tried some combinations but only one attribute works.

[attributedText addAttributes:@{NSFontAttributeName:[UIFont italicSystemFontOfSize:14], NSFontAttributeName:[UIFont boldSystemFontOfSize:boldTextFontSize]}
                        range:range3]; 

and

[attributedText addAttributes:@{NSFontAttributeName:[UIFont italicSystemFontOfSize:14]}
                        range:range3];
[attributedText addAttributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:boldTextFontSize]}
                        range:range3];

Only one of them is applied to the string. Is there a practical way to solve this problem?

chubao
  • 5,871
  • 6
  • 39
  • 64
Kalmdoun
  • 31
  • 3

1 Answers1

3

A font file contains all displayable characters, but in only one (!) style. To show a bold-italic font, you will have to load a file that contains bold-italic symbols.

You can not load 2 font files and expect the OS to mix them up...

If there is no bold-italic font, you need to use a custom font.

Anticro
  • 685
  • 4
  • 12