freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype-demos][master] * src/ftview.c (Render_{All,Fancy


From: Alexei Podtelezhnikov (@apodtele)
Subject: [Git][freetype/freetype-demos][master] * src/ftview.c (Render_{All,Fancy,Stroke}): Tweak zero-width glyphs.
Date: Sun, 23 Apr 2023 03:08:00 +0000

Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs

Commits:

  • 86c711ad
    by Alexei Podtelezhnikov at 2023-04-22T23:02:27-04:00
    * src/ftview.c (Render_{All,Fancy,Stroke}): Tweak zero-width glyphs.
    
    This helps to avoid collisions and unhides zero-width glyphs better.
    

1 changed file:

Changes:

  • src/ftview.c
    ... ... @@ -239,17 +239,24 @@
    239 239
             }
    
    240 240
           }
    
    241 241
     
    
    242
    -      /* extra space between glyphs */
    
    243
    -      x++;
    
    244 242
           if ( slot->advance.x == 0 )
    
    245 243
           {
    
    246 244
             grFillRect( display->bitmap, x, y - width, width, width,
    
    247 245
                         status.green );
    
    248
    -        x += width;
    
    246
    +
    
    247
    +        if ( slot->bitmap_left < -width >> 2 )
    
    248
    +        {
    
    249
    +          x     += width;
    
    250
    +          width  = 0;
    
    251
    +        }
    
    249 252
           }
    
    253
    +      else
    
    254
    +        width = 0;
    
    250 255
     
    
    251 256
           error = FTDemo_Draw_Glyph( handle, display, glyph, &x, &y );
    
    252 257
     
    
    258
    +      x += width + 1;  /* with extra space between glyphs */
    
    259
    +
    
    253 260
           if ( error )
    
    254 261
             goto Next;
    
    255 262
           else
    
    ... ... @@ -382,17 +389,24 @@
    382 389
               break;
    
    383 390
           }
    
    384 391
     
    
    385
    -      /* extra space between glyphs */
    
    386
    -      x++;
    
    387 392
           if ( slot->advance.x == 0 )
    
    388 393
           {
    
    389 394
             grFillRect( display->bitmap, x, y - width, width, width,
    
    390 395
                         status.green );
    
    391
    -        x += width;
    
    396
    +
    
    397
    +        if ( slot->bitmap_left < -width >> 2 )
    
    398
    +        {
    
    399
    +          x     += width;
    
    400
    +          width  = 0;
    
    401
    +        }
    
    392 402
           }
    
    403
    +      else
    
    404
    +        width = 0;
    
    393 405
     
    
    394 406
           error = FTDemo_Draw_Slot( handle, display, slot, &x, &y );
    
    395 407
     
    
    408
    +      x += width + 1;  /* with extra space between glyphs */
    
    409
    +
    
    396 410
           if ( error )
    
    397 411
             goto Next;
    
    398 412
     
    
    ... ... @@ -570,17 +584,24 @@
    570 584
               break;
    
    571 585
           }
    
    572 586
     
    
    573
    -      /* extra space between glyphs */
    
    574
    -      x++;
    
    575 587
           if ( slot->advance.x == 0 )
    
    576 588
           {
    
    577 589
             grFillRect( display->bitmap, x, y - width, width, width,
    
    578 590
                         status.green );
    
    579
    -        x += width;
    
    591
    +
    
    592
    +        if ( slot->bitmap_left < -width >> 2 )
    
    593
    +        {
    
    594
    +          x     += width;
    
    595
    +          width  = 0;
    
    596
    +        }
    
    580 597
           }
    
    598
    +      else
    
    599
    +        width = 0;
    
    581 600
     
    
    582 601
           error = FTDemo_Draw_Slot( handle, display, slot, &x, &y );
    
    583 602
     
    
    603
    +      x += width + 1;  /* with extra space between glyphs */
    
    604
    +
    
    584 605
           if ( error )
    
    585 606
             goto Next;
    
    586 607
     
    


  • reply via email to

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