[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] FT_Get_Char_Index problem in 2.8.1 (all fine in 2.8)
From: |
Nikolay Sivov |
Subject: |
Re: [ft] FT_Get_Char_Index problem in 2.8.1 (all fine in 2.8) |
Date: |
Mon, 16 Oct 2017 00:58:12 +0300 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 16.10.2017 0:50, Ivan Baidakou wrote:
> Hello,
>
> I'm maintaing perl wrappers for Font-FreeType [1]. Recently bug report
> [2] has been filed, where something is wrong with new 2.8.1 version.
>
> The sample C-program
>
> #include <stdio.h>
> #include <ft2build.h>
> #include FT_FREETYPE_H
> #include FT_TYPES_H
>
> int main(int argc, char** argv) {
> FT_Library library;
> FT_Face face;
> FT_Error err;
> FT_ULong charcode = 32;
>
> err = FT_Init_FreeType(&library);
> if (!err) {
> printf("sucessfully opened library\n");
> } else {
> return 0;
> }
>
> err = FT_New_Face(library, argv[1], 0, &face);
> if (!err) {
> printf("sucessfully opened face %s\n", argv[1]);
> } else {
> return 0;
> }
>
> err = FT_Get_Char_Index(face, charcode);
> printf("glyph index %d for char code %ld\n", err, charcode);
>
> // FT_New_Face
> return 0;
> }
>
> outputs
>
> glyph index 33 for char code 32
>
> for 2.8, while for 2.8.1 it outputs
>
> glyph index 0 for char code 32
>
> The fnt file can be taken at [3].
This regression is caused by commit
https://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=79e3789f81e14266578e71196ce71ecf5381d142.
Basically you'll have to select charmap yourself now with 2.8.1+, and
that happened automatically for 2.8 and below. This is only relevant to
fnt format.
>
> Could you, please, help with that as I haven't found any clues at
> detailed Changelog [4]?
>
> Thanks!
>
> [1] https://metacpan.org/pod/Font::FreeType
> [2] https://github.com/zmughal/p5-Font-FreeType/issues/21
> [3] https://github.com/zmughal/p5-Font-FreeType/blob/master/t/data/5x7.fnt
> [4] https://sourceforge.net/projects/freetype/files/freetype2/2.8.1/
>
> --
> address@hidden <address@hidden>
>
> _______________________________________________
> Freetype mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/freetype
>