Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit e783e22

Browse files
committed
[[ TextLayout ]] Implement TextLayout functions on Android
This patch adds an implementation of MCTextLayout on Android, based on harfbuzz using the FreeType face handle obtained from the system font handle (a Skia SkTypeface object)
1 parent c7293b2 commit e783e22

File tree

3 files changed

+410
-3
lines changed

3 files changed

+410
-3
lines changed

engine/kernel.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@
8181
[
8282
'../prebuilt/thirdparty.gyp:thirdparty_prebuilt_skia',
8383
'../prebuilt/thirdparty.gyp:thirdparty_prebuilt_freetype',
84+
'../prebuilt/thirdparty.gyp:thirdparty_prebuilt_harfbuzz',
8485
],
8586

8687
'link_settings':

engine/src/customprinter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,9 @@ static bool dotextmark_callback(void *p_context, const MCTextLayoutSpan *p_span)
10731073
extern int32_t MCCustomPrinterComputeFontSize(void *font);
10741074
t_font_size = MCCustomPrinterComputeFontSize(p_span -> font);
10751075
t_font_handle = p_span -> font;
1076+
#elif defined(ANDROID)
1077+
t_font_size = context->font_size;
1078+
t_font_handle = p_span->font;
10761079
#else
10771080
// Neither servers nor Android have an implementation
10781081
t_font_size = 0;
@@ -1129,6 +1132,8 @@ void MCCustomMetaContext::dotextmark(MCMark *p_mark)
11291132
uint2 t_size, t_style;
11301133
MCFontlistGetCurrent() -> getfontreqs(f, t_name, t_size, t_style);
11311134
t_state . font_size = t_size;
1135+
#elif defined(ANDROID)
1136+
t_state . font_size = f -> size;
11321137
#endif
11331138

11341139
compute_clip(p_mark -> clip, t_state . clip);

0 commit comments

Comments
 (0)