diff options
| author | Kenichi Handa | 2008-06-19 00:42:11 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-06-19 00:42:11 +0000 |
| commit | 4ffe34a4ed2058c93a01c5a176eb0971c61eaa4c (patch) | |
| tree | b400ab0207a46ffb6d8e85c19d9b9e59de57eb48 /src | |
| parent | 81094fabdcab39f801dd7425c2ed881f64ad853e (diff) | |
| download | emacs-4ffe34a4ed2058c93a01c5a176eb0971c61eaa4c.tar.gz emacs-4ffe34a4ed2058c93a01c5a176eb0971c61eaa4c.zip | |
(ftfont_pattern_entity): New arg extra. Caller changed.
(ftfont_spec_pattern): Don't check QCfc_unknown_spec and QCname.
(ftfont_list) [FC_FONTFORMAT]: Include FC_FONTFORMAT in objset.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftfont.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index 486fd93be6a..92bbec707a2 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -68,7 +68,8 @@ struct ftfont_info | |||
| 68 | #endif /* HAVE_LIBOTF */ | 68 | #endif /* HAVE_LIBOTF */ |
| 69 | }; | 69 | }; |
| 70 | 70 | ||
| 71 | static Lisp_Object ftfont_pattern_entity P_ ((FcPattern *, Lisp_Object, int)); | 71 | static Lisp_Object ftfont_pattern_entity P_ ((FcPattern *, Lisp_Object, |
| 72 | Lisp_Object, int)); | ||
| 72 | 73 | ||
| 73 | static Lisp_Object ftfont_resolve_generic_family P_ ((Lisp_Object)); | 74 | static Lisp_Object ftfont_resolve_generic_family P_ ((Lisp_Object)); |
| 74 | Lisp_Object ftfont_font_format P_ ((FcPattern *)); | 75 | Lisp_Object ftfont_font_format P_ ((FcPattern *)); |
| @@ -128,9 +129,9 @@ static struct | |||
| 128 | extern Lisp_Object Qc, Qm, Qp, Qd; | 129 | extern Lisp_Object Qc, Qm, Qp, Qd; |
| 129 | 130 | ||
| 130 | static Lisp_Object | 131 | static Lisp_Object |
| 131 | ftfont_pattern_entity (p, registry, fc_charset_idx) | 132 | ftfont_pattern_entity (p, registry, extra, fc_charset_idx) |
| 132 | FcPattern *p; | 133 | FcPattern *p; |
| 133 | Lisp_Object registry; | 134 | Lisp_Object registry, extra; |
| 134 | int fc_charset_idx; | 135 | int fc_charset_idx; |
| 135 | { | 136 | { |
| 136 | Lisp_Object entity; | 137 | Lisp_Object entity; |
| @@ -181,6 +182,7 @@ ftfont_pattern_entity (p, registry, fc_charset_idx) | |||
| 181 | && b == FcTrue) | 182 | && b == FcTrue) |
| 182 | ASET (entity, FONT_AVGWIDTH_INDEX, make_number (0)); | 183 | ASET (entity, FONT_AVGWIDTH_INDEX, make_number (0)); |
| 183 | 184 | ||
| 185 | ASET (entity, FONT_EXTRA_INDEX, Fcopy_sequence (extra)); | ||
| 184 | font_put_extra (entity, QCfont_entity, | 186 | font_put_extra (entity, QCfont_entity, |
| 185 | Fcons (make_unibyte_string ((char *) file, | 187 | Fcons (make_unibyte_string ((char *) file, |
| 186 | strlen ((char *) file)), | 188 | strlen ((char *) file)), |
| @@ -469,7 +471,6 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec) | |||
| 469 | int n; | 471 | int n; |
| 470 | int dpi = -1; | 472 | int dpi = -1; |
| 471 | int scalable = -1; | 473 | int scalable = -1; |
| 472 | Lisp_Object name = Qnil; | ||
| 473 | Lisp_Object script = Qnil; | 474 | Lisp_Object script = Qnil; |
| 474 | Lisp_Object registry; | 475 | Lisp_Object registry; |
| 475 | 476 | ||
| @@ -512,8 +513,6 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec) | |||
| 512 | key = XCAR (XCAR (extra)), val = XCDR (XCAR (extra)); | 513 | key = XCAR (XCAR (extra)), val = XCDR (XCAR (extra)); |
| 513 | if (EQ (key, QCdpi)) | 514 | if (EQ (key, QCdpi)) |
| 514 | dpi = XINT (val); | 515 | dpi = XINT (val); |
| 515 | else if (EQ (key, QCfc_unknown_spec)) | ||
| 516 | name = val; | ||
| 517 | else if (EQ (key, QClang)) | 516 | else if (EQ (key, QClang)) |
| 518 | { | 517 | { |
| 519 | langset = FcLangSetCreate (); | 518 | langset = FcLangSetCreate (); |
| @@ -530,8 +529,6 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec) | |||
| 530 | && ! FcLangSetAdd (langset, SYMBOL_FcChar8 (XCAR (val)))) | 529 | && ! FcLangSetAdd (langset, SYMBOL_FcChar8 (XCAR (val)))) |
| 531 | goto err; | 530 | goto err; |
| 532 | } | 531 | } |
| 533 | else if (EQ (key, QCname)) | ||
| 534 | name = val; | ||
| 535 | else if (EQ (key, QCotf)) | 532 | else if (EQ (key, QCotf)) |
| 536 | { | 533 | { |
| 537 | *otspec = ftfont_get_open_type_spec (val); | 534 | *otspec = ftfont_get_open_type_spec (val); |
| @@ -563,13 +560,9 @@ ftfont_spec_pattern (spec, fc_charset_idx, otlayout, otspec) | |||
| 563 | } | 560 | } |
| 564 | } | 561 | } |
| 565 | 562 | ||
| 566 | pattern = NILP (name) ? FcPatternCreate () : FcNameParse (SDATA (name)); | 563 | pattern = FcPatternCreate (); |
| 567 | if (! pattern) | 564 | if (! pattern) |
| 568 | goto err; | 565 | goto err; |
| 569 | FcPatternDel (pattern, FC_SIZE); | ||
| 570 | FcPatternDel (pattern, FC_PIXEL_SIZE); | ||
| 571 | FcPatternDel (pattern, FC_FOUNDRY); | ||
| 572 | FcPatternDel (pattern, FC_FAMILY); | ||
| 573 | tmp = AREF (spec, FONT_FOUNDRY_INDEX); | 566 | tmp = AREF (spec, FONT_FOUNDRY_INDEX); |
| 574 | if (! NILP (tmp) | 567 | if (! NILP (tmp) |
| 575 | && ! FcPatternAddString (pattern, FC_FOUNDRY, SYMBOL_FcChar8 (tmp))) | 568 | && ! FcPatternAddString (pattern, FC_FOUNDRY, SYMBOL_FcChar8 (tmp))) |
| @@ -663,6 +656,9 @@ ftfont_list (frame, spec) | |||
| 663 | #ifdef FC_CAPABILITY | 656 | #ifdef FC_CAPABILITY |
| 664 | FC_CAPABILITY, | 657 | FC_CAPABILITY, |
| 665 | #endif /* FC_CAPABILITY */ | 658 | #endif /* FC_CAPABILITY */ |
| 659 | #ifdef FC_FONTFORMAT | ||
| 660 | FC_FONTFORMAT, | ||
| 661 | #endif | ||
| 666 | NULL); | 662 | NULL); |
| 667 | if (! objset) | 663 | if (! objset) |
| 668 | goto err; | 664 | goto err; |
| @@ -746,6 +742,7 @@ ftfont_list (frame, spec) | |||
| 746 | } | 742 | } |
| 747 | #endif /* HAVE_LIBOTF */ | 743 | #endif /* HAVE_LIBOTF */ |
| 748 | entity = ftfont_pattern_entity (fontset->fonts[i], registry, | 744 | entity = ftfont_pattern_entity (fontset->fonts[i], registry, |
| 745 | AREF (spec, FONT_EXTRA_INDEX), | ||
| 749 | fc_charset_idx); | 746 | fc_charset_idx); |
| 750 | if (! NILP (entity)) | 747 | if (! NILP (entity)) |
| 751 | val = Fcons (entity, val); | 748 | val = Fcons (entity, val); |
| @@ -800,7 +797,9 @@ ftfont_match (frame, spec) | |||
| 800 | match = FcFontMatch (NULL, pattern, &result); | 797 | match = FcFontMatch (NULL, pattern, &result); |
| 801 | if (match) | 798 | if (match) |
| 802 | { | 799 | { |
| 803 | entity = ftfont_pattern_entity (match, Qunicode_bmp, fc_charset_idx); | 800 | entity = ftfont_pattern_entity (match, Qunicode_bmp, |
| 801 | AREF (spec, FONT_EXTRA_INDEX), | ||
| 802 | fc_charset_idx); | ||
| 804 | FcPatternDestroy (match); | 803 | FcPatternDestroy (match); |
| 805 | if (! NILP (AREF (spec, FONT_FAMILY_INDEX)) | 804 | if (! NILP (AREF (spec, FONT_FAMILY_INDEX)) |
| 806 | && NILP (assq_no_quit (AREF (spec, FONT_FAMILY_INDEX), | 805 | && NILP (assq_no_quit (AREF (spec, FONT_FAMILY_INDEX), |