# HG changeset patch # User John W. Eaton # Date 1318344804 14400 # Node ID d2b799e3178a571b2bbe55ef488eb663b6960497 # Parent 959944e9d9273a69bb6564bbcb77b3d3e2721ceb allow warnings about missing glyphs to be disabled * txt-eng-ft.cc (gripe_missing_glyph, gripe_glyph_render): New functions. (ft_render::visit): Use them. diff -r 959944e9d927 -r d2b799e3178a src/txt-eng-ft.cc --- a/src/txt-eng-ft.cc Tue Oct 11 10:35:28 2011 -0400 +++ b/src/txt-eng-ft.cc Tue Oct 11 10:53:24 2011 -0400 @@ -36,6 +36,25 @@ #include "pr-output.h" #include "txt-eng-ft.h" +// FIXME -- maybe issue at most one warning per glyph/font/size/weight +// combination. + +static void +gripe_missing_glyph (char c) +{ + warning_with_id ("Octave:missing-glyph", + "ft_render: skipping missing glyph for character `%c'", + c); +} + +static void +gripe_glyph_render (char c) +{ + warning_with_id ("Octave:glyph-render", + "ft_render: unable to render glyph for character `%c'", + c); +} + class ft_manager { @@ -288,8 +307,7 @@ if (str[i] != '\n' && (! glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT))) - ::warning ("ft_render: skipping missing glyph for character `%c'", - str[i]); + gripe_missing_glyph (str[i]); else { switch (mode) @@ -300,7 +318,7 @@ glyph_index = FT_Get_Char_Index(face, ' '); if (!glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)) { - ::warning ("ft_render: skipping missing glyph for character ` '"); + gripe_missing_glyph (' '); } else { @@ -308,10 +326,11 @@ xoffset = multiline_align_xoffsets[line_index]; yoffset -= (face->size->metrics.height >> 6); } - } + } else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL)) - ::warning ("ft_render: unable to render glyph for character `%c'", - str[i]); + { + gripe_glyph_render (str[i]); + } else { FT_Bitmap& bitmap = face->glyph->bitmap; @@ -364,7 +383,7 @@ if (! glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)) { - ::warning ("ft_render: skipping missing glyph for character ` '"); + gripe_missing_glyph (' '); } else {