freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] gsoc-anurag-2023-final e183ffb93 11/16: [dense] Add FT_Refre


From: Werner Lemberg
Subject: [freetype2] gsoc-anurag-2023-final e183ffb93 11/16: [dense] Add FT_Refresh_Glyph
Date: Mon, 9 Oct 2023 17:36:38 -0400 (EDT)

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

    [dense] Add FT_Refresh_Glyph
---
 include/freetype/freetype.h | 25 +++++++++++++++++++++++++
 src/base/ftobjs.c           |  8 ++++++++
 2 files changed, 33 insertions(+)

diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 9ab407296..3f9769976 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -3323,6 +3323,31 @@ FT_BEGIN_HEADER
                  FT_UInt   glyph_index,
                  FT_Int32  load_flags );
 
+  /**************************************************************************
+   *
+   * @function:
+   *   FT_Refresh_Glyph
+   *
+   * @description:
+   *   Prepare the glyph at glyph_index for rendering. Resets the glyph
+   *   if it has already been rendered
+   *
+   * @inout:
+   *   face ::
+   *     A handle to the target face object where the glyph is loaded.
+   *
+   * @input:
+   *   glyph_index ::
+   *     The index of the glyph in the font file.
+   *
+   * @return:
+   *   FreeType error code.  0~means success.
+   *
+   */
+  FT_EXPORT( FT_Error )
+  FT_Refresh_Glyph( FT_Face   face,
+                    FT_UInt   glyph_index);
+
 
   /**************************************************************************
    *
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 89a25bc73..148681f57 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -893,6 +893,14 @@
 
 
   /* documentation is in freetype.h */
+  FT_EXPORT_DEF( FT_Error )
+  FT_Refresh_Glyph( FT_Face   face,
+                 FT_UInt   glyph_index)
+
+  {
+    ft_glyphslot_free_bitmap( face->glyph_array[glyph_index] );
+    face->glyph_array[glyph_index]->format = FT_GLYPH_FORMAT_OUTLINE;
+  }
 
   FT_EXPORT_DEF( FT_Error )
   FT_Load_Glyph( FT_Face   face,



reply via email to

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