Writing chars in a view
Writing chars in a view
- Subject: Writing chars in a view
- From: Pascal Goguey <email@hidden>
- Date: Mon, 20 Jan 2003 00:02:34 +0900
Hello!
I am writing a midi application related to musical notation,
and this question has nothing to do with MIDI. Just to let you
know what I want to do.
So, there are musical fonts on the net. Within a font, all the
musical symbols exist, or are supposed to. When I want to
draw the 5 lines for music, I just repeat one character whicf
is a slice of these 5 lines.
Now the problem I have is that I would like to write a single
character at a position x,y in an NSView.
Apparently, there is a handy way to draw a string by defining
a dictionary of attributes and writing an attributed string
created with these attributes.
Now I would like to know the easiest way to draw, say, the
character 0x34 at (100, 100).
I can of course create a char array, set the first element
to 0x34, the second to 0, and then create an attributed
string from a C string, and then draw the string with
drawAtPoint, but it sound like killing a fly with a 105 mm
canon.
Is there a simpler way to draw a character in an NSView?
Thanks,
Pascal
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.