freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] gsoc-anurag-2023 36f7c6bd3: Add structure to store preloaded


From: Werner Lemberg
Subject: [freetype2] gsoc-anurag-2023 36f7c6bd3: Add structure to store preloaded lines
Date: Thu, 24 Aug 2023 15:06:08 -0400 (EDT)

branch: gsoc-anurag-2023
commit 36f7c6bd343863afe2c6f682b7863b90857630eb
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>

    Add structure to store preloaded lines
---
 include/freetype/freetype.h |  8 ++++++++
 src/base/ftobjs.c           | 11 ++++++++---
 src/dense/ftdenserend.c     |  3 ++-
 3 files changed, 18 insertions(+), 4 deletions(-)

diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index cbca9d2be..b58f8d82b 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1041,6 +1041,13 @@ FT_BEGIN_HEADER
    */
   typedef struct FT_Face_InternalRec_*  FT_Face_Internal;
 
+  typedef struct FT_PreLineRec_* FT_PreLine;
+  typedef struct FT_PreLineRec_
+  {
+    int x1, x2, y1, y2;
+    FT_PreLine next;
+  } FT_PreLineRec;
+
 
   /**************************************************************************
    *
@@ -2289,6 +2296,7 @@ FT_BEGIN_HEADER
     FT_Pos            rsb_delta;
 
     void*             other;
+    FT_PreLine        prelines;
 
     FT_Slot_Internal  internal;
 
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 472bb681c..7e3c54b8d 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1169,6 +1169,7 @@
         error = FT_Render_Glyph( slot, mode );
       else
         ft_glyphslot_preset_bitmap( slot, mode, NULL );
+      
     }
 
 #ifdef FT_DEBUG_LEVEL_TRACE
@@ -2786,7 +2787,7 @@
       face->garray = (FT_GlyphSlot*)malloc(
           face->driver->clazz->slot_object_size * face->num_glyphs );
       error           = FT_Set_Char_Size( face, 0, 160 * 64, 300, 300 );
-      int glyph_index = FT_Get_Char_Index( face, 'A' );
+      // int glyph_index = FT_Get_Char_Index( face, 'A' );
       // error           = FT_Load_Glyph( face, glyph_index, 
FT_LOAD_NO_HINTING );
 
       for ( int gindex = 0; gindex < face->num_glyphs; gindex++ )
@@ -2797,11 +2798,15 @@
 
         FT_ALLOC(face->garray[gindex], clazz->slot_object_size);
         face->garray[gindex]->face = face;
+        face->garray[gindex]->glyph_index = gindex;
         ft_glyphslot_init(face->garray[gindex]);
         face->garray[gindex]->next = face->garray[gindex];
-        face->glyph = face->garray[gindex];
+        *face->glyph = *face->garray[gindex];
+
+        FT_Load_Glyph(face, gindex, FT_LOAD_NO_HINTING);
+
+        *face->garray[gindex]->prelines = (FT_PreLineRec){1,2,3,4, NULL}; // 
need to revise structs and pointers.
 
-        FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_HINTING);
       }
 
 
diff --git a/src/dense/ftdenserend.c b/src/dense/ftdenserend.c
index 61a2b1850..3aa98cde6 100644
--- a/src/dense/ftdenserend.c
+++ b/src/dense/ftdenserend.c
@@ -5,7 +5,7 @@
 #include <freetype/internal/ftobjs.h>
 #include "ftdenserend.h"
 #include "ftdense.h"
-
+#include <stdio.h>
 #include "ftdenseerrs.h"
 
   /**************************************************************************
@@ -90,6 +90,7 @@
                    FT_Render_Mode   mode,
                    const FT_Vector* origin )
   {
+    printf("%d %d %d %d \n", slot->prelines->x1, slot->prelines->x2, 
slot->prelines->y1, slot->prelines->y2);
     FT_Error    error   = FT_Err_Ok;
     FT_Outline* outline = &slot->outline;
     FT_Bitmap*  bitmap  = &slot->bitmap;



reply via email to

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