OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "core/fpdfapi/fpdf_render/render_int.h" | 7 #include "core/fpdfapi/fpdf_render/render_int.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 device_matrix.Concat(*pObj2Device); | 301 device_matrix.Concat(*pObj2Device); |
302 pDeviceMatrix = &device_matrix; | 302 pDeviceMatrix = &device_matrix; |
303 } | 303 } |
304 } | 304 } |
305 int flag = 0; | 305 int flag = 0; |
306 if (bStroke && bFill) { | 306 if (bStroke && bFill) { |
307 flag |= FX_FILL_STROKE; | 307 flag |= FX_FILL_STROKE; |
308 flag |= FX_STROKE_TEXT_MODE; | 308 flag |= FX_STROKE_TEXT_MODE; |
309 } | 309 } |
310 const CPDF_GeneralStateData* pGeneralData = | 310 const CPDF_GeneralStateData* pGeneralData = |
311 ((CPDF_PageObject*)textobj)->m_GeneralState; | 311 static_cast<const CPDF_PageObject*>(textobj) |
| 312 ->m_GeneralState.GetObject(); |
312 if (pGeneralData && pGeneralData->m_StrokeAdjust) { | 313 if (pGeneralData && pGeneralData->m_StrokeAdjust) { |
313 flag |= FX_STROKE_ADJUST; | 314 flag |= FX_STROKE_ADJUST; |
314 } | 315 } |
315 if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) { | 316 if (m_Options.m_Flags & RENDER_NOTEXTSMOOTH) { |
316 flag |= FXFILL_NOPATHSMOOTH; | 317 flag |= FXFILL_NOPATHSMOOTH; |
317 } | 318 } |
318 return CPDF_TextRenderer::DrawTextPath( | 319 return CPDF_TextRenderer::DrawTextPath( |
319 m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, | 320 m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, |
320 textobj->m_pCharPos, pFont, font_size, &text_matrix, pDeviceMatrix, | 321 textobj->m_pCharPos, pFont, font_size, &text_matrix, pDeviceMatrix, |
321 textobj->m_GraphState, fill_argb, stroke_argb, pClippingPath, flag); | 322 textobj->m_GraphState.GetObject(), fill_argb, stroke_argb, |
| 323 pClippingPath, flag); |
322 } | 324 } |
323 text_matrix.Concat(*pObj2Device); | 325 text_matrix.Concat(*pObj2Device); |
324 return CPDF_TextRenderer::DrawNormalText( | 326 return CPDF_TextRenderer::DrawNormalText( |
325 m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, | 327 m_pDevice, textobj->m_nChars, textobj->m_pCharCodes, textobj->m_pCharPos, |
326 pFont, font_size, &text_matrix, fill_argb, &m_Options); | 328 pFont, font_size, &text_matrix, fill_argb, &m_Options); |
327 } | 329 } |
328 | 330 |
329 CPDF_Type3Cache* CPDF_RenderStatus::GetCachedType3(CPDF_Type3Font* pFont) { | 331 CPDF_Type3Cache* CPDF_RenderStatus::GetCachedType3(CPDF_Type3Font* pFont) { |
330 if (!pFont->m_pDocument) { | 332 if (!pFont->m_pDocument) { |
331 return nullptr; | 333 return nullptr; |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, | 779 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, |
778 charpos.m_OriginY); | 780 charpos.m_OriginY); |
779 path.m_Path.New()->Append(pPath, &matrix); | 781 path.m_Path.New()->Append(pPath, &matrix); |
780 path.m_Matrix = *pTextMatrix; | 782 path.m_Matrix = *pTextMatrix; |
781 path.m_bStroke = bStroke; | 783 path.m_bStroke = bStroke; |
782 path.m_FillType = bFill ? FXFILL_WINDING : 0; | 784 path.m_FillType = bFill ? FXFILL_WINDING : 0; |
783 path.CalcBoundingBox(); | 785 path.CalcBoundingBox(); |
784 ProcessPath(&path, pObj2Device); | 786 ProcessPath(&path, pObj2Device); |
785 } | 787 } |
786 } | 788 } |
OLD | NEW |