summaryrefslogtreecommitdiff
path: root/external/pdfium/0015-svx-set-the-font-name-of-imported-PDF-text.patch.2
diff options
context:
space:
mode:
Diffstat (limited to 'external/pdfium/0015-svx-set-the-font-name-of-imported-PDF-text.patch.2')
-rw-r--r--external/pdfium/0015-svx-set-the-font-name-of-imported-PDF-text.patch.277
1 files changed, 0 insertions, 77 deletions
diff --git a/external/pdfium/0015-svx-set-the-font-name-of-imported-PDF-text.patch.2 b/external/pdfium/0015-svx-set-the-font-name-of-imported-PDF-text.patch.2
deleted file mode 100644
index 8eb0bac1eed2..000000000000
--- a/external/pdfium/0015-svx-set-the-font-name-of-imported-PDF-text.patch.2
+++ /dev/null
@@ -1,77 +0,0 @@
-From 04f9899ddf5f9691ffaca5091082183f167e95d3 Mon Sep 17 00:00:00 2001
-From: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
-Date: Wed, 6 Jun 2018 06:34:56 +0200
-Subject: [PATCH] svx: set the font name of imported PDF text
-
----
- pdfium/fpdfsdk/fpdf_editpage.cpp | 23 +++++++++++++++++++++++
- pdfium/public/fpdf_edit.h | 11 +++++++++++
- 2 files changed, 34 insertions(+)
-
-diff --git a/pdfium/fpdfsdk/fpdf_editpage.cpp b/pdfium/fpdfsdk/fpdf_editpage.cpp
-index a52e1a9..9daffc0 100644
---- a/pdfium/fpdfsdk/fpdf_editpage.cpp
-+++ b/pdfium/fpdfsdk/fpdf_editpage.cpp
-@@ -20,6 +20,7 @@
- #include "core/fpdfapi/page/cpdf_pageobject.h"
- #include "core/fpdfapi/page/cpdf_pathobject.h"
- #include "core/fpdfapi/page/cpdf_shadingobject.h"
-+#include "core/fpdfapi/page/cpdf_textobject.h"
- #include "core/fpdfapi/parser/cpdf_array.h"
- #include "core/fpdfapi/parser/cpdf_document.h"
- #include "core/fpdfapi/parser/cpdf_number.h"
-@@ -458,6 +459,29 @@ FPDFTextObj_GetFontSize(FPDF_PAGEOBJECT text_object)
- return pTxtObj->GetFontSize();
- }
-
-+FPDF_EXPORT int FPDF_CALLCONV
-+FPDFTextObj_GetFontName(FPDF_PAGEOBJECT text_object, char* result)
-+{
-+ if (!text_object)
-+ return 0;
-+
-+ CPDF_TextObject* pTxtObj = CPDFTextObjectFromFPDFPageObject(text_object);
-+ CPDF_Font* pPdfFont = pTxtObj->GetFont();
-+ if (!pPdfFont)
-+ return 0;
-+
-+ CFX_Font* pFont = pPdfFont->GetFont();
-+ if (!pFont)
-+ return 0;
-+
-+ ByteString byte_str = pFont->GetFamilyName();
-+ const size_t byte_str_len = byte_str.GetLength();
-+
-+ memcpy(result, byte_str.GetBuffer(byte_str_len).data(), byte_str_len);
-+ result[byte_str_len] = '\0';
-+ return byte_str_len;
-+}
-+
- FPDF_EXPORT void FPDF_CALLCONV
- FPDFPageObj_SetBlendMode(FPDF_PAGEOBJECT page_object,
- FPDF_BYTESTRING blend_mode) {
-diff --git a/pdfium/public/fpdf_edit.h b/pdfium/public/fpdf_edit.h
-index 4351649..f858ab2 100644
---- a/pdfium/public/fpdf_edit.h
-+++ b/pdfium/public/fpdf_edit.h
-@@ -1068,6 +1068,17 @@ FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document,
- FPDF_FONT font,
- float font_size);
-
-+// Get the font name of a text object.
-+//
-+// text_object - Handle of text object returned by FPDFPageObj_NewTextObj
-+// or FPDFPageObj_NewTextObjEx.
-+// result - The result in ascii.
-+//
-+// Return Value:
-+// The number of characters / bytes written in result.
-+FPDF_EXPORT int FPDF_CALLCONV
-+FPDFTextObj_GetFontName(FPDF_PAGEOBJECT text_object, char* result);
-+
- // Get the number of characters from a text object.
- //
- // text_object - Handle of text object returned by FPDFPageObj_NewTextObj
---
-2.16.3
-