lilypond-devel
[Top][All Lists]
Advanced

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

Re: character by name on the gnome canvas, custom fontencoding


From: Werner LEMBERG
Subject: Re: character by name on the gnome canvas, custom fontencoding
Date: Tue, 18 May 2004 15:57:10 +0200 (CEST)

>   1. find out what freetype does, ie, where feta charaters get
>      mapped,

Since the feta fonts don't contain a single character which could be
mapped directly to Unicode, no Unicode cmap is constructed at all.
Instead, FreeType uses the artificial platform/encoding ID pair (7,2)
-- `7' is TT_PLATFORM_ADOBE, `2' is TT_ADOBE_ID_CUSTOM.  This
corresponds to the tag FreeType cmap tag `ADBC'.

>   3. remap the feta font using Adobe Unicode character names
>      (probably impossible for a music font using sensible names, we
>      could use latin1 names and translate internally?).

I think it is a bad idea to add any cmaps to the feta fonts.  Whatever
you choose, it is artificial.

> > So what I'm actually/probably looking for is something like:
> >
> >     pango_addchar (&string, "font", "lilypond-feta, r16",
> >                "char-name", "noteheads-0", 0);
>
> Generally, I think we'd leave this up to the application; the
> application needs to know what Unicode code points they want from
> the font.  Pango only needs to know how to map Unicode code point to
> glyph in the font.

Hmm, there should be a means to access Type 1 fonts like the feta
fonts which can't be mapped to Unicode in a sensible way.  I suggest
functions like

  glyphname_pua_mapping = pango_add_custom_encoding (<afmfile>);
  fonthandle = pango_addfont (<font>, glyphname_pua_mapping);
  unicode = pango_glyphname_to_unicode (<glyphname>,
                                        glyphname_pua_mapping);
  glyphname = pango_unicode_to_glyphname (<unicode>
                                          glyphname_pua_mapping);

The first function creates a new encoding, reserving a free block (or
rather, free PUA code points) in the PUA and mapping all glyph names
in the AFM file to it.  The second function then registers the font
within Pango, using the just created mapping.

Note that I don't know how to use Pango.  My function names are just
wild guesses.


    Werner




reply via email to

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