Skip to content

Commit 1c4587d

Browse files
Merge pull request livecode#7201 from livecodeian/feature-android-revpdfprinter
[[ RevPDFPrinter ]] Add Android support to revpdfprinter library
2 parents 6879e94 + 769025b commit 1c4587d

12 files changed

Lines changed: 619 additions & 9 deletions

docs/dictionary/command/open-printing-to-pdf.lcdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ currently configured printer.
1010

1111
Introduced: 4.5
1212

13-
OS: mac, windows, linux, ios
13+
OS: mac, windows, linux, ios, android
1414

1515
Platforms: desktop, mobile
1616

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Print to PDF on Android
2+
3+
The `open printing to pdf ...` command can now be used to direct printing to a
4+
PDF output file on Android devices.

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)