Thread: setting font size
05-01-2009, 08:20 AM #1
setting font size
- Member Since
- May 01, 2009
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];
I use to set font using :
NSFont *font = [NSFont fontWithNamefontList 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
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
By nancyspeed in forum Switcher HangoutReplies: 1Last Post: 09-19-2013, 01:25 PM
By twodarhythm in forum Switcher HangoutReplies: 7Last Post: 02-15-2010, 03:43 AM
By jearnest in forum Switcher HangoutReplies: 2Last Post: 05-20-2008, 01:15 AM
By MarcInJapan in forum OS X - Operating SystemReplies: 1Last Post: 10-19-2007, 02:53 AM
By VeritasCCT in forum Apple NotebooksReplies: 2Last Post: 03-08-2006, 04:22 PM