summaryrefslogtreecommitdiff
path: root/src/w32uniscribe.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2008-12-21 15:52:26 +0000
committerJason Rumney <jasonr@gnu.org>2008-12-21 15:52:26 +0000
commit1fc200d61fd9acdea40fea3239decea32d35bde4 (patch)
tree2a777bf90a20b75187c884409fc2ea281574ab19 /src/w32uniscribe.c
parent9992ea0cb4b083c4c735f1c5dbda751e439a97d7 (diff)
downloademacs-1fc200d61fd9acdea40fea3239decea32d35bde4.tar.gz
(uniscribe_encode_char): Return FONT_INVALID_CHAR
when character maps to .notdef character.
Diffstat (limited to 'src/w32uniscribe.c')
-rw-r--r--src/w32uniscribe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/w32uniscribe.c b/src/w32uniscribe.c
index 14ce7449a09..1b5984fbea6 100644
--- a/src/w32uniscribe.c
+++ b/src/w32uniscribe.c
@@ -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... */
}
}
}