bugThe FreeType Project - Bugs: bug #58990, Incorrect glyph stretching and...

 
 

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

bug #58990: Incorrect glyph stretching and positioning when rendering at different x and y resolutions.

Submitter:  None
Submitted:  Fri 21 Aug 2020 09:17:48 PM UTC
   
 
Severity:  3 - Normal Item Group:  Incorrect behaviour
Status:  Confirmed Privacy:  Public
Assigned to:  wl Open/Closed:  Open
Planned Release:  None

Fri 21 Aug 2020 09:17:48 PM UTC, original submission:  

The attached program main.c is modified from https://www.freetype.org/freetype2/docs/tutorial/example1.c.  Compile it with

    gcc $(pkg-config --cflags --libs freetype2) main.c -o main

and run it with

    ./main /path/to/FreeSerif.ttf

where FreeSerif.ttf can be downloaded from http://ftp.gnu.org/gnu/freefont/freefont-ttf-20120503.zip (the specific release of FreeFont is important!).

The program loads two glyphs (codepoints 0x21d0 and 0x21d1, glyphs arrowdblleft and arrowdblup) and renders them at 200dpi horizontal resolution and 100dpi vertical resolution.  The result (bad.txt) shows that while the horizontal arrow is correctly stretched by a factor of 2 in x, the vertical arrow is incorrectly stretched in y instead, and also badly centered in y.

Interestingly, additionally passing FT_LOAD_FORCE_AUTOHINT to the FT_Load_Char call fixes the problem (good.txt): now the vertical arrow is correctly stretched in x as well, and correctly centered in y.  One may thus be led to believe that the font's native hinter perhaps(?) badly fails when hinting with different x and y resolutions.  However, passing FT_LOAD_NO_HINTING instead of FT_LOAD_FORCE_AUTOHINT does not fix the problem, and yields results similar to bad.txt, so that suggests it's not the font's native hinter's fault.

This bug was originally reported at https://lists.nongnu.org/archive/html/freetype/2020-08/msg00004.html; in response it was suggested that this may also be related to https://savannah.nongnu.org/bugs/?55001.

Anonymous

 

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

Attached Files
file #49691:  main.c added by None (2KiB - text/x-csrc)
file #49692:  good.txt added by None (5KiB - text/plain)
file #49693:  bad.txt added by None (5KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by wl (Updated the item)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-21 wl StatusNone Confirmed
        Assigned toNone wl
    2020-08-21 None Attached File- Added main.c, #49691
        Attached File- Added good.txt, #49692
        Attached File- Added bad.txt, #49693

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code