Issue of the Implementation # V0030


Calling FT_Get_PFR_Metrics for a non-PFR font causes segmentation fault

Detailed Description

The description of FT_Get_PFR_Metrics states that
If the input face is not a PFR, this function will return an error. However, in all cases, it will return valid values.

It is also stated that any of the following arguments can be NULL:
  • aoutline_resolution
  • ametrics_resolution
  • ametrics_x_scale
  • ametrics_y_scale

However if FT_Get_PFR_Metrics is called for a non-PFR font (e.g. FreeMono.ttf) and at least one of these arguments is NULL, it results in segmentation fault. The attached example demonstrates this problem.

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 "PFR Fonts"


  1. Unpack the attached archive
  2. Build the sample C program contained in it
  3. Run the program as follows:
    ./ft_get_pfr_metrics FreeMono.ttf a b c d
    where a, b, c and d are integers at least one of which is 0.


freetype 2.1.10 or later


freetype-devel mailing list, #49, 2008.12