Re: Fixed pitch font - glyphs sometimes drawn fixed, sometimes variable
Re: Fixed pitch font - glyphs sometimes drawn fixed, sometimes variable
- Subject: Re: Fixed pitch font - glyphs sometimes drawn fixed, sometimes variable
- From: Douglas Davidson <email@hidden>
- Date: Tue, 08 Mar 2005 11:26:10 -0800
On 2005-03-08 09:41:13 -0800 Simon Liu <email@hidden> wrote:
Hi,
Using an NSAttributedString, with a fixed pitch font (Courier New,
Size 11.0) I am trying to display black stars and centre blocks to
simulate an iTunes style rating cell. This works okay, except for the
case where no stars are displayed and only 5 centre blocks are
displayed.
// Case 1 --> 3 stars with 2 blocks [OK]
stringWithFormat:@"%C%C%C%C%C",0x2605, 0x2605, 0x2605, 0x25aa,
0x25aa];
// Case 2 --> 0 stars with 5 blocks [FAILS , the blocks are not
displayed in fixed width, and are bunched up]
stringWithFormat:@"%C%C%C%C%C",0x25aa, 0x25aa, 0x25aa, 0x25aa,
0x25aa];
I am not sure why Case 2 fails. Can anybody shed some light on this?
Thanks.
I suspect your font doesn't actually contain glyphs for these
characters. I'm not sure why this would work in any case. It seems
to me that you're really not interested in using the font metrics for
this particular use, so you might well be better off drawing each
glyph individually at a location that you calculate.
Douglas Davidson
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden