This repository was archived by the owner on Aug 31, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #ifndef SkTypeface_FreeType_DEFINED
2+ #define SkTypeface_FreeType_DEFINED
3+
4+ #include "SkTypeface.h"
5+
6+ #include <ft2build.h>
7+ #include FT_FREETYPE_H
8+
9+ /**
10+ * Obtain access to the underlying FT_Face of a SkTypeface.
11+ * The FT_Face should be released with FT_Done_Face once finished.
12+ **/
13+ SK_API extern FT_Face SkTypeface_GetFTFace (const SkTypeface * face );
14+
15+ #endif // SkTypeface_FreeType_DEFINED
Original file line number Diff line number Diff line change @@ -418,6 +418,20 @@ class AutoFTAccess {
418418
419419// /////////////////////////////////////////////////////////////////////////
420420
421+ extern FT_Face SkTypeface_GetFTFace (const SkTypeface* face);
422+ FT_Face SkTypeface_GetFTFace (const SkTypeface* face)
423+ {
424+ FT_Face t_face;
425+ gFTMutex .acquire ();
426+ t_face = ref_ft_face (face);
427+ FT_Reference_Face (t_face);
428+ unref_ft_face (t_face);
429+ gFTMutex .release ();
430+ return t_face;
431+ }
432+
433+ // /////////////////////////////////////////////////////////////////////////
434+
421435static bool canEmbed (FT_Face face) {
422436 FT_UShort fsType = FT_Get_FSType_Flags (face);
423437 return (fsType & (FT_FSTYPE_RESTRICTED_LICENSE_EMBEDDING |
You can’t perform that action at this time.
0 commit comments