freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][svg_metrics] 2 commits: * subprojects/zlib.wrap


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype][svg_metrics] 2 commits: * subprojects/zlib.wrap: Update to zlib version 1.2.13.
Date: Fri, 21 Oct 2022 12:14:55 +0000

Alexei Podtelezhnikov pushed to branch svg_metrics at FreeType / FreeType

Commits:

  • 0ec85f71
    by Werner Lemberg at 2022-10-20T13:55:41+02:00
    * subprojects/zlib.wrap: Update to zlib version 1.2.13.
    
  • 1bfaca06
    by Alexei Podtelezhnikov at 2022-10-21T12:14:52+00:00
    [cff, truetype] Simplify SVG metrics scaling.
    
    Use pre-calculated scaling factors. Also, the advance widths used
    to be rounded, which was incorrect.
    
    * src/cff/cffgload.c (cff_slot_load): Use `x_scale` and `y_scale`.
    * src/truetype/ttgload.c (TT_Load_Glyph): Ditto.
    

3 changed files:

Changes:

  • src/cff/cffgload.c
    ... ... @@ -356,18 +356,14 @@
    356 356
     
    
    357 357
     #ifdef FT_CONFIG_OPTION_SVG
    
    358 358
         /* check for OT-SVG */
    
    359
    -    if ( ( load_flags & FT_LOAD_COLOR )     &&
    
    360
    -         ( (TT_Face)glyph->root.face )->svg )
    
    359
    +    if ( ( load_flags & FT_LOAD_COLOR ) && face->svg )
    
    361 360
         {
    
    362 361
           /*
    
    363 362
            * We load the SVG document and try to grab the advances from the
    
    364 363
            * table.  For the bearings we rely on the presetting hook to do that.
    
    365 364
            */
    
    366 365
     
    
    367
    -      FT_Short      dummy;
    
    368
    -      FT_UShort     advanceX;
    
    369
    -      FT_UShort     advanceY;
    
    370
    -      SFNT_Service  sfnt;
    
    366
    +      SFNT_Service  sfnt  = (SFNT_Service)face->sfnt;
    
    371 367
     
    
    372 368
     
    
    373 369
           if ( size && (size->root.metrics.x_ppem < 1 ||
    
    ... ... @@ -379,10 +375,17 @@
    379 375
     
    
    380 376
           FT_TRACE3(( "Trying to load SVG glyph\n" ));
    
    381 377
     
    
    382
    -      sfnt  = (SFNT_Service)((TT_Face)glyph->root.face)->sfnt;
    
    383 378
           error = sfnt->load_svg_doc( (FT_GlyphSlot)glyph, glyph_index );
    
    384 379
           if ( !error )
    
    385 380
           {
    
    381
    +        FT_Fixed  x_scale = size->root.metrics.x_scale;
    
    382
    +        FT_Fixed  y_scale = size->root.metrics.y_scale;
    
    383
    +
    
    384
    +        FT_Short   dummy;
    
    385
    +        FT_UShort  advanceX;
    
    386
    +        FT_UShort  advanceY;
    
    387
    +
    
    388
    +
    
    386 389
             FT_TRACE3(( "Successfully loaded SVG glyph\n" ));
    
    387 390
     
    
    388 391
             glyph->root.format = FT_GLYPH_FORMAT_SVG;
    
    ... ... @@ -407,17 +410,8 @@
    407 410
             glyph->root.linearHoriAdvance = advanceX;
    
    408 411
             glyph->root.linearVertAdvance = advanceY;
    
    409 412
     
    
    410
    -        advanceX =
    
    411
    -          (FT_UShort)FT_MulDiv( advanceX,
    
    412
    -                                glyph->root.face->size->metrics.x_ppem,
    
    413
    -                                glyph->root.face->units_per_EM );
    
    414
    -        advanceY =
    
    415
    -          (FT_UShort)FT_MulDiv( advanceY,
    
    416
    -                                glyph->root.face->size->metrics.y_ppem,
    
    417
    -                                glyph->root.face->units_per_EM );
    
    418
    -
    
    419
    -        glyph->root.metrics.horiAdvance = advanceX << 6;
    
    420
    -        glyph->root.metrics.vertAdvance = advanceY << 6;
    
    413
    +        glyph->root.metrics.horiAdvance = FT_MulFix( advanceX, x_scale );
    
    414
    +        glyph->root.metrics.vertAdvance = FT_MulFix( advanceY, y_scale );
    
    421 415
     
    
    422 416
             return error;
    
    423 417
           }
    

  • src/truetype/ttgload.c
    ... ... @@ -2871,21 +2871,22 @@
    2871 2871
         /* check for OT-SVG */
    
    2872 2872
         if ( ( load_flags & FT_LOAD_COLOR ) && ( (TT_Face)glyph->face )->svg )
    
    2873 2873
         {
    
    2874
    -      SFNT_Service  sfnt;
    
    2875
    -
    
    2876
    -      FT_Short   leftBearing;
    
    2877
    -      FT_Short   topBearing;
    
    2878
    -      FT_UShort  advanceX;
    
    2879
    -      FT_UShort  advanceY;
    
    2874
    +      TT_Face       face = (TT_Face)glyph->face;
    
    2875
    +      SFNT_Service  sfnt = (SFNT_Service)face->sfnt;
    
    2880 2876
     
    
    2881 2877
     
    
    2882 2878
           FT_TRACE3(( "Trying to load SVG glyph\n" ));
    
    2883
    -      sfnt = (SFNT_Service)( (TT_Face)glyph->face )->sfnt;
    
    2884 2879
     
    
    2885 2880
           error = sfnt->load_svg_doc( glyph, glyph_index );
    
    2886 2881
           if ( !error )
    
    2887 2882
           {
    
    2888
    -        TT_Face  face = (TT_Face)glyph->face;
    
    2883
    +        FT_Fixed  x_scale = size->root.metrics.x_scale;
    
    2884
    +        FT_Fixed  y_scale = size->root.metrics.y_scale;
    
    2885
    +
    
    2886
    +        FT_Short   leftBearing;
    
    2887
    +        FT_Short   topBearing;
    
    2888
    +        FT_UShort  advanceX;
    
    2889
    +        FT_UShort  advanceY;
    
    2889 2890
     
    
    2890 2891
     
    
    2891 2892
             FT_TRACE3(( "Successfully loaded SVG glyph\n" ));
    
    ... ... @@ -2906,15 +2907,8 @@
    2906 2907
             glyph->linearHoriAdvance = advanceX;
    
    2907 2908
             glyph->linearVertAdvance = advanceY;
    
    2908 2909
     
    
    2909
    -        advanceX = (FT_UShort)FT_MulDiv( advanceX,
    
    2910
    -                                         glyph->face->size->metrics.x_ppem,
    
    2911
    -                                         glyph->face->units_per_EM );
    
    2912
    -        advanceY = (FT_UShort)FT_MulDiv( advanceY,
    
    2913
    -                                         glyph->face->size->metrics.y_ppem,
    
    2914
    -                                         glyph->face->units_per_EM );
    
    2915
    -
    
    2916
    -        glyph->metrics.horiAdvance = advanceX << 6;
    
    2917
    -        glyph->metrics.vertAdvance = advanceY << 6;
    
    2910
    +        glyph->metrics.horiAdvance = FT_MulFix( advanceX, x_scale );
    
    2911
    +        glyph->metrics.vertAdvance = FT_MulFix( advanceY, y_scale );
    
    2918 2912
     
    
    2919 2913
             return error;
    
    2920 2914
           }
    

  • subprojects/zlib.wrap
    1 1
     [wrap-file]
    
    2
    -directory = zlib-1.2.12
    
    3
    -source_url = http://zlib.net/fossils/zlib-1.2.12.tar.gz
    
    4
    -source_filename = zlib-1.2.12.tar.gz
    
    5
    -source_hash = 91844808532e5ce316b3c010929493c0244f3d37593afd6de04f71821d5136d9
    
    6
    -patch_filename = zlib_1.2.12-1_patch.zip
    
    7
    -patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.2.12-1/get_patch
    
    8
    -patch_hash = 8ec8344f3fe7b06ad4be768fd416694bc56cb4545ce78b0f1c18b3e72b3ec936
    
    2
    +directory = zlib-1.2.13
    
    3
    +source_url = http://zlib.net/fossils/zlib-1.2.13.tar.gz
    
    4
    +source_filename = zlib-1.2.13.tar.gz
    
    5
    +source_hash = b3a24de97a8fdbc835b9833169501030b8977031bcb54b3b3ac13740f846ab30
    
    6
    +patch_filename = zlib_1.2.13-1_patch.zip
    
    7
    +patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.2.13-1/get_patch
    
    8
    +patch_hash = 73a0103df54133b10f8774f92e23da048bd22554523e2b833cdb72b2702c0628
    
    9
    +wrapdb_version = 1.2.13-1
    
    9 10
     
    
    10 11
     [provide]
    
    11 12
     zlib = zlib_dep
    12
    -


  • reply via email to

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