[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] gsoc-anurag-2023-final 8d89a20a0 13/16: [dense] Implement FT
From: |
Werner Lemberg |
Subject: |
[freetype2] gsoc-anurag-2023-final 8d89a20a0 13/16: [dense] Implement FT_New_Face2 and fix glyph loading |
Date: |
Mon, 9 Oct 2023 17:36:39 -0400 (EDT) |
branch: gsoc-anurag-2023-final
commit 8d89a20a030a6a91da5abdab5b486fa7bf212515
Author: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
Commit: Anurag Thakur <anurag105csec21@bpitindia.edu.in>
[dense] Implement FT_New_Face2 and fix glyph loading
---
include/freetype/freetype.h | 5 +++++
src/base/ftobjs.c | 23 ++++++++++++++++++++++-
2 files changed, 27 insertions(+), 1 deletion(-)
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 3f9769976..2079ae663 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -2534,6 +2534,10 @@ FT_BEGIN_HEADER
* params ::
* Extra parameters passed to the font driver when opening a new face.
*
+ * size ::
+ * Size at which the glyphs will be rendered. Use same value as
+ * @FT_Set_Pixel_Sizes
+ *
* @note:
* The stream type is determined by the contents of `flags`:
*
@@ -2571,6 +2575,7 @@ FT_BEGIN_HEADER
FT_Module driver;
FT_Int num_params;
FT_Parameter* params;
+ FT_UInt size;
} FT_Open_Args;
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 430902a10..01e4dc81b 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -928,7 +928,7 @@
/* The validity test for `glyph_index' is performed by the */
/* font drivers. */
- slot = face->glyph;
+ slot = face->glyph_array[glyph_index];
ft_glyphslot_clear( slot );
driver = face->driver;
@@ -1636,6 +1636,27 @@
return ft_open_face_internal( library, &args, face_index, aface, 1 );
}
+ FT_EXPORT_DEF( FT_Error )
+ FT_New_Face2( FT_Library library,
+ const char* pathname,
+ FT_Long face_index,
+ FT_Face *aface,
+ FT_UInt size)
+ {
+ FT_Open_Args args;
+
+ /* test for valid `library' and `aface' delayed to `FT_Open_Face' */
+ if ( !pathname )
+ return FT_THROW( Invalid_Argument );
+
+ args.flags = FT_OPEN_PATHNAME;
+ args.size = size;
+ args.pathname = (char*)pathname;
+ args.stream = NULL;
+
+ return ft_open_face_internal( library, &args, face_index, aface, 1 );
+ }
+
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] gsoc-anurag-2023-final 8d89a20a0 13/16: [dense] Implement FT_New_Face2 and fix glyph loading,
Werner Lemberg <=