Drawing lines between text
Drawing lines between text
- Subject: Drawing lines between text
- From: Keith Blount <email@hidden>
- Date: Sat, 9 Jul 2005 13:52:34 -0700 (PDT)
Hello,
I feel this should be very simple, so I am probably
overlooking something very obvious, but...
I am drawing an attributed string in a view using
NSAttributedString's drawInRect: method. I would like
to make this view look like lined paper, so I need to
draw lines between each line of text. How can I get
the line height for each line of text drawn to
calculate this?
I have tried calling pointSize on the font, but this
doesn't give the padding. I have also tried using
NSLayoutManager like this:
NSLayoutManager *lm = [[NSLayoutManager alloc] init];
float lineHeight = [lm defaultLineHeightForFont:font];
[lm release];
Neither seem to work right for all fonts, however.
If anyone has any suggestions of how to calculate the
line height for arbitrary fonts when using
NSAttributedString's drawInRect: so that I can figure
out where to draw my lines, I would be very grateful.
Many thanks,
Keith
__________________________________
Discover Yahoo!
Use Yahoo! to plan a weekend, have fun online and more. Check it out!
http://discover.yahoo.com/
_______________________________________________
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