Sent from my iPhone On 23 Oct 2022, at 5:20 am, Caolán McNamara <caolanm@xxxxxxxxxx> wrote:
On Sat, 2022-10-22 at 01:42 +1100, Chris Sherlock wrote:Test name: VclLogicalFontInstanceTest::testglyphboundrect
equality assertion failed
- Expected: 51x82@(7,-80)
- Actual : 51x83@(7,-80)
I’ve had another look at the code, with some help from Khaled. The
issue is the way in which we do our final rounding.
On Freetype, it uses 26.6 fixed point, and thus needs it’s own
special FreeType ceil and floor functions. CoreText appears to using
floating point, but the std::ceil and std::floor functions give
slight different results.
I presume that for mac its CoreTextStyle::ImplGetGlyphoundRect and theCTFontGetBoundingRectsForGlyphs so could print the numbers we get therevs the ones we get in FreeTypeFont::GetGlyphBoundRect to verify that.
I’ve added some debugging statements. the Freetype library does its own floor and ceil calculations. it’s looking like it isn’t a risky a rounding error, it is just that Freetype calculates one value and MacOS framework for glyphs calculates it differently.
Chris |