Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-25 Thread Sean McBride
On Wed, 24 Nov 2010 10:14:29 -0800, Dave DeLong said:

You can also do:

NSString * snowflake = @\u2744;

You can also put the snowflake character itself within the @ (which I
won't attempt here, because either my mail client or the listserve will
surely destroy it).  Just be sure your source file is encoded as UTF8,
which is what gcc assumes.  Otherwise pass  -finput-charset to gcc to
specify UTF16 or whatever encoding your source file is.  However, I
think this all requires 10.5 or later.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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


NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Stephen Blinkhorn

Hi all,

This seems like a lame question to be fair.  I would like to be able  
to access the snowflake symbol from the 'Zapf Dingbats' font and  
simply draw it into a custom control applying attributes like font  
colour to it.


Charecter details are:

Name: 'SNOWFLAKE'
Unicode: 2744
UTF8: E2 9D 84

What's the best way to achieve this in 10.4/10.5 and 10.6  
simultaneously?


Thanks,
Stephen 
___


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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Nick Zitzmann

On Nov 24, 2010, at 10:46 AM, Stephen Blinkhorn wrote:

 Hi all,
 
 This seems like a lame question to be fair.  I would like to be able to 
 access the snowflake symbol from the 'Zapf Dingbats' font and simply draw it 
 into a custom control applying attributes like font colour to it.
 
 Charecter details are:
 
 Name: 'SNOWFLAKE'
 Unicode: 2744
 UTF8: E2 9D 84
 
 What's the best way to achieve this in 10.4/10.5 and 10.6 simultaneously?

Try something like this: (written in Mail, untested, use at your own risk)

unichar snowflake = 0x2744;
NSString *snowflakeStr = [NSString stringWithCharacters:snowflake length:1UL];
NSDictionary *attributes = {add your attributes here, like font and color};
NSAttributedString *snowflakeAttributedStr = [[[NSAttributedString alloc] 
initWithString:snowflakeStr attributes:attributes] autorelease];

[snowflakeAttributedStr drawInRect:{some rectangle}];

Alternately, if you need more control than that, you could use 
NSLayoutManager/NSTextStorage to get a glyph for the character, and then draw 
it using NSColor and NSBezierPath. But that might be overkill.

Nick Zitzmann
http://www.chronosnet.com/

___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Stephen Blinkhorn


On 24 Nov 2010, at 12:02, Nick Zitzmann wrote:



On Nov 24, 2010, at 10:46 AM, Stephen Blinkhorn wrote:


Hi all,

This seems like a lame question to be fair.  I would like to be  
able to access the snowflake symbol from the 'Zapf Dingbats' font  
and simply draw it into a custom control applying attributes like  
font colour to it.


Charecter details are:

Name: 'SNOWFLAKE'
Unicode: 2744
UTF8: E2 9D 84

What's the best way to achieve this in 10.4/10.5 and 10.6  
simultaneously?


Try something like this: (written in Mail, untested, use at your own  
risk)


unichar snowflake = 0x2744;
NSString *snowflakeStr = [NSString stringWithCharacters:snowflake  
length:1UL];


Those are the two lines I needed, thanks Nick.  This has nothing to do  
with Christmas either!


Stephen
___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Dave DeLong
You can also do:

NSString * snowflake = @\u2744;

Cheers,

Dave

On Nov 24, 2010, at 10:11 AM, Stephen Blinkhorn wrote:

 
 On 24 Nov 2010, at 12:02, Nick Zitzmann wrote:
 
 
 On Nov 24, 2010, at 10:46 AM, Stephen Blinkhorn wrote:
 
 Hi all,
 
 This seems like a lame question to be fair.  I would like to be able to 
 access the snowflake symbol from the 'Zapf Dingbats' font and simply draw 
 it into a custom control applying attributes like font colour to it.
 
 Charecter details are:
 
 Name: 'SNOWFLAKE'
 Unicode: 2744
 UTF8: E2 9D 84
 
 What's the best way to achieve this in 10.4/10.5 and 10.6 simultaneously?
 
 Try something like this: (written in Mail, untested, use at your own risk)
 
 unichar snowflake = 0x2744;
 NSString *snowflakeStr = [NSString stringWithCharacters:snowflake 
 length:1UL];
 
 Those are the two lines I needed, thanks Nick.  This has nothing to do with 
 Christmas either!
 
 Stephen
 ___
 
 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/davedelong%40me.com
 
 This email sent to davedel...@me.com

___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Murat Konar
Beware the user that has removed all fonts that contain a snowflake... Maybe it 
would be better to roll your own.

_murat

On Nov 24, 2010, at 10:14 AM, Dave DeLong wrote:

 You can also do:
 
 NSString * snowflake = @\u2744;
 
 Cheers,
 
 Dave
 
 On Nov 24, 2010, at 10:11 AM, Stephen Blinkhorn wrote:
 
 
 On 24 Nov 2010, at 12:02, Nick Zitzmann wrote:
 
 
 On Nov 24, 2010, at 10:46 AM, Stephen Blinkhorn wrote:
 
 Hi all,
 
 This seems like a lame question to be fair.  I would like to be able to 
 access the snowflake symbol from the 'Zapf Dingbats' font and simply draw 
 it into a custom control applying attributes like font colour to it.
 
 Charecter details are:
 
 Name: 'SNOWFLAKE'
 Unicode: 2744
 UTF8: E2 9D 84
 
 What's the best way to achieve this in 10.4/10.5 and 10.6 simultaneously?
 
 Try something like this: (written in Mail, untested, use at your own risk)
 
 unichar snowflake = 0x2744;
 NSString *snowflakeStr = [NSString stringWithCharacters:snowflake 
 length:1UL];
 
 Those are the two lines I needed, thanks Nick.  This has nothing to do with 
 Christmas either!
 
 Stephen
 ___
 
 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/davedelong%40me.com
 
 This email sent to davedel...@me.com
 
 ___
 
 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/murat%40pixar.com
 
 This email sent to mu...@pixar.com

___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Stephen Blinkhorn

On 24 Nov 2010, at 12:56, Murat Konar wrote:


Beware the user that has removed all fonts that contain a snowflake...


Yeah, I did wonder about such a thing.  But why would anyone do a  
thing like that!?


Stephen




_murat

On Nov 24, 2010, at 10:14 AM, Dave DeLong wrote:


You can also do:

NSString * snowflake = @\u2744;

Cheers,

Dave

On Nov 24, 2010, at 10:11 AM, Stephen Blinkhorn wrote:



On 24 Nov 2010, at 12:02, Nick Zitzmann wrote:



On Nov 24, 2010, at 10:46 AM, Stephen Blinkhorn wrote:


Hi all,

This seems like a lame question to be fair.  I would like to be  
able to access the snowflake symbol from the 'Zapf Dingbats'  
font and simply draw it into a custom control applying  
attributes like font colour to it.


Charecter details are:

Name: 'SNOWFLAKE'
Unicode: 2744
UTF8: E2 9D 84

What's the best way to achieve this in 10.4/10.5 and 10.6  
simultaneously?


Try something like this: (written in Mail, untested, use at your  
own risk)


unichar snowflake = 0x2744;
NSString *snowflakeStr = [NSString  
stringWithCharacters:snowflake length:1UL];


Those are the two lines I needed, thanks Nick.  This has nothing  
to do with Christmas either!


Stephen
___

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/davedelong%40me.com

This email sent to davedel...@me.com


___

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/murat%40pixar.com

This email sent to mu...@pixar.com




___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Nick Zitzmann

On Nov 24, 2010, at 12:35 PM, Stephen Blinkhorn wrote:

 Beware the user that has removed all fonts that contain a snowflake...
 
 Yeah, I did wonder about such a thing.  But why would anyone do a thing like 
 that!?

I wouldn't worry about it in this case. Zapf Dingbats is a system font 
(installed in /System/Library/Fonts) and cannot be easily uninstalled without 
breaking things elsewhere.

Nick Zitzmann
http://www.chronosnet.com/

___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Kyle Sluder
On Wed, Nov 24, 2010 at 11:35 AM, Stephen Blinkhorn
stephen.blinkh...@audiospillage.com wrote:
 On 24 Nov 2010, at 12:56, Murat Konar wrote:

 Beware the user that has removed all fonts that contain a snowflake...

 Yeah, I did wonder about such a thing.  But why would anyone do a thing like
 that!?

Does it matter?

If you need to guarantee the existence of a snowflake glyph, provide
one yourself.

--Kyle Sluder
___

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


Re: NSString/NSFont/Dingbats and the SnowFlake symbol

2010-11-24 Thread Ricky Sharp

On Nov 24, 2010, at 1:58 PM, Kyle Sluder wrote:

 On Wed, Nov 24, 2010 at 11:35 AM, Stephen Blinkhorn
 stephen.blinkh...@audiospillage.com wrote:
 On 24 Nov 2010, at 12:56, Murat Konar wrote:
 
 Beware the user that has removed all fonts that contain a snowflake...
 
 Yeah, I did wonder about such a thing.  But why would anyone do a thing like
 that!?
 
 Does it matter?
 
 If you need to guarantee the existence of a snowflake glyph, provide
 one yourself.


Or, render the glyph in black on a white background (then save to an image to 
bundle with your app)

Use that image as a mask while drawing colored swatches.  There are other ways 
to do too via the various blending modes.
___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.com



___

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