freetype
[Top][All Lists]
Advanced

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

[ft] FT_Load_Glyph returns an error


From: YuGiOhJCJ Mailing-List
Subject: [ft] FT_Load_Glyph returns an error
Date: Fri, 11 Nov 2016 14:27:43 +0100

Hello,

I have a problem with wine [1] at runtime.
Regarding the backtrace [2], it seems that there is a relationship with 
freetype (or maybe harfbuzz).

So, I am trying for the first time to write a minimal C program that is using 
freetype in order to see if I am able to reproduce the problem:
---
#include <ft2build.h> /* for FT_Init_FreeType */
#include <stdlib.h> /* for exit */
#include FT_FREETYPE_H
int main()
{
        /* https://www.freetype.org/freetype2/docs/tutorial/step1.html */
        FT_Library library;
        FT_Face face;
        FT_UInt glyph_index;
        int error = FT_Init_FreeType(&library);
        if(error != 0)
        {
                fprintf(stderr, "Unable to initialize the library.\n");
                exit(EXIT_FAILURE);
        }
        error = FT_New_Face(library, "Arial.TTF", 0, &face);
        if(error != 0)
        {
                fprintf(stderr, "Unable to load the font face.\n");
                exit(EXIT_FAILURE);
        }
        glyph_index = FT_Get_Char_Index(face, 0x00041);
        error = FT_Load_Glyph(face, glyph_index, 0);
        if(error != 0)
        {
                fprintf(stderr, "Unable to load the glyph image.\n");
                exit(EXIT_FAILURE);
        }
        exit(EXIT_SUCCESS);
}
---

Unfortunately, when I try to call the "FT_Load_Glyph" function, the returned 
value is not 0 (which means that there is a failure):
---
gcc -std=c89 -pedantic -Wall -Werror `pkg-config freetype2 --cflags --libs` 
main.c
$ ./a.out 
Unable to load the glyph image.
---

What is the reason please?

Thank you.
Best regards.

[1] https://www.winehq.org/
[2] https://forum.winehq.org/viewtopic.php?f=8&t=27879#p107932



reply via email to

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