summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_edittext.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2018-06-13 18:23:46 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-13 18:23:46 +0000
commit4c48b107c6d1e3d3029910062368d8d954e8f28a (patch)
tree18d0c3c14cab579431dd6cd765ad0e405527f0e8 /fpdfsdk/fpdf_edittext.cpp
parentfb6b382bea56ca22bacce1379230680d17cf5896 (diff)
downloadpdfium-4c48b107c6d1e3d3029910062368d8d954e8f28a.tar.xz
Add FPDFText_LoadStandardFont to public API
Bug: pdfium:978 Change-Id: I0dcffdfd1b19b83e5234da7791cb3f3e52cc257b Reviewed-on: https://pdfium-review.googlesource.com/35110 Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_edittext.cpp')
-rw-r--r--fpdfsdk/fpdf_edittext.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_edittext.cpp b/fpdfsdk/fpdf_edittext.cpp
index 2ead789204..8186d8d894 100644
--- a/fpdfsdk/fpdf_edittext.cpp
+++ b/fpdfsdk/fpdf_edittext.cpp
@@ -462,6 +462,16 @@ FPDF_EXPORT FPDF_FONT FPDF_CALLCONV FPDFText_LoadFont(FPDF_DOCUMENT document,
: LoadSimpleFont(pDoc, std::move(pFont), data, size, font_type));
}
+FPDF_EXPORT FPDF_FONT FPDF_CALLCONV
+FPDFText_LoadStandardFont(FPDF_DOCUMENT document, FPDF_BYTESTRING font) {
+ CPDF_Document* pDoc = CPDFDocumentFromFPDFDocument(document);
+ if (!pDoc)
+ return nullptr;
+
+ return FPDFFontFromCPDFFont(
+ CPDF_Font::GetStockFont(pDoc, ByteStringView(font)));
+}
+
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFText_SetFillColor(FPDF_PAGEOBJECT text_object,
unsigned int R,