bugThe FreeType Project - Bugs: bug #55499, Wrong outline orientation of...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #55499: Wrong outline orientation of mirrored sub-glyphs

Submitter:  None
Submitted:  Thu 17 Jan 2019 03:47:01 PM UTC
   
 
Severity:  3 - Normal Item Group:  Incorrect behaviour
Status:  Confirmed Privacy:  Public
Assigned to:  wl Open/Closed:  Open
Planned Release:  None

Mon 28 Sep 2020 07:07:04 AM UTC, comment #3: 

It is verified that reversed references do NOT reverse their point order to compensate. This is verified with OutlineOrientationTest. (16ppem)

The outline does not reverse point order. Right outline orientation of mirrored sub-glyphs.PNG

TD renderer uses FreeType outlines but uses its own rasterizer. The second glyph consists of both the upright reference and a reversed reference. It can be seen that both FreeType and Microsoft outlines have the intersection cancel out, which would not happen if the point order were to be reversed. The FreeType renderer has Half pixel glitching ( https://savannah.nongnu.org/bugs/?58373 ), while TD renderer renders it properly, but the outline itself is correct in all cases, unless the scaled references were to be hinted, then FreeType would have incorrect hinting of scaled subglyphs ( https://savannah.nongnu.org/bugs/?55001 ).

(file #49875,

Anonymous
Sat 19 Jan 2019 04:44:25 PM UTC, comment #2: 

FT_OUTLINE_REVERSE_FILL should be set for each contour. Then the rasterizer could be updated to work even fro the composite glyphs with opposite orientations. This is not possible without breaking compatibility. Therefore the composite glyphs (and only them) should indeed reverse the point order accordingly.

This is such a hypothetical issue though.

Alexei Podtelezhnikov <podtelez>
Group Member
Fri 18 Jan 2019 12:14:32 PM UTC, comment #1: 

Thanks for the report.

AFAICS, this situation is not covered in the OpenType specification.  I've thus asked on the OpenType e-mail list for a clarification that I will then implement in FreeType.

Werner LEMBERG <wl>
Group administrator
Thu 17 Jan 2019 03:47:01 PM UTC, original submission:  

Glyph outlines do not always match the FT_OUTLINE_REVERSE_FILL flag.

Case in point: The Monotype font "Arial Black" (version 5.23) glyph 64 (closing square bracket "]") is loaded by FT_Load_Glyph with a reverse outline direction, but FT_OUTLINE_REVERSE_FILL is not set.

Cursory examination of the glyph reveals that it is a composite glyph defined as the mirror image (scaled by (-1,1)) of glyph 62 (opening square bracket "]").

This suggests a systematical error in the composition of outlines when sub-glyphs are scaled with different signs in the X and Y direction, in that FT_Load_Glyph fails to revert the order of control points in such cases, as would be necessary to preserve the winding order.

Note that while simply flipping the FT_OUTLINE_REVERSE_FILL bit would appear to solve the case in point, it would not work for outlines composed of both mirrored and non-mirrored sub-glyphs.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #49875:  OutlineOrientationTest.ttf added by None (3KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by podtelez (Posted a comment)
  • -email is unavailable- added by wl (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-28 None Attached File- Added OutlineOrientationTest.ttf, #49875
        Attached File- Added Right@outline@orientation@of@mirrored@sub-glyphs.PNG, #49876
    2019-01-18 wl StatusNone Confirmed
        Assigned toNone wl

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code