emacs-diffs
[Top][All Lists]
Advanced

[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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]