freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ft-devel] Possible regression in Freetype 2.10


From: İsmail Dönmez
Subject: [ft-devel] Possible regression in Freetype 2.10
Date: Tue, 25 Jun 2019 13:21:22 +0200

Hi,

While debugging a grub2 build failure with Freetype 2.10, I noticed
the following program fails now with Freetype 2.10 but works with
2.9.1:

#include <stdio.h>

#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_TRUETYPE_TAGS_H
#include FT_TRUETYPE_TABLES_H
#include FT_SYNTHESIS_H

void test(FT_Face face)
{
  int char_code;

  for (char_code = 0; char_code <= 0x7f; char_code++) {
    FT_UInt glyph_idx;

    glyph_idx = FT_Get_Char_Index(face, char_code);
    if (!glyph_idx) {
      printf("Failed to get char index %d\n", char_code);
      continue;
    }
  }
}

int main(int argc, char *argv[])
{
  FT_Library ft_lib;
  FT_Face ft_face;
  FILE *file;

  FT_Init_FreeType(&ft_lib);
  FT_New_Face(ft_lib, argv[1], 0, &ft_face);

  int size = ft_face->available_sizes[0].height;
  FT_Set_Pixel_Sizes(ft_face, size, size);

  test(ft_face);

  FT_Done_Face(ft_face);

  FT_Done_FreeType(ft_lib);

  return 0;
}

If you run it with the attached unifont.pcf.gz from
gnu-unifont-legacy-bitmap-fonts package (on openSUSE at least), you
get:

> ./ft-test unifont.pcf.gz
Failed to get char index 32

A newer version of unifont (v12.0.01) has no problem so I guess this
might very well be a font bug, however I wanted to report anyway for
it might be a real bug.

Regards,
ismail

Attachment: unifont.pcf.gz
Description: application/gzip


reply via email to

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