X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/cb4e054e41cdb7e398351a5ae8224759e721349e..8833692b29ba11c34413d6793cf6d222ccdd930b:/src/ftfont.c diff --git a/src/ftfont.c b/src/ftfont.c index 505d508d2e..1ae3f88daa 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -8,8 +8,8 @@ This file is part of GNU Emacs. GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -568,7 +568,6 @@ ftfont_get_charset (Lisp_Object registry) char *str = SSDATA (SYMBOL_NAME (registry)); USE_SAFE_ALLOCA; char *re = SAFE_ALLOCA (SBYTES (SYMBOL_NAME (registry)) * 2 + 1); - Lisp_Object regexp; int i, j; for (i = j = 0; i < SBYTES (SYMBOL_NAME (registry)); i++, j++) @@ -582,13 +581,13 @@ ftfont_get_charset (Lisp_Object registry) re[j] = '.'; } re[j] = '\0'; - regexp = make_unibyte_string (re, j); - SAFE_FREE (); + AUTO_STRING_WITH_LEN (regexp, re, j); for (i = 0; fc_charset_table[i].name; i++) if (fast_c_string_match_ignore_case (regexp, fc_charset_table[i].name, strlen (fc_charset_table[i].name)) >= 0) break; + SAFE_FREE (); if (! fc_charset_table[i].name) return -1; if (! fc_charset_table[i].fc_charset) @@ -2596,7 +2595,12 @@ ftfont_shape_by_flt (Lisp_Object lgstring, struct font *font, language information, and select a proper flt for them here. */ int c1 = LGLYPH_CHAR (LGSTRING_GLYPH (lgstring, 1)); - if (CHAR_HAS_CATEGORY (c1, '^')) + /* For the combining characters in the range U+300..U+36F, + "combining" is the sole FLT provided by the m17n-lib. In + addition, it is the sole FLT that can handle the other + combining characters with non-OTF fonts. */ + if ((0x300 <= c1 && c1 <= 0x36F) + || (! otf && CHAR_HAS_CATEGORY (c1, '^'))) flt = mflt_get (msymbol ("combining")); } if (! flt && ! otf)