diff options
| author | Kenichi Handa | 2008-08-29 07:56:10 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2008-08-29 07:56:10 +0000 |
| commit | 89a95b7cf73592fb79175cc0d29dcba54ef4c453 (patch) | |
| tree | bad195b8d0acc5357d5743efc5fc3dd196bf56f6 /src | |
| parent | 9d9f3e1504a6238ac01da00e57a08ac6361ff878 (diff) | |
| download | emacs-89a95b7cf73592fb79175cc0d29dcba54ef4c453.tar.gz emacs-89a95b7cf73592fb79175cc0d29dcba54ef4c453.zip | |
Include composite.h.
(ftfont_resolve_generic_family): Add langset "en" to pattern.
(ftfont_shape_by_flt): Use LGSTRING_GLYPH_LEN, not
LGSTRING_LENGTH.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ftfont.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ftfont.c b/src/ftfont.c index 73d7ae48f5e..0b4b733dbf9 100644 --- a/src/ftfont.c +++ b/src/ftfont.c | |||
| @@ -32,6 +32,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 32 | #include "character.h" | 32 | #include "character.h" |
| 33 | #include "charset.h" | 33 | #include "charset.h" |
| 34 | #include "coding.h" | 34 | #include "coding.h" |
| 35 | #include "composite.h" | ||
| 35 | #include "fontset.h" | 36 | #include "fontset.h" |
| 36 | #include "font.h" | 37 | #include "font.h" |
| 37 | #include "ftfont.h" | 38 | #include "ftfont.h" |
| @@ -207,6 +208,7 @@ ftfont_resolve_generic_family (family, pattern) | |||
| 207 | Lisp_Object slot; | 208 | Lisp_Object slot; |
| 208 | FcPattern *match; | 209 | FcPattern *match; |
| 209 | FcResult result; | 210 | FcResult result; |
| 211 | FcLangSet *langset; | ||
| 210 | 212 | ||
| 211 | family = Fintern (Fdowncase (SYMBOL_NAME (family)), Qnil); | 213 | family = Fintern (Fdowncase (SYMBOL_NAME (family)), Qnil); |
| 212 | if (EQ (family, Qmono)) | 214 | if (EQ (family, Qmono)) |
| @@ -224,6 +226,14 @@ ftfont_resolve_generic_family (family, pattern) | |||
| 224 | FcPatternDel (pattern, FC_FOUNDRY); | 226 | FcPatternDel (pattern, FC_FOUNDRY); |
| 225 | FcPatternDel (pattern, FC_FAMILY); | 227 | FcPatternDel (pattern, FC_FAMILY); |
| 226 | FcPatternAddString (pattern, FC_FAMILY, SYMBOL_FcChar8 (family)); | 228 | FcPatternAddString (pattern, FC_FAMILY, SYMBOL_FcChar8 (family)); |
| 229 | if (FcPatternGetLangSet (pattern, FC_LANG, 0, &langset) != FcResultMatch) | ||
| 230 | { | ||
| 231 | /* This is to avoid the effect of locale. */ | ||
| 232 | langset = FcLangSetCreate (); | ||
| 233 | FcLangSetAdd (langset, "en"); | ||
| 234 | FcPatternAddLangSet (pattern, FC_LANG, langset); | ||
| 235 | FcLangSetDestroy (langset); | ||
| 236 | } | ||
| 227 | FcConfigSubstitute (NULL, pattern, FcMatchPattern); | 237 | FcConfigSubstitute (NULL, pattern, FcMatchPattern); |
| 228 | FcDefaultSubstitute (pattern); | 238 | FcDefaultSubstitute (pattern); |
| 229 | match = FcFontMatch (NULL, pattern, &result); | 239 | match = FcFontMatch (NULL, pattern, &result); |
| @@ -1769,7 +1779,7 @@ ftfont_shape_by_flt (lgstring, font, ft_face, otf) | |||
| 1769 | FT_Face ft_face; | 1779 | FT_Face ft_face; |
| 1770 | OTF *otf; | 1780 | OTF *otf; |
| 1771 | { | 1781 | { |
| 1772 | EMACS_UINT len = LGSTRING_LENGTH (lgstring); | 1782 | EMACS_UINT len = LGSTRING_GLYPH_LEN (lgstring); |
| 1773 | EMACS_UINT i; | 1783 | EMACS_UINT i; |
| 1774 | struct MFLTFontFT flt_font_ft; | 1784 | struct MFLTFontFT flt_font_ft; |
| 1775 | 1785 | ||
| @@ -1829,7 +1839,7 @@ ftfont_shape_by_flt (lgstring, font, ft_face, otf) | |||
| 1829 | gstring.glyphs = realloc (gstring.glyphs, | 1839 | gstring.glyphs = realloc (gstring.glyphs, |
| 1830 | sizeof (MFLTGlyph) * gstring.allocated); | 1840 | sizeof (MFLTGlyph) * gstring.allocated); |
| 1831 | } | 1841 | } |
| 1832 | if (gstring.used > LGSTRING_LENGTH (lgstring)) | 1842 | if (gstring.used > LGSTRING_GLYPH_LEN (lgstring)) |
| 1833 | return Qnil; | 1843 | return Qnil; |
| 1834 | for (i = 0; i < gstring.used; i++) | 1844 | for (i = 0; i < gstring.used; i++) |
| 1835 | { | 1845 | { |