From b61d260b3e92a3fc4c0e054ad5b030182030f996 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Mon, 1 Oct 2012 20:08:12 +0200 Subject: [PATCH] drawing: scale pbo according to drawing scale Fixes issue #68. --- libass/ass_drawing.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libass/ass_drawing.c b/libass/ass_drawing.c index 8e2fa10..03eb568 100644 --- a/libass/ass_drawing.c +++ b/libass/ass_drawing.c @@ -87,6 +87,7 @@ static void drawing_prepare(ASS_Drawing *drawing) static void drawing_finish(ASS_Drawing *drawing, int raw_mode) { int i, offset; + double pbo; FT_BBox bbox = drawing->cbox; FT_Outline *ol = &drawing->outline; @@ -103,11 +104,12 @@ static void drawing_finish(ASS_Drawing *drawing, int raw_mode) drawing->advance.x = bbox.xMax - bbox.xMin; - drawing->desc = double_to_d6(-drawing->pbo * drawing->scale_y); + pbo = drawing->pbo / (64.0 / (1 << (drawing->scale - 1))); + drawing->desc = double_to_d6(-pbo * drawing->scale_y); drawing->asc = bbox.yMax - bbox.yMin + drawing->desc; // Place it onto the baseline - offset = (bbox.yMax - bbox.yMin) + double_to_d6(-drawing->pbo * + offset = (bbox.yMax - bbox.yMin) + double_to_d6(-pbo * drawing->scale_y); for (i = 0; i < ol->n_points; i++) ol->points[i].y += offset; -- 2.40.0