+2009-07-14 Kenichi Handa <handa@m17n.org>
+
+ * ftfont.c (ftfont_spec_pattern): New arg langname. Caller
+ changed.
+ (ftfont_list): Adjusted for the change of ftfont_spec_pattern.
+ Reject a font who has adstyle property that is different from a
+ langname derived from registry property.
+ (ftfont_match): Adjusted for the change of ftfont_spec_pattern.
+
2009-07-13 Eli Zaretskii <eliz@gnu.org>
* dired.c (directory_files_internal) [WINDOWSNT]: Don't make a
}
static FcPattern *ftfont_spec_pattern P_ ((Lisp_Object, char *,
- struct OpenTypeSpec **));
+ struct OpenTypeSpec **,
+ char **langname));
static FcPattern *
-ftfont_spec_pattern (spec, otlayout, otspec)
+ftfont_spec_pattern (spec, otlayout, otspec, langname)
Lisp_Object spec;
char *otlayout;
struct OpenTypeSpec **otspec;
+ char **langname;
{
Lisp_Object tmp, extra;
FcPattern *pattern = NULL;
if (fc_charset_idx < 0)
return NULL;
charset = fc_charset_table[fc_charset_idx].fc_charset;
- lang = (FcChar8 *) fc_charset_table[fc_charset_idx].lang;
+ *langname = fc_charset_table[fc_charset_idx].lang;
+ lang = (FcChar8 *) *langname;
if (lang)
{
langset = FcLangSetCreate ();
char otlayout[15]; /* For "otlayout:XXXX" */
struct OpenTypeSpec *otspec = NULL;
int spacing = -1;
+ char *langname = NULL;
if (! fc_initialized)
{
fc_initialized = 1;
}
- pattern = ftfont_spec_pattern (spec, otlayout, &otspec);
+ pattern = ftfont_spec_pattern (spec, otlayout, &otspec, &langname);
if (! pattern)
return Qnil;
if (FcPatternGetCharSet (pattern, FC_CHARSET, 0, &charset) != FcResultMatch)
if (j == ASIZE (chars))
continue;
}
- if (! NILP (adstyle))
+ if (! NILP (adstyle) || langname)
{
Lisp_Object this_adstyle = get_adstyle_property (fontset->fonts[i]);
- if (NILP (this_adstyle)
- || xstrcasecmp (SDATA (SYMBOL_NAME (adstyle)),
- SDATA (SYMBOL_NAME (this_adstyle))) != 0)
+ if (! NILP (adstyle)
+ && (NILP (this_adstyle)
+ || xstrcasecmp (SDATA (SYMBOL_NAME (adstyle)),
+ SDATA (SYMBOL_NAME (this_adstyle))) != 0))
+ continue;
+ if (langname
+ && ! NILP (this_adstyle)
+ && xstrcasecmp (langname, SDATA (SYMBOL_NAME (this_adstyle))))
continue;
}
entity = ftfont_pattern_entity (fontset->fonts[i],
FcResult result;
char otlayout[15]; /* For "otlayout:XXXX" */
struct OpenTypeSpec *otspec = NULL;
+ char *langname = NULL;
if (! fc_initialized)
{
fc_initialized = 1;
}
- pattern = ftfont_spec_pattern (spec, otlayout, &otspec);
+ pattern = ftfont_spec_pattern (spec, otlayout, &otspec, &langname);
if (! pattern)
return Qnil;