summaryrefslogtreecommitdiff
path: root/public/fpdf_edit.h
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-03-06 13:54:33 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-03-06 21:02:43 +0000
commitd03ca4214e6db7123e1c2d0ea58e34f7cf67a568 (patch)
tree2f34c4d09095faddbb0e9951757bbadf6f2635f6 /public/fpdf_edit.h
parentf6d0146200beec76f3d8676e22562d1acbc83d91 (diff)
downloadpdfium-d03ca4214e6db7123e1c2d0ea58e34f7cf67a568.tar.xz
Add public method FPDFText_LoadFont to load some types of fonts.
The new method replaces the previous one for loading only type1 fonts. This will create the font dictionary with the very basics needed, according to the tables in chapter 5 of the PDF spec. The tests for now are only checking that the information is getting passed on properly. Followup: adding text with those fonts, generating the contents (doing that will allow testing whether the parts that I've skipped like Encoding and cmaps are needed or not). BUG=pdfium:667 Change-Id: Id1a61501e09542804a391552fd002f2caed41939 Reviewed-on: https://pdfium-review.googlesource.com/2915 Commit-Queue: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'public/fpdf_edit.h')
-rw-r--r--public/fpdf_edit.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index 3350b5c6a7..423229ab33 100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -30,6 +30,9 @@
#define FPDF_FILLMODE_ALTERNATE 1
#define FPDF_FILLMODE_WINDING 2
+#define FPDF_FONT_TYPE1 1
+#define FPDF_FONT_TRUETYPE 2
+
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
@@ -406,17 +409,22 @@ DLLEXPORT FPDF_PAGEOBJECT STDCALL FPDFPageObj_NewTextObj(FPDF_DOCUMENT document,
DLLEXPORT FPDF_BOOL STDCALL FPDFText_SetText(FPDF_PAGEOBJECT text_object,
FPDF_BYTESTRING text);
-// Returns a type 1 font object loaded from a stream of data. The font is loaded
+// Returns a font object loaded from a stream of data. The font is loaded
// into the document. The caller does not need to free the returned object.
//
-// document - handle to the document.
-// data - the stream of data, which will be copied by the font object.
-// size - size of the stream, in bytes.
+// document - handle to the document.
+// data - the stream of data, which will be copied by the font object.
+// size - size of the stream, in bytes.
+// font_type - FPDF_FONT_TYPE1 or FPDF_FONT_TRUETYPE depending on the font
+// type.
+// cid - a boolean specifying if the font is a CID font or not.
//
// Returns NULL on failure
-DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadType1Font(FPDF_DOCUMENT document,
- const uint8_t* data,
- uint32_t size);
+DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadFont(FPDF_DOCUMENT document,
+ const uint8_t* data,
+ uint32_t size,
+ int font_type,
+ FPDF_BOOL cid);
#ifdef __cplusplus
} // extern "C"