setting font size

Joined
May 1, 2009
Messages
1
Reaction score
0
Points
1
Hi,

I am developing a text editor in which I use to set the font name and font size by selecting it from popup buttons.

Fonts obtained using the code:
NSArray *path=[[NSFontManager alloc] availableFonts];
[fontList addItemsWithTitlesath];

I use to set font using :
NSFont *font = [NSFont fontWithName:[fontList titleOfSelectedItem] size:[[fontSize titleOfSelectedItem] doubleValue]];

NSRange selectedRange= [textView rangeForUserCharacterAttributeChange];
[textView setFont:font range:selectedRange ];

This works properly if the selected text is composed of single font.
But if i select the text which is composed of multiple fonts, then font of entire text is set to the font, that is last selected from the popupbutton.


How can I resize the font size without affecting the fonts in it?

Thank you in advance

Rethish
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top