Re: Getting victory hands symbol from Wingdings

Werner LEMBERG <[email protected]>
Newsgroups gmane.comp.fonts.freetype.user
Message-ID <[email protected]>
> So do newer versions also provide a synthesized Unicode charmap in
> case there is none?

Normally yes, if it is possible.  However, IIRC, it doesn't work for
MS symbol encoding, since the mapping is not one-to-one: for example,
`wingding.ttf` and `webdings.ttf` share the same codespace
(0xF020-0xF0FF) for completely different glyphs.

With this in my mind I was able to identify some relevant commits:


  commit 75cb071b3fbfa2315c5d458fee2bb465a14568ae
  Author: Alexei Podtelezhnikov (Алексей Подтележников) <[email protected]>
  Date:   Wed Jun 21 22:52:37 2017 -0400

    [sfnt] Synthesize a Unicode charmap if one is missing.
    
    * src/sfnt/ttcmap.h (tt_cmap_unicode_class_rec): Declare it.
    * src/sfnt/ttcmap.c (tt_get_glyph_name, tt_cmap_unicode_init,
    tt_cmap_unicode_done, tt_cmap_unicode_char_index,
    tt_cmap_unicode_char_next, tt_cmap_unicode_class_rec): Implement
    synthetic Unicode charmap class.
    (tt_get_cmap_info): Make sure the callback is available.
    
    * src/sfnt/sfobjs.c (sfnt_load_face)
    [FT_CONFIG_OPTION_POSTSCRIPT_NAMES]: If Unicode charmap is missing,
    synthesize one.
    
    * include/freetype/config/ftoption.h: Document it.
    * devel/ftoption.h: Ditto.



  commit 7653c76533dcde3d87bd7af5a2c12e8c95412c12
  Author: Alexei Podtelezhnikov (Алексей Подтележников) <[email protected]>
  Date:   Thu Aug 17 21:28:32 2017 -0400

    [sfnt] Avoid synthetic unicode for symbol fonts with PUA.

    Reported as

      https://bugs.chromium.org/p/chromium/issues/detail?id=754574

    * src/sfnt/sfobjs.c (sfnt_load_face): Check for FT_ENCODING_MS_SYMBOL.


There is probably more, but at least you can see some reasoning.


> I was a bit confused by your first reply in which you said that when
> you open the font "face->num_charmaps" is 2. This would mean that
> the latest FreeType version does NOT synthesize a Unicode charmap if
> there is none in the TTF because 2 indicates that just the charmaps
> physically stored inside the TTF are used.

Exactly.


    Werner
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.