summaryrefslogtreecommitdiff
path: root/pango/pangoxft-font.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2002-06-04 14:59:50 +0000
committerOwen Taylor <otaylor@src.gnome.org>2002-06-04 14:59:50 +0000
commit5a2de6f0bb199b5f9f58ae2eed44e26b18fad634 (patch)
tree64b22bc7bccf640467f064bf184007c96e913c01 /pango/pangoxft-font.c
parentffcea1aa2e1c0f8a46b26bf90444942c421418ba (diff)
downloadpango-5a2de6f0bb199b5f9f58ae2eed44e26b18fad634.tar.gz
Don't open the font unecessarily, we already have the FcCharSet.
Mon Jun 3 22:16:35 2002 Owen Taylor <otaylor@redhat.com> * pango/pangoxft-font.c (pango_xft_font_get_coverage): Don't open the font unecessarily, we already have the FcCharSet.
Diffstat (limited to 'pango/pangoxft-font.c')
-rw-r--r--pango/pangoxft-font.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/pango/pangoxft-font.c b/pango/pangoxft-font.c
index d19ea450..48fea5c0 100644
--- a/pango/pangoxft-font.c
+++ b/pango/pangoxft-font.c
@@ -542,7 +542,7 @@ pango_xft_font_get_coverage (PangoFont *font,
Display *display;
FcChar32 map[FC_CHARSET_MAP_SIZE];
FcChar32 ucs4, pos;
- XftFont *xft_font;
+ FcCharSet *charset;
int i;
_pango_xft_font_map_get_info (xfont->fontmap, &display, NULL);
@@ -554,29 +554,29 @@ pango_xft_font_get_coverage (PangoFont *font,
if (coverage)
return pango_coverage_ref (coverage);
+ FcPatternGetCharSet (xfont->font_pattern, FC_CHARSET, 0, &charset);
+
coverage = pango_coverage_new ();
- xft_font = pango_xft_font_get_font (font);
- for (ucs4 = FcCharSetFirstPage (xft_font->charset, map, &pos);
+ for (ucs4 = FcCharSetFirstPage (charset, map, &pos);
ucs4 != FC_CHARSET_DONE;
- ucs4 = FcCharSetNextPage (xft_font->charset, map, &pos))
- {
- for (i = 0; i < FC_CHARSET_MAP_SIZE; i++)
+ ucs4 = FcCharSetNextPage (charset, map, &pos))
{
- FcChar32 bits = map[i];
- FcChar32 base = ucs4 + i * 32;
- int b = 0;
- bits = map[i];
- while (bits)
- {
- if (bits & 1)
+ for (i = 0; i < FC_CHARSET_MAP_SIZE; i++)
{
- pango_coverage_set (coverage, base + b, PANGO_COVERAGE_EXACT);
+ FcChar32 bits = map[i];
+ FcChar32 base = ucs4 + i * 32;
+ int b = 0;
+ bits = map[i];
+ while (bits)
+ {
+ if (bits & 1)
+ pango_coverage_set (coverage, base + b, PANGO_COVERAGE_EXACT);
+
+ bits >>= 1;
+ b++;
+ }
}
- bits >>= 1;
- b++;
- }
}
- }
_pango_xft_font_map_set_coverage (xfont->fontmap, filename, coverage);