font problem with NSTextView / using ATSUI with Cocoa?

  • I'm trying to to build a font-based musical notation program in Cocoa
    using a special TrueType music font called Boulez.  When I use an
    NSTextView object and select the Boulez font from the Font Panel
    object, Lucida Grande is used instead.  I've also tried setting the
    font using setFont and the same thing happens.  I adapted a Carbon
    example using ATSUI and that displays the font just fine.  Are there
    some types of fonts that simply don't work with Cocoa's text handling?

    I'd much rather create a Cocoa app than a Carbon app.  From what I
    understand it is possible to use ATSUI for displaying text within a
    Cocoa app, but I haven't been able to find any example code or
    tutorials for this particular combination.  Does anybody know where I
    can find such a thing?

    Thanks very much,

    Jake Rundall
  • The font is implemented as so called a "Pi" font.

    In Unicode handling, Windows and Cocoa apps map the characters to U
    +F0xx area instead of the original ASCII.

    So, for example, in order to display the digit in font, you should
    specify 0xF030 ~ 0xF039 (= 0xF000 + '0').

    ATSUI maps ASCII characters for binary compatibility with Classic apps.

    I can successfully input those characters in TextEdit using the
    Character Palette.

    Aki

    On 2007/10/23, at 23:22, Jacob Rundall wrote:

    > I'm trying to to build a font-based musical notation program in
    > Cocoa using a special TrueType music font called Boulez.  When I use
    > an NSTextView object and select the Boulez font from the Font Panel
    > object, Lucida Grande is used instead.  I've also tried setting the
    > font using setFont and the same thing happens.  I adapted a Carbon
    > example using ATSUI and that displays the font just fine.  Are there
    > some types of fonts that simply don't work with Cocoa's text handling?
    >
    > I'd much rather create a Cocoa app than a Carbon app.  From what I
    > understand it is possible to use ATSUI for displaying text within a
    > Cocoa app, but I haven't been able to find any example code or
    > tutorials for this particular combination.  Does anybody know where
    > I can find such a thing?
    >
    > Thanks very much,
    >
    > Jake Rundall
previous month october 2007 next month
MTWTFSS
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
Go to today