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 // Original code is licensed as follows: | 6 // Original code is licensed as follows: |
7 /* | 7 /* |
8 * Copyright 2009 ZXing authors | 8 * Copyright 2009 ZXing authors |
9 * | 9 * |
10 * Licensed under the Apache License, Version 2.0 (the "License"); | 10 * Licensed under the Apache License, Version 2.0 (the "License"); |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 int32_t iFontSize = (int32_t)fabs(m_fFontSize); | 191 int32_t iFontSize = (int32_t)fabs(m_fFontSize); |
192 int32_t iTextHeight = iFontSize + 1; | 192 int32_t iTextHeight = iFontSize + 1; |
193 if (!pOutBitmap) { | 193 if (!pOutBitmap) { |
194 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); | 194 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); |
195 CFX_FloatRect rect( | 195 CFX_FloatRect rect( |
196 (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), | 196 (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), |
197 (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); | 197 (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); |
198 matr.Concat(*matrix); | 198 matr.Concat(*matrix); |
199 matr.TransformRect(rect); | 199 matr.TransformRect(rect); |
200 FX_RECT re = rect.GetOutterRect(); | 200 FX_RECT re = rect.GetOuterRect(); |
201 device->FillRect(&re, m_backgroundColor); | 201 device->FillRect(&re, m_backgroundColor); |
202 CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); | 202 CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); |
203 CFX_FloatRect rect1( | 203 CFX_FloatRect rect1( |
204 (FX_FLOAT)(leftPosition + 33 * multiple), | 204 (FX_FLOAT)(leftPosition + 33 * multiple), |
205 (FX_FLOAT)(m_Height - iTextHeight), | 205 (FX_FLOAT)(m_Height - iTextHeight), |
206 (FX_FLOAT)(leftPosition + 33 * multiple + strWidth - 0.5), | 206 (FX_FLOAT)(leftPosition + 33 * multiple + strWidth - 0.5), |
207 (FX_FLOAT)m_Height); | 207 (FX_FLOAT)m_Height); |
208 matr1.Concat(*matrix); | 208 matr1.Concat(*matrix); |
209 matr1.TransformRect(rect1); | 209 matr1.TransformRect(rect1); |
210 re = rect1.GetOutterRect(); | 210 re = rect1.GetOuterRect(); |
211 device->FillRect(&re, m_backgroundColor); | 211 device->FillRect(&re, m_backgroundColor); |
212 } | 212 } |
213 if (!pOutBitmap) | 213 if (!pOutBitmap) |
214 strWidth = (int32_t)(strWidth * m_outputHScale); | 214 strWidth = (int32_t)(strWidth * m_outputHScale); |
215 | 215 |
216 CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, | 216 CalcTextInfo(tempStr, pCharPos, m_pFont, (FX_FLOAT)strWidth, iFontSize, |
217 blank); | 217 blank); |
218 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); | 218 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); |
219 CFX_FxgeDevice ge; | 219 CFX_FxgeDevice ge; |
220 if (pOutBitmap) { | 220 if (pOutBitmap) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 FX_Free(pCharPos); | 262 FX_Free(pCharPos); |
263 } | 263 } |
264 | 264 |
265 void CBC_OnedEAN8Writer::RenderResult(const CFX_WideStringC& contents, | 265 void CBC_OnedEAN8Writer::RenderResult(const CFX_WideStringC& contents, |
266 uint8_t* code, | 266 uint8_t* code, |
267 int32_t codeLength, | 267 int32_t codeLength, |
268 FX_BOOL isDevice, | 268 FX_BOOL isDevice, |
269 int32_t& e) { | 269 int32_t& e) { |
270 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); | 270 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); |
271 } | 271 } |
OLD | NEW |