Details

[Home]

Issue of the Implementation # V0019

Brief

Inconsistent behaviour of FT_OpenType_Validate with different validation flags

Detailed Description

According to FreeType2 API reference, FT_OpenType_Validate validates OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF) contained in a font and retrieves pointers to these tables. For the tables missing from the font, the function sets corresponding pointers to NULL. FT_OpenType_Validate returns zero if successful, a non-zero error code otherwise.

When FT_OpenType_Validate is called for "FreeMono.ttf" font (see the attached example) to validate all five tables (validation flags being equal to FT_VALIDATE_OT), it returns 0 (success). According to the values of the pointers retrieved by the function, it seems that the font contains valid GDEF and GSUB tables while the remaining 3 tables are missing.

However if one calls FT_OpenType_Validate to validate only GDEF table of the same font (validation flags being equal to FT_VALIDATE_GDEF), the function returns 16 ("invalid glyph index"). So the behaviour of the function is not consistent with respect to this table: in the first case it reports that among other things GDEF table is valid while in the second case - that the table is not valid.

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 "OpenType Validation"

Reproducing

  1. Unpack the attached archive
  2. Build the sample C program contained in it
  3. Run the program:
    ./opentype_validation

Note that FT_OpenType_Validate uses the OpenType validation module ("otvalid") to do the job. The module, however, is disabled by default in FreeType 2.3.7 for some reason (and may be disabled in other versions as well).

Before trying to reproduce the problem in FT_OpenType_Validate, one may need to rebuild and reinstall FreeType with "otvalid" module enabled. To do this, find "modules.cfg" in main directory of freetype source package, uncomment the line "AUX_MODULES += otvalid", then build and install FreeType as usual.

Component

freetype 2.1.10 or later

Environment

Architectures

x86, x86-64

Accepted

freetype-devel mailing list, #00, 2008.12

Status

Fixed in freetype 2.3.8

[Home]