• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Writing chars in a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Getting a reference to the data model from a delegate (From: mw <email@hidden>)

  • Prev by Date: Re: Getting a reference to the data model from a delegate
  • Next by Date: Re: Newbie Build Problems -- Found a bug?
  • Previous by thread: Re: Getting a reference to the data model from a delegate
  • Next by thread: Re: Getting a reference to the data model from a delegate
  • Index(es):
    • Date
    • Thread