summaryrefslogtreecommitdiff
path: root/pango/pangocairo-coretextfont.c
diff options
context:
space:
mode:
authorJohn Ralls <jralls@ceridwen.us>2017-08-15 09:21:26 +0200
committerJohn Ralls <jralls@ceridwen.us>2017-08-15 09:26:36 +0200
commit8ab2cc198469b4a46b1536c4f5c5d3396a6444b4 (patch)
treee98ab683e7fb7afbf39fac6796bde905f14ca38a /pango/pangocairo-coretextfont.c
parent599ffcf042bbca6f87edff0e241958523145294d (diff)
downloadpango-8ab2cc198469b4a46b1536c4f5c5d3396a6444b4.tar.gz
CoreText: Remove absolute size and scaling to screen resolution.
Cairo's CGFont backend already handles scaling fonts to the display resolution, so scaling to the screen screen resolution in Pango's CoreText backend generates double-sized text on a Retina display. The layout test depended on providing a (bogus) resolution of 96DPI and scaling the font to it in order to obtain the "expected" layout results. This is replaced by adjusting the font size in test-layout.c if Pango is compiled for CoreText. https://bugzilla.gnome.org/show_bug.cgi?id=782393
Diffstat (limited to 'pango/pangocairo-coretextfont.c')
-rw-r--r--pango/pangocairo-coretextfont.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/pango/pangocairo-coretextfont.c b/pango/pangocairo-coretextfont.c
index 0f2a9ef1..c07f1c77 100644
--- a/pango/pangocairo-coretextfont.c
+++ b/pango/pangocairo-coretextfont.c
@@ -36,8 +36,6 @@ struct _PangoCairoCoreTextFont
{
PangoCoreTextFont font;
PangoCairoFontPrivate cf_priv;
-
- int abs_size;
};
struct _PangoCairoCoreTextFontClass
@@ -164,18 +162,6 @@ pango_cairo_core_text_font_create_base_metrics_for_context (PangoCairoFont *font
return metrics;
}
-static PangoFontDescription *
-pango_cairo_core_text_font_describe_absolute (PangoFont *font)
-{
- PangoFontDescription *desc;
- PangoCairoCoreTextFont *cafont = (PangoCairoCoreTextFont *) font;
-
- desc = pango_font_describe (font);
- pango_font_description_set_absolute_size (desc, cafont->abs_size);
-
- return desc;
-}
-
static void
pango_cairo_core_text_font_finalize (GObject *object)
{
@@ -196,7 +182,6 @@ pango_cairo_core_text_font_class_init (PangoCairoCoreTextFontClass *class)
font_class->get_glyph_extents = pango_cairo_core_text_font_get_glyph_extents;
font_class->get_metrics = _pango_cairo_font_get_metrics;
- font_class->describe_absolute = pango_cairo_core_text_font_describe_absolute;
}
static void
@@ -214,11 +199,10 @@ _pango_cairo_core_text_font_new (PangoCairoCoreTextFontMap *cafontmap,
CTFontRef font_ref;
CTFontDescriptorRef ctdescriptor;
CGFontRef font_id;
- double size, abs_size;
+ double size;
cairo_matrix_t font_matrix;
- abs_size = pango_core_text_font_key_get_absolute_size (key);
- size = pango_units_to_double (abs_size);
+ size = pango_units_to_double (pango_core_text_font_key_get_size (key));
size /= pango_matrix_get_font_scale_factor (pango_core_text_font_key_get_matrix (key));
@@ -235,8 +219,6 @@ _pango_cairo_core_text_font_new (PangoCairoCoreTextFontMap *cafontmap,
cafont = g_object_new (PANGO_TYPE_CAIRO_CORE_TEXT_FONT, NULL);
cfont = PANGO_CORE_TEXT_FONT (cafont);
- cafont->abs_size = abs_size;
-
_pango_core_text_font_set_ctfont (cfont, font_ref);
if (synthesize_italic)