freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][gsoc-anurag-2023] 2 commits: dense fixes


From: Anurag Thakur (@AdbhutDev)
Subject: [Git][freetype/freetype][gsoc-anurag-2023] 2 commits: dense fixes
Date: Wed, 04 Oct 2023 21:07:44 +0000

Anurag Thakur pushed to branch gsoc-anurag-2023 at FreeType / FreeType

Commits:

  • bd0c3e59
    by Anurag Thakur at 2023-10-04T00:37:16+05:30
    dense fixes
    
  • 70e807ce
    by Anurag Thakur at 2023-10-05T02:37:12+05:30
    Add FT_Refresh_Glyph
    

4 changed files:

Changes:

  • include/freetype/freetype.h
    ... ... @@ -3248,6 +3248,10 @@ FT_BEGIN_HEADER
    3248 3248
                      FT_UInt   glyph_index,
    
    3249 3249
                      FT_Int32  load_flags );
    
    3250 3250
     
    
    3251
    +  FT_EXPORT( FT_Error )
    
    3252
    +  FT_Refresh_Glyph( FT_Face   face,
    
    3253
    +                 FT_UInt   glyph_index);
    
    3254
    +
    
    3251 3255
     
    
    3252 3256
       /**************************************************************************
    
    3253 3257
        *
    

  • modules.cfg
    ... ... @@ -100,7 +100,7 @@ HINTING_MODULES += pshinter
    100 100
     ####
    
    101 101
     
    
    102 102
     # Dense Rasterizer
    
    103
    -#RASTER_MODULES += dense
    
    103
    +RASTER_MODULES += dense
    
    104 104
     
    
    105 105
     # Anti-aliasing rasterizer.
    
    106 106
     RASTER_MODULES += smooth
    

  • src/base/ftobjs.c
    ... ... @@ -902,7 +902,20 @@
    902 902
     
    
    903 903
     
    
    904 904
       /* documentation is in freetype.h */
    
    905
    +  FT_EXPORT_DEF( FT_Error )
    
    906
    +  FT_Refresh_Glyph( FT_Face   face,
    
    907
    +                 FT_UInt   glyph_index)
    
    908
    +
    
    909
    +  {
    
    910
    +    //ft_glyphslot_free_bitmap( face->garray[glyph_index] );
    
    911
    +    face->garray[glyph_index]->format = FT_GLYPH_FORMAT_OUTLINE;
    
    905 912
     
    
    913
    +    // face->garray[glyph_index]->bitmap.width      = 0;
    
    914
    +    // face->garray[glyph_index]->bitmap.rows       = 0;
    
    915
    +    // face->garray[glyph_index]->bitmap.pitch      = 0;
    
    916
    +    // face->garray[glyph_index]->bitmap.pixel_mode = 0;
    
    917
    +
    
    918
    +  }
    
    906 919
       FT_EXPORT_DEF( FT_Error )
    
    907 920
       FT_Load_Glyph( FT_Face   face,
    
    908 921
                      FT_UInt   glyph_index,
    
    ... ... @@ -3141,7 +3154,7 @@ int conic_to2(FT_GlyphSlot* slot, FT_Vector *control, FT_Vector *from, FT_Vector
    3141 3154
           face->garray = (FT_GlyphSlot*)malloc(
    
    3142 3155
               face->driver->clazz->slot_object_size * face->num_glyphs );
    
    3143 3156
           //error           = FT_Set_Char_Size( face, 0, 160 * 64, 300, 300 );
    
    3144
    -      error           = FT_Set_Pixel_Sizes( face, 0, 100);
    
    3157
    +      error           = FT_Set_Pixel_Sizes( face, 0, 50);
    
    3145 3158
           // int glyph_index = FT_Get_Char_Index( face, 'A' );
    
    3146 3159
           // error           = FT_Load_Glyph( face, glyph_index, FT_LOAD_NO_HINTING );
    
    3147 3160
     
    

  • src/dense/ftdenserend.c
    ... ... @@ -162,8 +162,8 @@
    162 162
         }
    
    163 163
     
    
    164 164
         /* translate outline to render it into the bitmap */
    
    165
    -    if ( x_shift || y_shift ){
    
    166
    -      FT_Outline_Translate( outline, x_shift, y_shift );
    
    165
    +    if ( (x_shift || y_shift)&&!slot->prel_shifted ){
    
    166
    +      //FT_Outline_Translate( outline, x_shift, y_shift );
    
    167 167
           FT_PreLine pl = slot->prelines;
    
    168 168
           while (pl!=NULL)
    
    169 169
           {
    
    ... ... @@ -174,6 +174,7 @@
    174 174
     
    
    175 175
             pl = pl->next;
    
    176 176
           }
    
    177
    +      slot->prel_shifted = 1;
    
    177 178
           
    
    178 179
         }
    
    179 180
     
    
    ... ... @@ -198,8 +199,8 @@
    198 199
           slot->internal->flags &= ~FT_GLYPH_OWN_BITMAP;
    
    199 200
         }
    
    200 201
     
    
    201
    -    if ( x_shift || y_shift )
    
    202
    -      FT_Outline_Translate( outline, -x_shift, -y_shift );
    
    202
    +    // if ( x_shift || y_shift )
    
    203
    +    //   FT_Outline_Translate( outline, -x_shift, -y_shift );
    
    203 204
     
    
    204 205
         return error;
    
    205 206
       }
    


  • reply via email to

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