This repository was archived by the owner on Aug 31, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +53
-2
lines changed Expand file tree Collapse file tree 5 files changed +53
-2
lines changed Original file line number Diff line number Diff line change 460460 'conditions' :
461461 [
462462 [
463- # Not supported on Android
464- 'OS == "android" or OS == " emscripten"' ,
463+ # Not supported on Emscripten
464+ 'OS == "emscripten"' ,
465465 {
466466 'type' : 'none' ,
467467 },
468468 ],
469+ [
470+ 'OS == "android"' ,
471+ {
472+ 'dependencies' :
473+ [
474+ '../libfreetype/libfreetype.gyp:libfreetype' ,
475+ ],
476+ # Use the FreeType support on Android
477+ 'sources/' :
478+ [
479+ ['include' , '^src/cairo-ft.*\\ .c$' ],
480+ ],
481+ },
482+ ],
469483 [
470484 # Re-add the OSX- and iOS-specific support
471485 'OS == "mac" or OS == "ios"' ,
Original file line number Diff line number Diff line change 4141#define CAIRO_HAS_FC_FONT 1
4242#endif
4343
44+ #ifdef TARGET_SUBPLATFORM_ANDROID
45+ #define CAIRO_NO_MUTEX 1
46+ #define HAVE_STDINT_H 1
47+ #define CAIRO_HAS_FT_FONT 1
48+ #endif
49+
4450#endif
Original file line number Diff line number Diff line change 2020 'dependencies' :
2121 [
2222 '../../prebuilt/libicu.gyp:libicu_include' ,
23+ '../libfreetype/libfreetype.gyp:libfreetype' ,
2324 ],
2425
2526 'defines' :
4546 'src/hb-fallback-shape.cc' ,
4647 'src/hb-face.cc' ,
4748 'src/hb-font.cc' ,
49+ 'src/hb-ft.cc' ,
4850 'src/hb-icu.cc' ,
4951 'src/hb-ot-layout.cc' ,
5052 'src/hb-ot-map.cc' ,
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