character by name on the gnome canvas, custom fontencoding
- From: Jan Nieuwenhuizen <janneke gnu org>
- To: gtk-i18n-list gnome org
- Subject: character by name on the gnome canvas, custom fontencoding
- Date: Mon, 10 May 2004 18:50:18 +0200
I'm having trouble to get gnomecanvas/pango to draw a character from
our customly-encoded feta font.
/* create canvas */
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" (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've tried several
shots at that, remapping characters and converting to utf8 sequence,
but to no avail.
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?
--
Jan Nieuwenhuizen <janneke gnu org> | GNU LilyPond - The music typesetter
http://www.xs4all.nl/~jantien | http://www.lilypond.org
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]