summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedittext.cpp
diff options
context:
space:
mode:
authorNicolás Peña <npm@chromium.org>2017-09-28 13:29:05 +0900
committerChromium commit bot <commit-bot@chromium.org>2017-09-28 16:19:00 +0000
commit79eab23d8f83aec7088c59f8bcee65994c6662a0 (patch)
tree50c96fdad3fc09f993f5217e7f34369ae322f966 /fpdfsdk/fpdfedittext.cpp
parent0e60b9ef2b79de52ef62101abae2af7292e879b7 (diff)
downloadpdfium-79eab23d8f83aec7088c59f8bcee65994c6662a0.tar.xz
Add Length1 in TrueType font streams
Bug: pdfium:892 Change-Id: Ica0377515589a96a8919cb8ed2a3da1d1c9f6191 Reviewed-on: https://pdfium-review.googlesource.com/15030 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfedittext.cpp')
-rw-r--r--fpdfsdk/fpdfedittext.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfedittext.cpp b/fpdfsdk/fpdfedittext.cpp
index bac1108243..22c6266ec1 100644
--- a/fpdfsdk/fpdfedittext.cpp
+++ b/fpdfsdk/fpdfedittext.cpp
@@ -71,6 +71,11 @@ CPDF_Dictionary* LoadFontDesc(CPDF_Document* pDoc,
CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>();
pStream->SetData(data, size);
+ // TODO(npm): Lengths for Type1 fonts.
+ if (font_type == FPDF_FONT_TRUETYPE) {
+ pStream->GetDict()->SetNewFor<CPDF_Number>("Length1",
+ static_cast<int>(size));
+ }
ByteString fontFile = font_type == FPDF_FONT_TYPE1 ? "FontFile" : "FontFile2";
fontDesc->SetNewFor<CPDF_Reference>(fontFile, pDoc, pStream->GetObjNum());
return fontDesc;