diff options
Diffstat (limited to 'external/pdfium/0009-svx-support-color-text-for-imported-PDFs.patch.2')
-rw-r--r-- | external/pdfium/0009-svx-support-color-text-for-imported-PDFs.patch.2 | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/external/pdfium/0009-svx-support-color-text-for-imported-PDFs.patch.2 b/external/pdfium/0009-svx-support-color-text-for-imported-PDFs.patch.2 deleted file mode 100644 index c141cc4b58ea..000000000000 --- a/external/pdfium/0009-svx-support-color-text-for-imported-PDFs.patch.2 +++ /dev/null @@ -1,100 +0,0 @@ -From 32ec9efddb8e1706085478fd8434dd2860840345 Mon Sep 17 00:00:00 2001 -From: Ashod Nakashian <ashod.nakashian@collabora.co.uk> -Date: Tue, 5 Jun 2018 11:33:56 +0200 -Subject: [PATCH 09/14] svx: support color text for imported PDFs - ---- - pdfium/core/fpdfapi/page/cpdf_imageobject.cpp | 2 +- - pdfium/core/fxge/cfx_pathdata.cpp | 4 +-- - pdfium/fpdfsdk/fpdf_editpage.cpp | 47 ++++++++++++++++++++++----- - pdfium/public/fpdf_edit.h | 10 +++--- - 4 files changed, 46 insertions(+), 17 deletions(-) - -diff --git a/pdfium/fpdfsdk/fpdf_editpage.cpp b/pdfium/fpdfsdk/fpdf_editpage.cpp -index 2249e8e..9c353a4 100644 ---- a/pdfium/fpdfsdk/fpdf_editpage.cpp -+++ b/pdfium/fpdfsdk/fpdf_editpage.cpp -@@ -733,21 +733,50 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object, - } - - FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV --FPDFTextObj_GetStrokeColor(FPDF_PAGEOBJECT text_object, -- unsigned int* R, -- unsigned int* G, -- unsigned int* B, -- unsigned int* A) -+FPDFTextObj_GetColor(FPDF_PAGEOBJECT text_object, -+ unsigned int* R, -+ unsigned int* G, -+ unsigned int* B, -+ unsigned int* A) - { - CPDF_TextObject* pTxtObj = CPDFTextObjectFromFPDFPageObject(text_object); - if (!pTxtObj || !R || !G || !B || !A) - return false; - -- const uint32_t strokeRGB = pTxtObj->m_ColorState.GetStrokeRGB(); -- *R = FXSYS_GetRValue(strokeRGB); -- *G = FXSYS_GetGValue(strokeRGB); -- *B = FXSYS_GetBValue(strokeRGB); -+ bool bFill = false; -+ bool bStroke = false; -+ CPDF_Font* pFont = pTxtObj->m_TextState.GetFont(); -+ const TextRenderingMode text_render_mode = pTxtObj->m_TextState.GetTextMode(); -+ switch (text_render_mode) -+ { -+ case TextRenderingMode::MODE_FILL: -+ case TextRenderingMode::MODE_FILL_CLIP: -+ bFill = true; -+ break; -+ case TextRenderingMode::MODE_STROKE: -+ case TextRenderingMode::MODE_STROKE_CLIP: -+ if (pFont->GetFace()) -+ bStroke = true; -+ else -+ bFill = true; -+ break; -+ case TextRenderingMode::MODE_FILL_STROKE: -+ case TextRenderingMode::MODE_FILL_STROKE_CLIP: -+ bFill = true; -+ if (pFont->GetFace()) -+ bStroke = true; -+ break; -+ case TextRenderingMode::MODE_INVISIBLE: -+ case TextRenderingMode::MODE_CLIP: -+ return false; -+ } -+ -+ const uint32_t RGB = bStroke ? pTxtObj->m_ColorState.GetStrokeRGB() : pTxtObj->m_ColorState.GetFillRGB(); -+ *R = FXSYS_GetRValue(RGB); -+ *G = FXSYS_GetGValue(RGB); -+ *B = FXSYS_GetBValue(RGB); - *A = static_cast<unsigned int>( - (pTxtObj->m_GeneralState.GetStrokeAlpha() * 255.f) + 0.5f); -+ - return true; - } -diff --git a/pdfium/public/fpdf_edit.h b/pdfium/public/fpdf_edit.h -index fc906f4..4264ccd 100644 ---- a/pdfium/public/fpdf_edit.h -+++ b/pdfium/public/fpdf_edit.h -@@ -1075,11 +1075,11 @@ FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object, - // - // Returns TRUE on success. - FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV --FPDFTextObj_GetStrokeColor(FPDF_PAGEOBJECT text_object, -- unsigned int* R, -- unsigned int* G, -- unsigned int* B, -- unsigned int* A); -+FPDFTextObj_GetColor(FPDF_PAGEOBJECT text_object, -+ unsigned int* R, -+ unsigned int* G, -+ unsigned int* B, -+ unsigned int* A); - - #ifdef __cplusplus - } // extern "C" --- -2.16.3 - |