Closed idursun closed 5 years ago
I've tested it with silicon
and looks like everything is fine. Could you add some tests, especially for the {
case?
Sure 👍
Similar to the rasterization tests (i.e. rasterize_glyph_with_grayscale_aa
, rasterize_glyph_bilevel
) that are asserted with check_L_shape
?
Yes, I think this will work well.
I have added a "best-effort" test for verifying the rasterization of any top-down symmetrical letters.
Currently, it's only testing {
letter and running against windows and mac. Although, I believe it should kinda work against all loaders.
I think this is good enough. Thanks again!
Changed to target only Windows. Apparently, macos glyph is not as symmetrical.
Thanks!
Fixes #85
raster_bounds
was returning a rectangle at origin (0,0) whereas the origin of the bounds rectangle returned byget_alpha_texture_bounds
is not (0,0). This caused offsetting origin calculation to be off when passed torasterize_glyph
which caused the clipping.Offsetting origin calculation that I am referring to is:
https://github.com/pcwalton/font-kit/blob/6801dce15cbc75448d99420eeebbe8c867585f36/examples/render-glyph.rs#L133-L136
This change sets the origin of the
raster_bounds
rectangle so that the origin offset arithmetic actually holds for directwrite.