Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't crash with freetype supplies a non-null family name. #94

Merged
merged 1 commit into from Aug 1, 2019

Conversation

@jneem
Copy link
Contributor

jneem commented Aug 1, 2019

Fixes #5.

I don't know if returning an empty string is the right thing to do when FreeType has a null family name, but at least it doesn't crash. In any case, I've verified with the following C program that FreeType will happily load a font with no family name and report no errors:

#include <stdio.h>

#include <ft2build.h>
#include FT_FREETYPE_H

int main()
{
    FT_Library library;
    FT_Face face;

    FT_Init_FreeType(&library);
    FT_Error error = FT_New_Face(library, "/usr/share/fonts/misc/decsess.pcf.gz", 0, &face);
    if (error) {
        printf("Error opening face: %s\n", FT_Error_String(error));
        return 1;
    }
    printf("Success opening face. Family name: %s\n", face->family_name);
    return 0;
}
@RazrFalcon RazrFalcon merged commit 88bec69 into servo:master Aug 1, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@RazrFalcon
Copy link
Collaborator

RazrFalcon commented Aug 1, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants
You can’t perform that action at this time.