* src/sfnt.h (SFNT_ROUND_FIXED):
* src/sfntfont.c (sfntfont_probe_widths):
(sfntfont_measure_pcm): Round lbearing properly.
\f
-#define SFNT_CEIL_FIXED(fixed) \
- (!((fixed) & 0177777) ? (fixed) \
- : ((fixed) + 0200000) & 037777600000)
+#define SFNT_CEIL_FIXED(fixed) (((fixed) + 0177777) & 037777600000)
+#define SFNT_FLOOR_FIXED(fixed) ((fixed) & 037777600000)
\f
num_characters++;
/* Add the advance to total_width. */
- total_width += metrics.advance / 65536;
+ total_width += SFNT_CEIL_FIXED (metrics.advance) / 65536;
/* Update min_width if it hasn't been set yet or is wider. */
if (font_info->font.min_width == 1
if (!outline)
return 1;
- pcm->lbearing = metrics.lbearing / 65536;
+ /* Round the left side bearing downwards. */
+ pcm->lbearing = SFNT_FLOOR_FIXED (metrics.lbearing) / 65536;
pcm->rbearing = SFNT_CEIL_FIXED (outline->xmax) / 65536;
/* Round the advance, ascent and descent upwards. */