# HG changeset patch # User Jason Rumney # Date 1217022277 0 # Node ID c46e4c1d833937d0224e036e0bb5d2960ded2144 # Parent 910ca036b4b640a0c7acb06f00d3d6295dd6e628 (w32font_has_char): Handle the case where we can't determine the script for a character. diff -r 910ca036b4b6 -r c46e4c1d8339 src/w32font.c --- a/src/w32font.c Fri Jul 25 18:39:38 2008 +0000 +++ b/src/w32font.c Fri Jul 25 21:44:37 2008 +0000 @@ -292,6 +292,8 @@ 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 @@ 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.