From be90aaea3977eadeee589cdda66c61d06d6535b0 Mon Sep 17 00:00:00 2001 From: Nicolas Pena Date: Mon, 27 Feb 2017 10:41:41 -0500 Subject: Add public API for creating a Type1 font MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Given a stream of data, we create a type1 font and fill up the required dictionary entries according to PDF spec 1.7. Table 5.8 describes Type 1 font dictionaries, and Table 5.19 describes font descriptors. BUG=pdfium:667 Change-Id: I571b09fb533467d77ed0104e613726387aec1f87 Reviewed-on: https://pdfium-review.googlesource.com/2835 Reviewed-by: dsinclair Commit-Queue: Nicolás Peña --- public/fpdf_edit.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'public') diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h index c8d7a44c8e..3350b5c6a7 100644 --- a/public/fpdf_edit.h +++ b/public/fpdf_edit.h @@ -406,6 +406,18 @@ 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 +// 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. +// +// Returns NULL on failure +DLLEXPORT FPDF_FONT STDCALL FPDFText_LoadType1Font(FPDF_DOCUMENT document, + const uint8_t* data, + uint32_t size); + #ifdef __cplusplus } // extern "C" #endif // __cplusplus -- cgit v1.2.3