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 "../../../include/fxge/fx_ge.h" | 7 #include "../../../include/fxge/fx_ge.h" |
8 #include "../../../include/fxge/fx_freetype.h" | 8 #include "../../../include/fxge/fx_freetype.h" |
9 #include "../../../include/fxcodec/fx_codec.h" | 9 #include "../../../include/fxcodec/fx_codec.h" |
10 #include "text_int.h" | 10 #include "text_int.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 } | 197 } |
198 } | 198 } |
199 } | 199 } |
200 if (pCache == NULL) { | 200 if (pCache == NULL) { |
201 pCache = CFX_GEModule::Get()->GetFontCache(); | 201 pCache = CFX_GEModule::Get()->GetFontCache(); |
202 } | 202 } |
203 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); | 203 CFX_FaceCache* pFaceCache = pCache->GetCachedFace(pFont); |
204 FX_FONTCACHE_DEFINE(pCache, pFont); | 204 FX_FONTCACHE_DEFINE(pCache, pFont); |
205 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars); | 205 FXTEXT_GLYPHPOS* pGlyphAndPos = FX_Alloc(FXTEXT_GLYPHPOS, nChars); |
206 if (!pGlyphAndPos) { | |
207 return FALSE; | |
208 } | |
209 int iChar; | 206 int iChar; |
210 deviceCtm = char2device; | 207 deviceCtm = char2device; |
211 CFX_AffineMatrix matrixCTM = GetCTM(); | 208 CFX_AffineMatrix matrixCTM = GetCTM(); |
212 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); | 209 FX_FLOAT scale_x = FXSYS_fabs(matrixCTM.a); |
213 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); | 210 FX_FLOAT scale_y = FXSYS_fabs(matrixCTM.d); |
214 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0); | 211 deviceCtm.Concat(scale_x, 0, 0, scale_y, 0, 0); |
215 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0); | 212 text2Device.Concat(scale_x, 0, 0, scale_y, 0, 0); |
216 for (iChar = 0; iChar < nChars; iChar ++) { | 213 for (iChar = 0; iChar < nChars; iChar ++) { |
217 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; | 214 FXTEXT_GLYPHPOS& glyph = pGlyphAndPos[iChar]; |
218 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; | 215 const FXTEXT_CHARPOS& charpos = pCharPos[iChar]; |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 { | 1672 { |
1676 va_list argList; | 1673 va_list argList; |
1677 va_start(argList, count); | 1674 va_start(argList, count); |
1678 for (int i = 0; i < count; i ++) { | 1675 for (int i = 0; i < count; i ++) { |
1679 int p = va_arg(argList, int); | 1676 int p = va_arg(argList, int); |
1680 ((FX_DWORD*)m_Key)[i] = p; | 1677 ((FX_DWORD*)m_Key)[i] = p; |
1681 } | 1678 } |
1682 va_end(argList); | 1679 va_end(argList); |
1683 m_KeyLen = count * sizeof(FX_DWORD); | 1680 m_KeyLen = count * sizeof(FX_DWORD); |
1684 } | 1681 } |
OLD | NEW |