[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/android ad3def330c 2/7: Correctly round bearing values while com
From: |
Po Lu |
Subject: |
feature/android ad3def330c 2/7: Correctly round bearing values while computing pcm |
Date: |
Wed, 8 Feb 2023 10:42:54 -0500 (EST) |
branch: feature/android
commit ad3def330cd0696c832f338dcf8b913e0d8e2b35
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Correctly round bearing values while computing pcm
* src/sfntfont.c (sfntfont_measure_instructed_pcm)
(sfntfont_measure_pcm): Ceil rbearing value.
---
src/sfntfont.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/sfntfont.c b/src/sfntfont.c
index dbd1a037f4..607ab30afd 100644
--- a/src/sfntfont.c
+++ b/src/sfntfont.c
@@ -2277,9 +2277,8 @@ sfntfont_measure_instructed_pcm (struct sfnt_font_info
*font, sfnt_glyph glyph,
/* Scale the metrics by the interpreter's scale. */
sfnt_scale_metrics (&metrics, font->interpreter->scale);
- /* How to round lbearing and rbearing? */
pcm->lbearing = metrics.lbearing >> 16;
- pcm->rbearing = outline->xmax >> 16;
+ pcm->rbearing = SFNT_CEIL_FIXED (outline->xmax) >> 16;
/* Round the advance, ascent and descent upwards. */
pcm->width = SFNT_CEIL_FIXED (metrics.advance) >> 16;
@@ -2324,7 +2323,7 @@ sfntfont_measure_pcm (struct sfnt_font_info *font,
sfnt_glyph glyph,
/* How to round lbearing and rbearing? */
pcm->lbearing = metrics.lbearing >> 16;
- pcm->rbearing = outline->xmax >> 16;
+ pcm->rbearing = SFNT_CEIL_FIXED (outline->xmax) >> 16;
/* Round the advance, ascent and descent upwards. */
pcm->width = SFNT_CEIL_FIXED (metrics.advance) >> 16;
- feature/android updated (bd55cca4b8 -> c201043b4b), Po Lu, 2023/02/08
- feature/android 7fb0df0ce2 3/7: Fix graphics state when instructing glyphs, Po Lu, 2023/02/08
- feature/android ad3def330c 2/7: Correctly round bearing values while computing pcm,
Po Lu <=
- feature/android 6de4deb47e 6/7: Update Android port, Po Lu, 2023/02/08
- feature/android c201043b4b 7/7: Update Android port, Po Lu, 2023/02/08
- feature/android 1a70941c8e 1/7: Improve text display on Android port, Po Lu, 2023/02/08
- feature/android 0bd4b7fdab 4/7: Update Android port, Po Lu, 2023/02/08
- feature/android 2c5e36e00b 5/7: Merge remote-tracking branch 'origin/master' into feature/android, Po Lu, 2023/02/08