| 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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLength); | 175 FXTEXT_CHARPOS* pCharPos = FX_Alloc(FXTEXT_CHARPOS, iLength); |
| 176 FXSYS_memset(pCharPos, 0, sizeof(FXTEXT_CHARPOS) * iLength); | 176 FXSYS_memset(pCharPos, 0, sizeof(FXTEXT_CHARPOS) * iLength); |
| 177 CFX_ByteString tempStr = str.Mid(0, 4); | 177 CFX_ByteString tempStr = str.Mid(0, 4); |
| 178 int32_t iLen = tempStr.GetLength(); | 178 int32_t iLen = tempStr.GetLength(); |
| 179 int32_t strWidth = 7 * multiple * 4; | 179 int32_t strWidth = 7 * multiple * 4; |
| 180 FX_FLOAT blank = 0.0; | 180 FX_FLOAT blank = 0.0; |
| 181 CFX_FxgeDevice geBitmap; | 181 CFX_FxgeDevice geBitmap; |
| 182 if (pOutBitmap) { | 182 if (pOutBitmap) { |
| 183 geBitmap.Attach(pOutBitmap); | 183 geBitmap.Attach(pOutBitmap); |
| 184 } | 184 } |
| 185 FX_FLOAT charsWidth = 0; | |
| 186 int32_t iFontSize = (int32_t)fabs(m_fFontSize); | 185 int32_t iFontSize = (int32_t)fabs(m_fFontSize); |
| 187 int32_t iTextHeight = iFontSize + 1; | 186 int32_t iTextHeight = iFontSize + 1; |
| 188 if (pOutBitmap == NULL) { | 187 if (pOutBitmap == NULL) { |
| 189 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); | 188 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); |
| 190 CFX_FloatRect rect( | 189 CFX_FloatRect rect( |
| 191 (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), | 190 (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), |
| 192 (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); | 191 (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); |
| 193 matr.Concat(*matrix); | 192 matr.Concat(*matrix); |
| 194 matr.TransformRect(rect); | 193 matr.TransformRect(rect); |
| 195 FX_RECT re = rect.GetOutterRect(); | 194 FX_RECT re = rect.GetOutterRect(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 226 (FX_FLOAT)leftPosition * m_outputHScale, | 225 (FX_FLOAT)leftPosition * m_outputHScale, |
| 227 (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); | 226 (FX_FLOAT)(m_Height - iTextHeight + iFontSize)); |
| 228 affine_matrix1.Concat(*matrix); | 227 affine_matrix1.Concat(*matrix); |
| 229 device->DrawNormalText(iLen, pCharPos, m_pFont, | 228 device->DrawNormalText(iLen, pCharPos, m_pFont, |
| 230 CFX_GEModule::Get()->GetFontCache(), | 229 CFX_GEModule::Get()->GetFontCache(), |
| 231 (FX_FLOAT)iFontSize, (CFX_Matrix*)&affine_matrix1, | 230 (FX_FLOAT)iFontSize, (CFX_Matrix*)&affine_matrix1, |
| 232 m_fontColor, FXTEXT_CLEARTYPE); | 231 m_fontColor, FXTEXT_CLEARTYPE); |
| 233 } | 232 } |
| 234 tempStr = str.Mid(4, 4); | 233 tempStr = str.Mid(4, 4); |
| 235 iLen = tempStr.GetLength(); | 234 iLen = tempStr.GetLength(); |
| 236 charsWidth = 0.0f; | |
| 237 CalcTextInfo(tempStr, pCharPos + 4, m_pFont, (FX_FLOAT)strWidth, iFontSize, | 235 CalcTextInfo(tempStr, pCharPos + 4, m_pFont, (FX_FLOAT)strWidth, iFontSize, |
| 238 blank); | 236 blank); |
| 239 if (pOutBitmap) { | 237 if (pOutBitmap) { |
| 240 delete ge.GetBitmap(); | 238 delete ge.GetBitmap(); |
| 241 ge.Create(strWidth, iTextHeight, FXDIB_Argb); | 239 ge.Create(strWidth, iTextHeight, FXDIB_Argb); |
| 242 ge.GetBitmap()->Clear(m_backgroundColor); | 240 ge.GetBitmap()->Clear(m_backgroundColor); |
| 243 ge.DrawNormalText(iLen, pCharPos + 4, m_pFont, | 241 ge.DrawNormalText(iLen, pCharPos + 4, m_pFont, |
| 244 CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize, | 242 CFX_GEModule::Get()->GetFontCache(), (FX_FLOAT)iFontSize, |
| 245 (CFX_Matrix*)&affine_matrix, m_fontColor, | 243 (CFX_Matrix*)&affine_matrix, m_fontColor, |
| 246 FXTEXT_CLEARTYPE); | 244 FXTEXT_CLEARTYPE); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 261 } | 259 } |
| 262 FX_Free(pCharPos); | 260 FX_Free(pCharPos); |
| 263 } | 261 } |
| 264 void CBC_OnedEAN8Writer::RenderResult(const CFX_WideStringC& contents, | 262 void CBC_OnedEAN8Writer::RenderResult(const CFX_WideStringC& contents, |
| 265 uint8_t* code, | 263 uint8_t* code, |
| 266 int32_t codeLength, | 264 int32_t codeLength, |
| 267 FX_BOOL isDevice, | 265 FX_BOOL isDevice, |
| 268 int32_t& e) { | 266 int32_t& e) { |
| 269 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); | 267 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); |
| 270 } | 268 } |
| OLD | NEW |