aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2008-12-21 15:52:26 +0000
committerJason Rumney2008-12-21 15:52:26 +0000
commit1fc200d61fd9acdea40fea3239decea32d35bde4 (patch)
tree2a777bf90a20b75187c884409fc2ea281574ab19
parent9992ea0cb4b083c4c735f1c5dbda751e439a97d7 (diff)
downloademacs-1fc200d61fd9acdea40fea3239decea32d35bde4.tar.gz
emacs-1fc200d61fd9acdea40fea3239decea32d35bde4.zip
(uniscribe_encode_char): Return FONT_INVALID_CHAR
when character maps to .notdef character.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/w32uniscribe.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ae758b60dcf..015f8f3dc7c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12008-12-21 Jason Rumney <jasonr@gnu.org>
2
3 * w32uniscribe.c (uniscribe_encode_char): Return FONT_INVALID_CHAR
4 when character maps to .notdef character.
5
12008-12-21 Stefan Monnier <monnier@iro.umontreal.ca> 62008-12-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * keyboard.c (cmd_error_internal): Don't exit in daemon mode, bug#1310. 8 * keyboard.c (cmd_error_internal): Don't exit in daemon mode, bug#1310.
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)
516 516
517 if (SUCCEEDED (result) && nglyphs == 1) 517 if (SUCCEEDED (result) && nglyphs == 1)
518 { 518 {
519 code = glyphs[0]; 519 /* Some fonts return .notdef glyphs instead of failing.
520 (Truetype spec reserves glyph code 0 for .notdef) */
521 if (glyphs[0])
522 code = glyphs[0];
520 } 523 }
521 else if (SUCCEEDED (result) || result == E_OUTOFMEMORY) 524 else if (SUCCEEDED (result) || result == E_OUTOFMEMORY)
522 { 525 {
@@ -526,11 +529,8 @@ uniscribe_encode_char (font, c)
526 later. */ 529 later. */
527 result = ScriptGetCMap (context, &(uniscribe_font->cache), 530 result = ScriptGetCMap (context, &(uniscribe_font->cache),
528 ch, len, 0, glyphs); 531 ch, len, 0, glyphs);
529 if (SUCCEEDED (result)) 532 if (SUCCEEDED (result) && glyphs[0])
530 code = glyphs[0]; 533 code = glyphs[0];
531 else
532 code = 0; /* notdef - enough in some cases to get the script
533 engine working, but not others... */
534 } 534 }
535 } 535 }
536 } 536 }