Add tests for glyph positioning

These tests check that we round glyph positions to integral device
pixel coordinates when hinting is enabled, and to device subpixel
positions if it isn't.
This commit is contained in:
Matthias Clasen 2024-03-03 13:54:33 -05:00
parent 4f2d63b8ac
commit 880e3ef289
5 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,20 @@
color {
color: #808080;
bounds: 0 -30 40 40;
}
text {
font: "boxes 32px" url("data:font/ttf;base64,\
AAEAAAAIAIAAAwAAY21hcABUAL8AAAEcAAAAPGdseWavMnMAAAABZAAAAKhoZWFkJwCrnwAAAIwA\
AAA2aGhlYQwiACUAAADEAAAAJGhtdHgQIAAAAAABCAAAABJsb2NhAFgAjAAAAVgAAAAMbWF4cAAI\
AAkAAADoAAAAIG5hbWV4eNV2AAACDAAAABcAAQAAAAEZmo4ZWh5fDzz1AAIIAAAAAADhwj0AAAAA\
AOIJCg8AAAAABCAGAAAAAAEAAgAAAAAAAAABAAAIAPwAAAAEIAAAAAAEIAABAAAAAAAAAAAAAAAA\
AAAABAABAAAABQAIAAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEIAAABAAAAAAAAAAA\
AAABAAAAAwAAAAwABAAwAAAACAAIAAIAAAAgAEMAVP//AAAAIABBAFT////g/8D/sAABAAAAAAAA\
AAAAAAAMABgALABAAFQAAQAAAAAEAAQEAAMAADEhESEEAPwABAQAAQAAAAAEAAYAAAMAADEhESEE\
APwABgAAAgAAAAAEIAQgAAMABwAAMSERIRMRIREEIPvggAMABCD8YAMA/QAAAAIAAAAABAAEAAAD\
AAcAADEhESETESERBAD8AIADAAQA/IADAP0AAAACAAAAAAQABAAAAwAHAAAxIREhExEhEQQA/ACA\
AwAEAPyAAwD9AAAAAAABABIAAQAAAAAAAQAFAABib3hlcwA=\
");
glyphs: 4 16 0 0.4, 4 16 0 0.6;
hint-style: slight;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

View File

@ -0,0 +1,20 @@
color {
color: #808080;
bounds: 0 -30 40 40;
}
text {
font: "boxes 32px" url("data:font/ttf;base64,\
AAEAAAAIAIAAAwAAY21hcABUAL8AAAEcAAAAPGdseWavMnMAAAABZAAAAKhoZWFkJwCrnwAAAIwA\
AAA2aGhlYQwiACUAAADEAAAAJGhtdHgQIAAAAAABCAAAABJsb2NhAFgAjAAAAVgAAAAMbWF4cAAI\
AAkAAADoAAAAIG5hbWV4eNV2AAACDAAAABcAAQAAAAEZmo4ZWh5fDzz1AAIIAAAAAADhwj0AAAAA\
AOIJCg8AAAAABCAGAAAAAAEAAgAAAAAAAAABAAAIAPwAAAAEIAAAAAAEIAABAAAAAAAAAAAAAAAA\
AAAABAABAAAABQAIAAIAAAAAAAEAAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAEIAAABAAAAAAAAAAA\
AAABAAAAAwAAAAwABAAwAAAACAAIAAIAAAAgAEMAVP//AAAAIABBAFT////g/8D/sAABAAAAAAAA\
AAAAAAAMABgALABAAFQAAQAAAAAEAAQEAAMAADEhESEEAPwABAQAAQAAAAAEAAYAAAMAADEhESEE\
APwABgAAAgAAAAAEIAQgAAMABwAAMSERIRMRIREEIPvggAMABCD8YAMA/QAAAAIAAAAABAAEAAAD\
AAcAADEhESETESERBAD8AIADAAQA/IADAP0AAAACAAAAAAQABAAAAwAHAAAxIREhExEhEQQA/ACA\
AwAEAPyAAwD9AAAAAAABABIAAQAAAAAAAQAFAABib3hlcwA=\
");
glyphs: 4 16 0 0.4, 4 16 0 0.6;
hint-style: none;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 B

View File

@ -84,6 +84,8 @@ compare_render_tests = [
'glyph-cache-overflow-slices',
'glyph-hinting-none',
'glyph-hinting-slight',
'glyph-hinting-position-nogl-nocairo',
'glyph-subpixel-position',
'glyph-scaling',
'glyph-antialias',
'huge-height',