Re: setting font

2012-08-06 Thread Fritz Anderson
On 6 Aug 2012, at 3:05 AM, Luca Ciciriello  wrote:

> I'm trying to set a specific font in my UITextView.
> 
> The font is Chalkboard SE Regular and my code is 
> 
> [[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
> size:39.0f]];
> 
> but nothing appear un my UITextView.
> 
> Where is my mistake?

It's the wrong name; it should be ChalkboardSE-Regular. I'm not sure there is 
much of a rule that maps between font names and their human-readable families. 
This useful site:  lists all available fonts in iOS. The 
names in the first column of the table are the ones you should use.

— F

-- 
Fritz Anderson -- Xcode 4 Unleashed: Now in stores! -- 



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: setting font

2012-08-06 Thread Luca Ciciriello
Thanks, You are right. My problem was in the name of the font 
(@"ChalkboardSE-Regular")

Luca.


On Aug 6, 2012, at 7:30 PM, Jens Alfke  wrote:

> 
> On Aug 6, 2012, at 1:05 AM, Luca Ciciriello  
> wrote:
> 
>> [[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
>> size:39.0f]];
> 
> Make sure that UIFont call isn't returning nil. In my experience, APIs that 
> look up fonts by name are very picky about the name (for instance, you 
> lowercased "SE" and didn't capitalize "Regular"). Moreover, the internal name 
> may not match the displayed name.
> 
> —Jens

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: setting font

2012-08-06 Thread Jens Alfke

On Aug 6, 2012, at 1:05 AM, Luca Ciciriello  wrote:

> [[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
> size:39.0f]];

Make sure that UIFont call isn't returning nil. In my experience, APIs that 
look up fonts by name are very picky about the name (for instance, you 
lowercased "SE" and didn't capitalize "Regular"). Moreover, the internal name 
may not match the displayed name.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

setting font

2012-08-06 Thread Luca Ciciriello
Hi All.
I'm trying to set a specific font in my UITextView.

The font is Chalkboard SE Regular and my code is 

[[self textView] setFont:[UIFont fontWithName:@"Chalkboard se regular" 
size:39.0f]];

but nothing appear un my UITextView.

Where is my mistake?

Luca.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Setting font size

2009-04-30 Thread rethish

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


<><>___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com