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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 pGlyph->m_Bitmap.TakeOver(pResBitmap.get()); | 224 pGlyph->m_Bitmap.TakeOver(pResBitmap.get()); |
225 return pGlyph; | 225 return pGlyph; |
226 } | 226 } |
227 | 227 |
228 FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, | 228 FX_BOOL CPDF_RenderStatus::ProcessText(const CPDF_TextObject* textobj, |
229 const CFX_Matrix* pObj2Device, | 229 const CFX_Matrix* pObj2Device, |
230 CFX_PathData* pClippingPath) { | 230 CFX_PathData* pClippingPath) { |
231 if (textobj->m_nChars == 0) | 231 if (textobj->m_nChars == 0) |
232 return TRUE; | 232 return TRUE; |
233 | 233 |
234 const TextRenderingMode& text_render_mode = textobj->m_TextState->m_TextMode; | 234 const TextRenderingMode& text_render_mode = |
| 235 textobj->m_TextState.GetObject()->m_TextMode; |
235 if (text_render_mode == TextRenderingMode::MODE_INVISIBLE) | 236 if (text_render_mode == TextRenderingMode::MODE_INVISIBLE) |
236 return TRUE; | 237 return TRUE; |
237 | 238 |
238 CPDF_Font* pFont = textobj->m_TextState.GetFont(); | 239 CPDF_Font* pFont = textobj->m_TextState.GetFont(); |
239 if (pFont->IsType3Font()) | 240 if (pFont->IsType3Font()) |
240 return ProcessType3Text(textobj, pObj2Device); | 241 return ProcessType3Text(textobj, pObj2Device); |
241 | 242 |
242 bool bFill = false; | 243 bool bFill = false; |
243 bool bStroke = false; | 244 bool bStroke = false; |
244 bool bClip = false; | 245 bool bClip = false; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 FX_FLOAT font_size = textobj->m_TextState.GetFontSize(); | 301 FX_FLOAT font_size = textobj->m_TextState.GetFontSize(); |
301 if (bPattern) { | 302 if (bPattern) { |
302 DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, | 303 DrawTextPathWithPattern(textobj, pObj2Device, pFont, font_size, |
303 &text_matrix, bFill, bStroke); | 304 &text_matrix, bFill, bStroke); |
304 return TRUE; | 305 return TRUE; |
305 } | 306 } |
306 if (bClip || bStroke) { | 307 if (bClip || bStroke) { |
307 const CFX_Matrix* pDeviceMatrix = pObj2Device; | 308 const CFX_Matrix* pDeviceMatrix = pObj2Device; |
308 CFX_Matrix device_matrix; | 309 CFX_Matrix device_matrix; |
309 if (bStroke) { | 310 if (bStroke) { |
310 const FX_FLOAT* pCTM = textobj->m_TextState->m_CTM; | 311 const FX_FLOAT* pCTM = textobj->m_TextState.GetObject()->m_CTM; |
311 if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) { | 312 if (pCTM[0] != 1.0f || pCTM[3] != 1.0f) { |
312 CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0); | 313 CFX_Matrix ctm(pCTM[0], pCTM[1], pCTM[2], pCTM[3], 0, 0); |
313 text_matrix.ConcatInverse(ctm); | 314 text_matrix.ConcatInverse(ctm); |
314 device_matrix.Copy(ctm); | 315 device_matrix.Copy(ctm); |
315 device_matrix.Concat(*pObj2Device); | 316 device_matrix.Concat(*pObj2Device); |
316 pDeviceMatrix = &device_matrix; | 317 pDeviceMatrix = &device_matrix; |
317 } | 318 } |
318 } | 319 } |
319 int flag = 0; | 320 int flag = 0; |
320 if (bStroke && bFill) { | 321 if (bStroke && bFill) { |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, | 865 matrix.Concat(font_size, 0, 0, font_size, charpos.m_OriginX, |
865 charpos.m_OriginY); | 866 charpos.m_OriginY); |
866 path.m_Path.New()->Append(pPath, &matrix); | 867 path.m_Path.New()->Append(pPath, &matrix); |
867 path.m_Matrix = *pTextMatrix; | 868 path.m_Matrix = *pTextMatrix; |
868 path.m_bStroke = bStroke; | 869 path.m_bStroke = bStroke; |
869 path.m_FillType = bFill ? FXFILL_WINDING : 0; | 870 path.m_FillType = bFill ? FXFILL_WINDING : 0; |
870 path.CalcBoundingBox(); | 871 path.CalcBoundingBox(); |
871 ProcessPath(&path, pObj2Device); | 872 ProcessPath(&path, pObj2Device); |
872 } | 873 } |
873 } | 874 } |
OLD | NEW |