freetype-commit
[Top][All Lists]
Advanced

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

[freetype2] gsoc-anurag-2023-final 45de1dba7 04/11: [dense] Declare FT_N


From: Werner Lemberg
Subject: [freetype2] gsoc-anurag-2023-final 45de1dba7 04/11: [dense] Declare FT_New_Face2
Date: Mon, 9 Oct 2023 18:16:49 -0400 (EDT)

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

    [dense] Declare FT_New_Face2
    
    * include/freetype/freetype.h: Add FT_New_Face2 function to be used
    for preloading optimization
---
 include/freetype/freetype.h | 48 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 4a074a444..6200cc724 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -2573,6 +2573,54 @@ FT_BEGIN_HEADER
                FT_Face     *aface );
 
 
+/**************************************************************************
+   *
+   * @function:
+   *   FT_New_Face2
+   *
+   * @description:
+   *   Call @FT_Open_Face to open a font by its pathname with given flags.
+   *
+   * @inout:
+   *   library ::
+   *     A handle to the library resource.
+   *
+   * @input:
+   *   pathname ::
+   *     A path to the font file.
+   *
+   *   face_index ::
+   *     See @FT_Open_Face for a detailed description of this parameter.
+   *
+   *   size ::
+   *     Size at which glyphs will be rendered, Use the same value as 
@FT_Set_Pixel_Sizes
+   *
+   * @output:
+   *   aface ::
+   *     A handle to a new face object.  If `face_index` is greater than or
+   *     equal to zero, it must be non-`NULL`.
+   *
+   * @return:
+   *   FreeType error code.  0~means success.
+   *
+   * @note:
+   *   The `pathname` string should be recognizable as such by a standard
+   *   `fopen` call on your system; in particular, this means that `pathname`
+   *   must not contain null bytes.  If that is not sufficient to address all
+   *   file name possibilities (for example, to handle wide character file
+   *   names on Windows in UTF-16 encoding) you might use @FT_Open_Face to
+   *   pass a memory array or a stream object instead.
+   *
+   *   Use @FT_Done_Face to destroy the created @FT_Face object (along with
+   *   its slot and sizes).
+   */
+  FT_EXPORT( FT_Error )
+  FT_New_Face2( FT_Library   library,
+               const char*  filepathname,
+               FT_Long      face_index,
+               FT_Face     *aface,
+               FT_UInt      size);
+
   /**************************************************************************
    *
    * @function:



reply via email to

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