• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting font size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting font size


  • Subject: Setting font size
  • From: rethish <email@hidden>
  • Date: Thu, 30 Apr 2009 16:13:38 +0530
  • Thread-topic: Setting font size

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 addItemsWithTitles:path];

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 textView contain text with a single font. But
when the textView contains text with multiple fonts , the size changes with
the font that is last selected from the popup button.

I need to change fontsize of the text like this:


But I get like this:




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

Thank you in advance

Rethish


PNG image

PNG image

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Setting the Font Size
  • Next by Date: Re: Why is NSString->FSRef so hard?
  • Previous by thread: Setting the Font Size
  • Next by thread: NSScanner off-by-one and I can't see why...
  • Index(es):
    • Date
    • Thread