summaryrefslogtreecommitdiff
path: root/src/w32font.c
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2008-07-25 21:44:37 +0000
committerJason Rumney <jasonr@gnu.org>2008-07-25 21:44:37 +0000
commit6a8082b5d4574f44a40c6c03c56d023f17a8ab3a (patch)
tree432a734d2bba11b121422aa615ae7c34899dc446 /src/w32font.c
parent1957b847ef31dabb860a08c335aaf9ab1ef6d1f2 (diff)
downloademacs-6a8082b5d4574f44a40c6c03c56d023f17a8ab3a.tar.gz
(w32font_has_char): Handle the case where we can't
determine the script for a character.
Diffstat (limited to 'src/w32font.c')
-rw-r--r--src/w32font.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/w32font.c b/src/w32font.c
index 380bead2e74..9fdda5d7a5e 100644
--- a/src/w32font.c
+++ b/src/w32font.c
@@ -292,6 +292,8 @@ w32font_has_char (entity, c)
return -1;
supported_scripts = assq_no_quit (QCscript, extra);
+ /* If font doesn't claim to support any scripts, then we can't be certain
+ until we open it. */
if (!CONSP (supported_scripts))
return -1;
@@ -299,7 +301,16 @@ w32font_has_char (entity, c)
script = CHAR_TABLE_REF (Vchar_script_table, c);
- return (memq_no_quit (script, supported_scripts)) ? -1 : 0;
+ /* If we don't know what script the character is from, then we can't be
+ certain until we open it. Also if the font claims support for the script
+ the character is from, it may only have partial coverage, so we still
+ can't be certain until we open the font. */
+ if (NILP (script) || memq_no_quit (script, supported_scripts))
+ return -1;
+
+ /* Font reports what scripts it supports, and none of them are the script
+ the character is from, so it is a definite no. */
+ return 0;
}
/* w32 implementation of encode_char for font backend.