| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 int32_t iTextHeight = iFontSize + 1; | 189 int32_t iTextHeight = iFontSize + 1; |
| 190 CFX_ByteString tempStr = str.Mid(1, 6); | 190 CFX_ByteString tempStr = str.Mid(1, 6); |
| 191 int32_t strWidth = multiple * 42; | 191 int32_t strWidth = multiple * 42; |
| 192 if (!pOutBitmap) { | 192 if (!pOutBitmap) { |
| 193 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); | 193 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); |
| 194 CFX_FloatRect rect( | 194 CFX_FloatRect rect( |
| 195 (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), | 195 (FX_FLOAT)leftPosition, (FX_FLOAT)(m_Height - iTextHeight), |
| 196 (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); | 196 (FX_FLOAT)(leftPosition + strWidth - 0.5), (FX_FLOAT)m_Height); |
| 197 matr.Concat(*matrix); | 197 matr.Concat(*matrix); |
| 198 matr.TransformRect(rect); | 198 matr.TransformRect(rect); |
| 199 FX_RECT re = rect.GetOutterRect(); | 199 FX_RECT re = rect.GetOuterRect(); |
| 200 device->FillRect(&re, m_backgroundColor); | 200 device->FillRect(&re, m_backgroundColor); |
| 201 CFX_FloatRect rect1( | 201 CFX_FloatRect rect1( |
| 202 (FX_FLOAT)(leftPosition + 47 * multiple), | 202 (FX_FLOAT)(leftPosition + 47 * multiple), |
| 203 (FX_FLOAT)(m_Height - iTextHeight), | 203 (FX_FLOAT)(m_Height - iTextHeight), |
| 204 (FX_FLOAT)(leftPosition + 47 * multiple + strWidth - 0.5), | 204 (FX_FLOAT)(leftPosition + 47 * multiple + strWidth - 0.5), |
| 205 (FX_FLOAT)m_Height); | 205 (FX_FLOAT)m_Height); |
| 206 CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); | 206 CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0); |
| 207 matr1.Concat(*matrix); | 207 matr1.Concat(*matrix); |
| 208 matr1.TransformRect(rect1); | 208 matr1.TransformRect(rect1); |
| 209 re = rect1.GetOutterRect(); | 209 re = rect1.GetOuterRect(); |
| 210 device->FillRect(&re, m_backgroundColor); | 210 device->FillRect(&re, m_backgroundColor); |
| 211 int32_t strWidth1 = multiple * 7; | 211 int32_t strWidth1 = multiple * 7; |
| 212 CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); | 212 CFX_Matrix matr2(m_outputHScale, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f); |
| 213 CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), | 213 CFX_FloatRect rect2(0.0f, (FX_FLOAT)(m_Height - iTextHeight), |
| 214 (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height); | 214 (FX_FLOAT)strWidth1 - 0.5f, (FX_FLOAT)m_Height); |
| 215 matr2.Concat(*matrix); | 215 matr2.Concat(*matrix); |
| 216 matr2.TransformRect(rect2); | 216 matr2.TransformRect(rect2); |
| 217 re = rect2.GetOutterRect(); | 217 re = rect2.GetOuterRect(); |
| 218 device->FillRect(&re, m_backgroundColor); | 218 device->FillRect(&re, m_backgroundColor); |
| 219 } | 219 } |
| 220 FX_FLOAT blank = 0.0; | 220 FX_FLOAT blank = 0.0; |
| 221 iLen = tempStr.GetLength(); | 221 iLen = tempStr.GetLength(); |
| 222 if (!pOutBitmap) { | 222 if (!pOutBitmap) { |
| 223 strWidth = (int32_t)(strWidth * m_outputHScale); | 223 strWidth = (int32_t)(strWidth * m_outputHScale); |
| 224 } | 224 } |
| 225 CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, | 225 CalcTextInfo(tempStr, pCharPos + 1, m_pFont, (FX_FLOAT)strWidth, iFontSize, |
| 226 blank); | 226 blank); |
| 227 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); | 227 CFX_Matrix affine_matrix(1.0, 0.0, 0.0, -1.0, 0.0, (FX_FLOAT)iFontSize); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 FX_Free(pCharPos); | 298 FX_Free(pCharPos); |
| 299 } | 299 } |
| 300 | 300 |
| 301 void CBC_OnedEAN13Writer::RenderResult(const CFX_WideStringC& contents, | 301 void CBC_OnedEAN13Writer::RenderResult(const CFX_WideStringC& contents, |
| 302 uint8_t* code, | 302 uint8_t* code, |
| 303 int32_t codeLength, | 303 int32_t codeLength, |
| 304 FX_BOOL isDevice, | 304 FX_BOOL isDevice, |
| 305 int32_t& e) { | 305 int32_t& e) { |
| 306 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); | 306 CBC_OneDimWriter::RenderResult(contents, code, codeLength, isDevice, e); |
| 307 } | 307 } |
| OLD | NEW |