Skip to content

Commit

Permalink
msGetGlyphByIndex() / msGetGlyphOutline(): tweak debug/error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault authored and github-actions[bot] committed May 25, 2021
1 parent cf4756e commit 0bbf943
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fontcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,13 @@ glyph_element* msGetGlyphByIndex(face_element *face, unsigned int size, unsigned
}
error = FT_Load_Glyph(face->face,key.codepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
if (error) {
msDebug("Unable to load glyph %ud for font \"%s\". Using ? as fallback.", key.codepoint, face->font);
msDebug("Unable to load glyph %u for font \"%s\". Using ? as fallback.\n", key.codepoint, face->font);
// If we can't find a glyph then try to fallback to a question mark.
unsigned int fallbackCodepoint = msGetGlyphIndex(face, 0x3F);
error = FT_Load_Glyph(face->face,fallbackCodepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
}
if(error) {
msSetError(MS_MISCERR, "unable to load glyph %ud for font \"%s\"", "msGetGlyphByIndex()",key.codepoint, face->font);
msSetError(MS_MISCERR, "unable to load glyph %u for font \"%s\"", "msGetGlyphByIndex()",key.codepoint, face->font);
free(gc);
#ifdef USE_THREAD
if (use_global_ft_cache)
Expand Down Expand Up @@ -342,13 +342,13 @@ outline_element* msGetGlyphOutline(face_element *face, glyph_element *glyph) {
FT_Set_Transform(face->face, &matrix, &pen);
error = FT_Load_Glyph(face->face,glyph->key.codepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP/*|FT_LOAD_IGNORE_TRANSFORM*/|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
if (error) {
msDebug("Unable to load glyph %ud for font \"%s\". Using ? as fallback.", glyph->key.codepoint, face->font);
msDebug("Unable to load glyph %u for font \"%s\". Using ? as fallback.\n", glyph->key.codepoint, face->font);
// If we can't find a glyph then try to fallback to a question mark.
unsigned int fallbackCodepoint = msGetGlyphIndex(face, 0x3F);
error = FT_Load_Glyph(face->face,fallbackCodepoint,FT_LOAD_DEFAULT|FT_LOAD_NO_BITMAP/*|FT_LOAD_IGNORE_TRANSFORM*/|FT_LOAD_NO_HINTING|FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH);
}
if(error) {
msSetError(MS_MISCERR, "unable to load glyph %ud for font \"%s\"", "msGetGlyphOutline()",glyph->key.codepoint, face->font);
msSetError(MS_MISCERR, "unable to load glyph %u for font \"%s\"", "msGetGlyphOutline()",glyph->key.codepoint, face->font);
#ifdef USE_THREAD
if (use_global_ft_cache)
msReleaseLock(TLOCK_TTF);
Expand Down

0 comments on commit 0bbf943

Please sign in to comment.