| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 int32_t strWidth1 = multiple * 7; | 200 int32_t strWidth1 = multiple * 7; |
| 201 CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); | 201 CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); |
| 202 CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), | 202 CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), |
| 203 (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height); | 203 (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height); |
| 204 matr2.Concat(*matrix); | 204 matr2.Concat(*matrix); |
| 205 matr2.TransformRect(rect2); | 205 matr2.TransformRect(rect2); |
| 206 re = rect2.GetOutterRect(); | 206 re = rect2.GetOutterRect(); |
| 207 device->FillRect(&re, m_backgroundColor); | 207 device->FillRect(&re, m_backgroundColor); |
| 208 } | 208 } |
| 209 FX_FLOAT blank = 0.0; | 209 FX_FLOAT blank = 0.0; |
| 210 FX_FLOAT charsWidth = 0; | |
| 211 iLen = tempStr.GetLength(); | 210 iLen = tempStr.GetLength(); |
| 212 if (pOutBitmap == NULL) { | 211 if (pOutBitmap == NULL) { |
| 213 strWidth = (int32_t)(strWidth * m_outputHScale); | 212 strWidth = (int32_t)(strWidth * m_outputHScale); |
| 214 } | 213 } |
| 215 CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, | 214 CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, |
| 216 blank); | 215 blank); |
| 217 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); | 216 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); |
| 218 CFX_FxgeDevice ge; | 217 CFX_FxgeDevice ge; |
| 219 if (pOutBitmap) { | 218 if (pOutBitmap) { |
| 220 ge.Create(strWidth, iTextHeight, FXDIB_Argb); | 219 ge.Create(strWidth, iTextHeight, FXDIB_Argb); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 232 if (matrix) { | 231 if (matrix) { |
| 233 affine_matrix1.Concat(*matrix); | 232 affine_matrix1.Concat(*matrix); |
| 234 } | 233 } |
| 235 device->DrawNormalText(iLen, pCharPos + 1, m_pFont, | 234 device->DrawNormalText(iLen, pCharPos + 1, m_pFont, |
| 236 CFX_GEModule::Get()->GetFontCache(), | 235 CFX_GEModule::Get()->GetFontCache(), |
| 237 (FX_FLOAT)iFontSize, (CFX_Matrix*)&affine_matrix1, | 236 (FX_FLOAT)iFontSize, (CFX_Matrix*)&affine_matrix1, |
| 238 m_fontColor, FXTEXT_CLEARTYPE); | 237 m_fontColor, FXTEXT_CLEARTYPE); |
| 239 } | 238 } |
| 240 tempStr = str.Mid(7, 6); | 239 tempStr = str.Mid(7, 6); |
| 241 iLen = tempStr.GetLength(); | 240 iLen = tempStr.GetLength(); |
| 242 charsWidth = 0.0f; | |
| 243 CalcTextInfo(tempStr, pCharPos + 7, m_pFont, (FX_FLOAT)strWidth, iFontSize, | 241 CalcTextInfo(tempStr, pCharPos + 7, m_pFont, (FX_FLOAT)strWidth, iFontSize, |
| 244 blank); | 242 blank); |
| 245 if (pOutBitmap) { | 243 if (pOutBitmap) { |
| 246 FX_RECT rect1(0, 0, strWidth, iTextHeight); | 244 FX_RECT rect1(0, 0, strWidth, iTextHeight); |
| 247 ge.FillRect(&rect1, m_backgroundColor); | 245 ge.FillRect(&rect1, m_backgroundColor); |
| 248 ge.DrawNormalText(iLen, pCharPos + 7, m_pFont, | 246 ge.DrawNormalText(iLen, pCharPos + 7, m_pFont, |
| 249 CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize, | 247 CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize, |
| 250 (CFX_Matrix*)&affine_matrix, m_fontColor, | 248 (CFX_Matrix*)&affine_matrix, m_fontColor, |
| 251 FXTEXT_CLEARTYPE); | 249 FXTEXT_CLEARTYPE); |
| 252 geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 47 * multiple, | 250 geBitmap.SetDIBits(ge.GetBitmap(), leftPosition + 47 * multiple, |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 292 } |
| 295 FX_Free(pCharPos); | 293 FX_Free(pCharPos); |
| 296 } | 294 } |
| 297 void CBC_OnedEAN13Writer::RenderResult(const CFX_WideStringC& contents, | 295 void CBC_OnedEAN13Writer::RenderResult(const CFX_WideStringC& contents, |
| 298 uint8_t* code, | 296 uint8_t* code, |
| 299 int32_t codeLength, | 297 int32_t codeLength, |
| 300 FX_BOOL isDevice, | 298 FX_BOOL isDevice, |
| 301 int32_t& e) { | 299 int32_t& e) { |
| 302 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); | 300 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); |
| 303 } | 301 } |
| OLD | NEW |