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: Owen Taylor
Subject: Re: character by name on the gnome canvas, custom fontencoding
Date: Tue, 18 May 2004 17:31:09 -0400

On Tue, 2004-05-18 at 09:57, Werner LEMBERG wrote:

> > > 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.

Well, any time you want to run the Pango layout process, you 
need Unicode code points. So there needs to be a PUA mapping.
If the application author and the font creator can agree on a PUA
mapping, that's the ideal situation.

>   I suggest
> functions like
> 
>   glyphname_pua_mapping = pango_add_custom_encoding (<afmfile>);

My interest in adding questionable concepts like AFM files to the
Pango API is precisely zero. 

If fontconfig takes responsibility for locating the right AFM file, I'm
willing to put in a little internal glue to call FT_Attach_File, but
that's really all.

>   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.

As my earlier mail indicated, there will be some facilities to
allow apps to achieve this in the next version of Pango (though 
considerably more flexible, lowlevel, and correspondingly 
harder to use.)

But I was trying to suggest ways that current Pango versions could
be used, and that basically means encoding the PUA mapping
in the font in some fashion. With a OpenType/CFF font it should
be possible to have a Unicode mapping table and also maintain
descriptive glyph names.

Regards,
                                                Owen

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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