freetype
[Top][All Lists]
Advanced

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

[ft] FT_Get_Char_Index problem in 2.8.1 (all fine in 2.8)


From: Ivan Baidakou
Subject: [ft] FT_Get_Char_Index problem in 2.8.1 (all fine in 2.8)
Date: Mon, 16 Oct 2017 00:50:06 +0300

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]. 

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>



reply via email to

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