freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] [svg] Set linear advances when loading


From: Ben Wagner (@bungeman)
Subject: [Git][freetype/freetype][master] [svg] Set linear advances when loading SVG glyphs
Date: Tue, 07 Jun 2022 12:58:49 +0000

Ben Wagner pushed to branch master at FreeType / FreeType

Commits:

  • b11074cf
    by Ben Wagner at 2022-06-06T16:55:17-04:00
    [svg] Set linear advances when loading SVG glyphs
    
    * include/freetype/freetype.h (FT_GlyphSlotRec_): update doc
    * src/cff/cffgload.c (cff_slot_load): do it
    * src/truetype/ttgload.c (TT_Load_Glyph): do it
    
    Fixes: #1156
    

3 changed files:

Changes:

  • include/freetype/freetype.h
    ... ... @@ -1892,13 +1892,13 @@ FT_BEGIN_HEADER
    1892 1892
        *     The advance width of the unhinted glyph.  Its value is expressed in
    
    1893 1893
        *     16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
    
    1894 1894
        *     loading the glyph.  This field can be important to perform correct
    
    1895
    -   *     WYSIWYG layout.  Only relevant for outline glyphs.
    
    1895
    +   *     WYSIWYG layout.  Only relevant for scalable glyphs.
    
    1896 1896
        *
    
    1897 1897
        *   linearVertAdvance ::
    
    1898 1898
        *     The advance height of the unhinted glyph.  Its value is expressed in
    
    1899 1899
        *     16.16 fractional pixels, unless @FT_LOAD_LINEAR_DESIGN is set when
    
    1900 1900
        *     loading the glyph.  This field can be important to perform correct
    
    1901
    -   *     WYSIWYG layout.  Only relevant for outline glyphs.
    
    1901
    +   *     WYSIWYG layout.  Only relevant for scalable glyphs.
    
    1902 1902
        *
    
    1903 1903
        *   advance ::
    
    1904 1904
        *     This shorthand is, depending on @FT_LOAD_IGNORE_TRANSFORM, the
    

  • src/cff/cffgload.c
    ... ... @@ -404,6 +404,9 @@
    404 404
                                &dummy,
    
    405 405
                                &advanceY );
    
    406 406
     
    
    407
    +        glyph->root.linearHoriAdvance = advanceX;
    
    408
    +        glyph->root.linearVertAdvance = advanceY;
    
    409
    +
    
    407 410
             advanceX =
    
    408 411
               (FT_UShort)FT_MulDiv( advanceX,
    
    409 412
                                     glyph->root.face->size->metrics.x_ppem,
    

  • src/truetype/ttgload.c
    ... ... @@ -3005,6 +3005,9 @@
    3005 3005
                                &topBearing,
    
    3006 3006
                                &advanceY );
    
    3007 3007
     
    
    3008
    +        glyph->linearHoriAdvance = advanceX;
    
    3009
    +        glyph->linearVertAdvance = advanceY;
    
    3010
    +
    
    3008 3011
             advanceX = (FT_UShort)FT_MulDiv( advanceX,
    
    3009 3012
                                              glyph->face->size->metrics.x_ppem,
    
    3010 3013
                                              glyph->face->units_per_EM );
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]