summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2005-06-14 17:41:17 +0000
committerOwen Taylor <otaylor@src.gnome.org>2005-06-14 17:41:17 +0000
commit8670c597a1a6b8f3332a35ed646fc06d13aaa7af (patch)
tree12ad6e837093acd38e482d9a75823318cba58e8c /pango/pangofc-fontmap.c
parentce168dd2b934b3375dbc0cef2e9fbe0ec3b37e8b (diff)
downloadpango-8670c597a1a6b8f3332a35ed646fc06d13aaa7af.tar.gz
Add a new context_substitute() virtual function that replaces
2005-05-17 Owen Taylor <otaylor@redhat.com> * pango/pangofc-fontmap.[ch]: Add a new context_substitute() virtual function that replaces default_substitute() and adds a PangoContext argument. * pango/pangocairo.h pango/pangocairo-fontmap.c docs/pango-sections.txt: Add pango_cairo_context_set/get_hinting() to control hinting on individual contexts. * pango/pangocairo-fcfont.c pango/pangocairo-fcfontmap.c: Implement hinting control for the for the fontconfig/cairo backend.
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index c4068db3..7804c2e0 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -818,14 +818,18 @@ uniquify_pattern (PangoFcFontMap *fcfontmap,
static void
pango_fc_default_substitute (PangoFcFontMap *fontmap,
- FcPattern *pattern)
+ PangoContext *context,
+ FcPattern *pattern)
{
- if (PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute)
+ if (PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->context_substitute)
+ PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->context_substitute (fontmap, context, pattern);
+ else if (PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute)
PANGO_FC_FONT_MAP_GET_CLASS (fontmap)->default_substitute (fontmap, pattern);
}
static gdouble
-pango_fc_font_map_get_dpi (PangoFcFontMap *fcfontmap)
+pango_fc_font_map_get_dpi (PangoFcFontMap *fcfontmap,
+ PangoContext *context)
{
if (fcfontmap->priv->dpi < 0)
{
@@ -836,7 +840,7 @@ pango_fc_font_map_get_dpi (PangoFcFontMap *fcfontmap)
NULL);
if (tmp)
{
- pango_fc_default_substitute (fcfontmap, tmp);
+ pango_fc_default_substitute (fcfontmap, NULL, tmp);
result = FcPatternGetDouble (tmp, FC_DPI, 0, &fcfontmap->priv->dpi);
FcPatternDestroy (tmp);
}
@@ -881,7 +885,7 @@ pango_fc_font_map_get_render_key (PangoFcFontMap *fcfontmap,
if (pango_font_description_get_size_is_absolute (desc))
size = pango_font_description_get_size (desc);
else
- size = pango_fc_font_map_get_dpi (fcfontmap) * pango_font_description_get_size (desc) / 72.;
+ size = pango_fc_font_map_get_dpi (fcfontmap, context) * pango_font_description_get_size (desc) / 72.;
if (context)
matrix = pango_context_get_matrix (context);
@@ -947,7 +951,7 @@ pango_fc_font_map_get_patterns (PangoFontMap *fontmap,
{
pattern = pango_fc_make_pattern (desc, language, key.y_size / 1024.);
- pango_fc_default_substitute (fcfontmap, pattern);
+ pango_fc_default_substitute (fcfontmap, context, pattern);
font_patterns = FcFontSort (NULL, pattern, FcTrue, NULL, &res);
@@ -1609,7 +1613,7 @@ pango_fc_face_list_sizes (PangoFontFace *face,
if (FcPatternGetDouble (fontset->fonts[i], FC_PIXEL_SIZE, 0, &size) == FcResultMatch)
{
if (dpi < 0)
- dpi = pango_fc_font_map_get_dpi (fcface->family->fontmap);
+ dpi = pango_fc_font_map_get_dpi (fcface->family->fontmap, NULL);
size_i = (int) (PANGO_SCALE * size * 72.0 / dpi);
g_array_append_val (size_array, size_i);