diff options
| author | Kenichi Handa | 2008-06-09 07:16:15 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-06-09 07:16:15 +0000 |
| commit | 770835fda420b46e8600f6a2435964b9bc425885 (patch) | |
| tree | 14ae86db22706ae38ec1b14f0f9923aa8f77bac7 /src | |
| parent | 365698cf5d8bbd20b6358274ec95bc477826be8a (diff) | |
| download | emacs-770835fda420b46e8600f6a2435964b9bc425885.tar.gz emacs-770835fda420b46e8600f6a2435964b9bc425885.zip | |
(ftfont_spec_pattern): Accept the registry `ascii-0'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftfont.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index bd7c374f6cd..47aea264b74 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -490,6 +490,7 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec) | |||
| 490 | 490 | ||
| 491 | registry = AREF (spec, FONT_REGISTRY_INDEX); | 491 | registry = AREF (spec, FONT_REGISTRY_INDEX); |
| 492 | if (NILP (registry) | 492 | if (NILP (registry) |
| 493 | || EQ (registry, Qascii_0) | ||
| 493 | || EQ (registry, Qiso10646_1) | 494 | || EQ (registry, Qiso10646_1) |
| 494 | || EQ (registry, Qunicode_bmp) | 495 | || EQ (registry, Qunicode_bmp) |
| 495 | || EQ (registry, Qunicode_sip)) | 496 | || EQ (registry, Qunicode_sip)) |
| @@ -669,6 +670,33 @@ ftfont_list (frame, spec) | |||
| 669 | fontset = FcFontList (NULL, pattern, objset); | 670 | fontset = FcFontList (NULL, pattern, objset); |
| 670 | if (! fontset) | 671 | if (! fontset) |
| 671 | goto err; | 672 | goto err; |
| 673 | #if 0 | ||
| 674 | /* Need fix because this finds any fonts. */ | ||
| 675 | if (fontset->nfont == 0 && ! NILP (family)) | ||
| 676 | { | ||
| 677 | /* Try maching with configuration. For instance, the | ||
| 678 | configuration may specify "Nimbus Mono L" as an alias of | ||
| 679 | "Courier". */ | ||
| 680 | FcPattern *pat = FcPatternBuild (0, FC_FAMILY, FcTypeString, | ||
| 681 | SYMBOL_FcChar8 (family), NULL); | ||
| 682 | FcChar8 *fam; | ||
| 683 | |||
| 684 | if (FcConfigSubstitute (NULL, pat, FcMatchPattern) == FcTrue) | ||
| 685 | { | ||
| 686 | for (i = 0; | ||
| 687 | FcPatternGetString (pat, FC_FAMILY, i, &fam) == FcResultMatch; | ||
| 688 | i++) | ||
| 689 | { | ||
| 690 | FcPatternDel (pattern, FC_FAMILY); | ||
| 691 | FcPatternAddString (pattern, FC_FAMILY, fam); | ||
| 692 | FcFontSetDestroy (fontset); | ||
| 693 | fontset = FcFontList (NULL, pattern, objset); | ||
| 694 | if (fontset->nfont > 0) | ||
| 695 | break; | ||
| 696 | } | ||
| 697 | } | ||
| 698 | } | ||
| 699 | #endif | ||
| 672 | for (i = 0; i < fontset->nfont; i++) | 700 | for (i = 0; i < fontset->nfont; i++) |
| 673 | { | 701 | { |
| 674 | Lisp_Object entity; | 702 | Lisp_Object entity; |
| @@ -1707,7 +1735,6 @@ Lisp_Object | |||
| 1707 | ftfont_font_format (FcPattern *pattern) | 1735 | ftfont_font_format (FcPattern *pattern) |
| 1708 | { | 1736 | { |
| 1709 | FcChar8 *str; | 1737 | FcChar8 *str; |
| 1710 | int len; | ||
| 1711 | 1738 | ||
| 1712 | #ifdef FC_FONTFORMAT | 1739 | #ifdef FC_FONTFORMAT |
| 1713 | if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch) | 1740 | if (FcPatternGetString (pattern, FC_FONTFORMAT, 0, &str) != FcResultMatch) |