summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@imendio.com>2006-01-10 07:54:17 +0000
committerAnders Carlsson <andersca@imendio.com>2006-01-10 07:54:17 +0000
commit953561ebbd7e58ecb3e6cec0e2446cf3dac3f146 (patch)
tree614ede87d8aed06a7ecbdd3c783641e58545ac5f /src
parentae807fc9361fcb77b1cefc09cb180f045510768b (diff)
Remove old scale matrix since it exists in our base class.
(_cairo_atsui_font_set_metrics): Fix descent calculation.
Diffstat (limited to 'src')
-rw-r--r--src/cairo-atsui-font.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/src/cairo-atsui-font.c b/src/cairo-atsui-font.c
index f0c9b697..9f3b54da 100644
--- a/src/cairo-atsui-font.c
+++ b/src/cairo-atsui-font.c
@@ -54,7 +54,6 @@ static cairo_status_t _cairo_atsui_font_create_scaled (cairo_font_face_t *font_f
struct _cairo_atsui_font {
cairo_scaled_font_t base;
- cairo_matrix_t scale;
ATSUStyle style;
ATSUStyle unscaled_style;
ATSUFontID fontID;
@@ -120,7 +119,7 @@ cairo_atsui_font_face_create_for_atsu_font_id (ATSUFontID font_id)
static CGAffineTransform
-CGAffineTransformMakeWithCairoFontScale(cairo_matrix_t *scale)
+CGAffineTransformMakeWithCairoFontScale(const cairo_matrix_t *scale)
{
return CGAffineTransformMake(scale->xx, scale->yx,
scale->xy, scale->yy,
@@ -128,7 +127,7 @@ CGAffineTransformMakeWithCairoFontScale(cairo_matrix_t *scale)
}
static ATSUStyle
-CreateSizedCopyOfStyle(ATSUStyle inStyle, cairo_matrix_t *scale)
+CreateSizedCopyOfStyle(ATSUStyle inStyle, const cairo_matrix_t *scale)
{
ATSUStyle style;
OSStatus err;
@@ -168,17 +167,17 @@ _cairo_atsui_font_set_metrics (cairo_atsui_font_t *font)
&metrics);
if (err == noErr) {
- cairo_font_extents_t extents;
+ cairo_font_extents_t extents;
extents.ascent = metrics.ascent;
- extents.descent = metrics.descent;
+ extents.descent = -metrics.descent;
extents.height = metrics.capHeight;
extents.max_x_advance = metrics.maxAdvanceWidth;
// The FT backend doesn't handle max_y_advance either, so we'll ignore it for now.
extents.max_y_advance = 0.0;
- _cairo_scaled_font_set_metrics (&font->base, &extents);
+ _cairo_scaled_font_set_metrics (&font->base, &extents);
return CAIRO_STATUS_SUCCESS;
}
@@ -197,7 +196,6 @@ _cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
cairo_scaled_font_t **font_out)
{
cairo_atsui_font_t *font = NULL;
- cairo_matrix_t scale;
OSStatus err;
cairo_status_t status;
@@ -206,8 +204,7 @@ _cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
_cairo_scaled_font_init(&font->base, font_face, font_matrix, ctm, options,
&cairo_atsui_scaled_font_backend);
- cairo_matrix_multiply(&scale, font_matrix, ctm);
- font->style = CreateSizedCopyOfStyle(style, &scale);
+ font->style = CreateSizedCopyOfStyle(style, &font->base.scale);
Fixed theSize = FloatToFixed(1.0);
const ATSUAttributeTag theFontStyleTags[] = { kATSUSizeTag };
@@ -221,7 +218,6 @@ _cairo_atsui_font_create_scaled (cairo_font_face_t *font_face,
font->unscaled_style = style;
font->fontID = font_id;
- font->scale = scale;
*font_out = &font->base;
@@ -588,7 +584,7 @@ _cairo_atsui_font_old_show_glyphs (void *abstract_font,
CGContextSetFont(myBitmapContext, cgFont);
CGAffineTransform textTransform =
- CGAffineTransformMakeWithCairoFontScale(&font->scale);
+ CGAffineTransformMakeWithCairoFontScale(&font->base.scale);
textTransform = CGAffineTransformScale(textTransform, 1.0f, -1.0f);