lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mapping of custom music font, or display characters by name?


From: Jan Nieuwenhuizen
Subject: mapping of custom music font, or display characters by name?
Date: Mon, 17 May 2004 12:00:29 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Hi Owen,

Please excuse me for mailing you directly.

I am investigating the possibilities for a GNOME backend for LilyPond,
a recurring topic in the discussions we had with other developers at
the LAD 2004 in Karlsruhe.

I'm having trouble to get gnomecanvas/Pango to draw a character from
our customly-encoded feta music font.  Here's a C snippet

  canvas = GNOME_CANVAS (canvas_widget);
  root = gnome_canvas_root (canvas);
  int text_item = gnome_canvas_text_get_type ();
  gnome_canvas_item_new (root, text_item, "x", 45.0, "y", 122.5,
                         "font", "lilypond-feta-nummer 16", "text", "3",
                         "anchor", GTK_ANCHOR_WEST, "fill_color", "black", 0);
  gnome_canvas_item_new (root, text_item, "x", 45.0, "y", 142.5,
                         "font", "lilypond-feta-nummer, r 16", "text", "4",
                         "anchor", GTK_ANCHOR_WEST, "fill_color", "black", 0);
  gnome_canvas_item_new (root, text_item, "x", 80.0, "y", 142.0,
                         "font", "lilypond-feta, r 32", "text", "ab<¯",
                         "anchor", GTK_ANCHOR_WEST, "fill_color", "black", 0);

The numbers (feta-nummer font) show alright, but they use standard
names and encoding.  The "ab" (for this excercise added faked whole
note and treble clef) look alright but the "<" is displayed using
another font and the "¯" (0257 175 0xaf ¯ macron) is not displayed at
all.

    lilypond-feta.afm snippet:
    FontEncoding fetaMusic
    C 60 ;  N noteheads-0 ; B 0 -2749 9900 2749 ; W 9900 0 ;
    Comment faked ascii `a' with whole note head
    C 97 ;  N a           ; B 0 -2749 9900 2749 ; W 9900 0 ;
    Comment faked ascii `b' with G/treble clef
    C 98 ;  N b           ; B 0 -13000 12825 25000 ; W 12825 0 ;
    C 175 ; N clefs-G     ; B 0 -13000 12825 25000 ; W 12825 0 ;

What could happen, is that this custom encoded-font gets mapped (or
mapped partly, the `a' and `b' are still/also at latin1 positions)
onto the private unicode area (0xe0000 and up).  So, I tried remapping
characters and converting to utf8 sequence, but to no avail.  Then I
decided to display the charsets from 0xe000 to 0xffff, but I only get
to see non-Arabic characters from other fonts, or the character's index

    [E0  .. [E0
     00]     FF]

so I'm wondering where the music characters get mapped?

The observed behaviour suggests that Pango looks up (or remaps)
characters by name, which is just how I'd like to refer to them again.

So what I'm actually/probably looking for is something like:

    pango_addchar (&string, "font", "lilypond-feta, r16",
                   "char-name", "noteheads-0", 0);

Can you help me with this?  I've posted to gtk-app-devel-list and
gtk-i18n-list but got no response, and pango.org has been unreachable
for more than a week.

Greetings,
Jan.

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien       | http://www.lilypond.org





reply via email to

[Prev in Thread] Current Thread [Next in Thread]