freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] 2 commits: * src/ttdebug.c (RunIn


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype-demos][master] 2 commits: * src/ttdebug.c (RunIns): Signature fix.
Date: Sat, 08 Jul 2023 04:06:43 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType Demo Programs

Commits:

  • a94ddbe2
    by Hin-Tak Leung at 2023-07-08T05:45:13+02:00
    * src/ttdebug.c (RunIns): Signature fix.
    
    A somewhat similar change to what happened in the FreeType library:
    
      commit 95d635eab1b08a0051de07b6c33067d2c1984848
      Author: Werner Lemberg <wl@gnu.org>
      Date:   Sun May 7 08:34:32 2023 +0200
    
          [truetype] Signature fixes.
    
    Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
    
  • 2149b9c7
    by Hin-Tak Leung at 2023-07-08T06:02:35+02:00
    rsvg-port.c: Simplify usage of `rsvg_handle_render_*`.
    
    * src/rsvg-port.c (rsvg_port_preset_slot): Remove usage of
    `rsvg_handle_render_document` (and `rsvg_handle_render_cairo`).  They are
    functionally the same as `rsvg_handle_render_layer` (and
    `rsvg_handle_render_cairo_sub`) with argument id set to NULL.
    
    Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
    

2 changed files:

Changes:

  • src/rsvg-port.c
    ... ... @@ -194,6 +194,9 @@
    194 194
         float vertBearingX, vertBearingY;
    
    195 195
         float tmpf;
    
    196 196
     
    
    197
    +    char  *id;
    
    198
    +    char  str[32];
    
    199
    +
    
    197 200
     
    
    198 201
         /* If `cache` is `TRUE` we store calculations in the actual port */
    
    199 202
         /* state variable, otherwise we just create a dummy variable and */
    
    ... ... @@ -320,69 +323,43 @@
    320 323
         /* If the document contains only one glyph, `start_glyph_id` and */
    
    321 324
         /* `end_glyph_id` have the same value.  Otherwise `end_glyph_id` */
    
    322 325
         /* is larger.                                                    */
    
    323
    -    if ( start_glyph_id == end_glyph_id )
    
    326
    +    if ( start_glyph_id < end_glyph_id )
    
    324 327
         {
    
    325
    -      /* Render the whole document to the recording surface. */
    
    326
    -#if LIBRSVG_CHECK_VERSION( 2, 52, 0 )
    
    327
    -      {
    
    328
    -        RsvgRectangle  viewport =
    
    329
    -        {
    
    330
    -          .x = 0,
    
    331
    -          .y = 0,
    
    332
    -          .width  = (double)dimension_svg.width,
    
    333
    -          .height = (double)dimension_svg.height,
    
    334
    -        };
    
    335
    -
    
    336
    -
    
    337
    -        ret = rsvg_handle_render_document( handle,
    
    338
    -                                           rec_cr,
    
    339
    -                                           &viewport,
    
    340
    -                                           NULL );
    
    341
    -      }
    
    342
    -#else
    
    343
    -      ret = rsvg_handle_render_cairo( handle, rec_cr );
    
    344
    -#endif
    
    345
    -
    
    346
    -      if ( ret == FALSE )
    
    347
    -      {
    
    348
    -        error = FT_Err_Invalid_SVG_Document;
    
    349
    -        goto CleanCairo;
    
    350
    -      }
    
    328
    +      /* Render only the element with its ID equal to `glyph<ID>`. */
    
    329
    +      sprintf( str, "#glyph%u", slot->glyph_index );
    
    330
    +      id = str;
    
    351 331
         }
    
    352
    -    else if ( start_glyph_id < end_glyph_id )
    
    332
    +    else
    
    353 333
         {
    
    354
    -      char  str[32] = "#glyph";
    
    355
    -
    
    356
    -
    
    357
    -      /* Render only the element with its ID equal to `glyph<ID>`. */
    
    358
    -      sprintf( str + 6, "%u", slot->glyph_index );
    
    334
    +      /* NULL = Render the whole document */
    
    335
    +      id = NULL;
    
    336
    +    }
    
    359 337
     
    
    360 338
     #if LIBRSVG_CHECK_VERSION( 2, 52, 0 )
    
    339
    +    {
    
    340
    +      RsvgRectangle  viewport =
    
    361 341
           {
    
    362
    -        RsvgRectangle  viewport =
    
    363
    -        {
    
    364
    -          .x = 0,
    
    365
    -          .y = 0,
    
    366
    -          .width  = (double)dimension_svg.width,
    
    367
    -          .height = (double)dimension_svg.height,
    
    368
    -        };
    
    369
    -
    
    370
    -
    
    371
    -        ret = rsvg_handle_render_layer( handle,
    
    372
    -                                        rec_cr,
    
    373
    -                                        str,
    
    374
    -                                        &viewport,
    
    375
    -                                        NULL );
    
    376
    -      }
    
    342
    +        .x = 0,
    
    343
    +        .y = 0,
    
    344
    +        .width  = (double)dimension_svg.width,
    
    345
    +        .height = (double)dimension_svg.height,
    
    346
    +      };
    
    347
    +
    
    348
    +
    
    349
    +      ret = rsvg_handle_render_layer( handle,
    
    350
    +                                      rec_cr,
    
    351
    +                                      id,
    
    352
    +                                      &viewport,
    
    353
    +                                      NULL );
    
    354
    +    }
    
    377 355
     #else
    
    378
    -      ret = rsvg_handle_render_cairo_sub( handle, rec_cr, str );
    
    356
    +    ret = rsvg_handle_render_cairo_sub( handle, rec_cr, id );
    
    379 357
     #endif
    
    380 358
     
    
    381
    -      if ( ret == FALSE )
    
    382
    -      {
    
    383
    -        error = FT_Err_Invalid_SVG_Document;
    
    384
    -        goto CleanCairo;
    
    385
    -      }
    
    359
    +    if ( ret == FALSE )
    
    360
    +    {
    
    361
    +      error = FT_Err_Invalid_SVG_Document;
    
    362
    +      goto CleanCairo;
    
    386 363
         }
    
    387 364
     
    
    388 365
         /* Get the bounding box of the drawing. */
    

  • src/ttdebug.c
    ... ... @@ -1978,8 +1978,10 @@
    1978 1978
     
    
    1979 1979
     
    
    1980 1980
       static FT_Error
    
    1981
    -  RunIns( TT_ExecContext  exc )
    
    1981
    +  RunIns( void*  exec )
    
    1982 1982
       {
    
    1983
    +    TT_ExecContext  exc = (TT_ExecContext)exec;
    
    1984
    +
    
    1983 1985
         FT_Int  key;
    
    1984 1986
     
    
    1985 1987
         FT_Bool  really_leave;
    
    ... ... @@ -3049,7 +3051,7 @@
    3049 3051
     
    
    3050 3052
         FT_Set_Debug_Hook( library,
    
    3051 3053
                            FT_DEBUG_HOOK_TRUETYPE,
    
    3052
    -                       (FT_DebugHook_Func)RunIns );
    
    3054
    +                       RunIns );
    
    3053 3055
     
    
    3054 3056
         printf( "%s\n"
    
    3055 3057
                 "press key `h' or `?' for help\n"
    


  • reply via email to

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