Details

[Home]

Issue of the Implementation # V0017

Brief

FT_Get_Name_Index returns 0 instead of a glyph index

Detailed Description

The FreeType2 API reference states that FT_Get_Name_Index function returns the glyph index of a given glyph name, 0 meaning 'undefined character code'.

However FT_Get_Name_Index returns 0, if it is called for some TrueType/OpenType fonts for the existing glyphs named "asterisk", "space", "zero", etc. (see the attached example).

Problem location(s) in the standard

Linux Standard Base Desktop Specification 3.2, Chapter 12. Libraries, 12.1 Interfaces for libfreetype that refers FreeType-2.1.10 API Reference, section "Base Interface"

Reproducing

  1. Unpack the attached archive
  2. Build the sample C program contained in it
  3. Run the program with font file name, glyph name and the correct glyph index as its arguments:
    ./basic_glyph MuktiNarrow.ttf zero 19
    ./basic_glyph MuktiNarrow.ttf asterisk 13
    ./basic_glyph FreeMono.ttf asterisk 13
    ./basic_glyph FreeMono.ttf space 3
    The correct glyph index can be obtained using any font editor program, for example, FontForge.

Component

freetype 2.1.10 or later

Accepted

freetype-devel mailing list, #42, 2009.01

Status

Fixed in freetype 2.3.9

[Home]