1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-30 00:51:50 -08:00

(uniscribe_encode_char): Return FONT_INVALID_CHAR

when character maps to .notdef character.
This commit is contained in:
Jason Rumney 2008-12-21 15:52:26 +00:00
parent 9992ea0cb4
commit 1fc200d61f
2 changed files with 10 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2008-12-21 Jason Rumney <jasonr@gnu.org>
* w32uniscribe.c (uniscribe_encode_char): Return FONT_INVALID_CHAR
when character maps to .notdef character.
2008-12-21 Stefan Monnier <monnier@iro.umontreal.ca>
* keyboard.c (cmd_error_internal): Don't exit in daemon mode, bug#1310.

View file

@ -516,7 +516,10 @@ uniscribe_encode_char (font, c)
if (SUCCEEDED (result) && nglyphs == 1)
{
code = glyphs[0];
/* Some fonts return .notdef glyphs instead of failing.
(Truetype spec reserves glyph code 0 for .notdef) */
if (glyphs[0])
code = glyphs[0];
}
else if (SUCCEEDED (result) || result == E_OUTOFMEMORY)
{
@ -526,11 +529,8 @@ uniscribe_encode_char (font, c)
later. */
result = ScriptGetCMap (context, &(uniscribe_font->cache),
ch, len, 0, glyphs);
if (SUCCEEDED (result))
if (SUCCEEDED (result) && glyphs[0])
code = glyphs[0];
else
code = 0; /* notdef - enough in some cases to get the script
engine working, but not others... */
}
}
}