42const uint8_t kOnedEAN8MiddlePattern[5] = {1, 1, 1, 1, 1};
101 if (contents.GetLength() != 8)
104 DataVector<uint8_t> result(m_codeWidth);
105 auto result_span =
pdfium::make_span(result);
106 result_span = AppendPattern(result_span, kOnedEAN8StartPattern,
true);
108 for (
int i = 0; i <= 3; i++) {
109 int32_t digit = FXSYS_DecimalCharToInt(contents[i]);
111 AppendPattern(result_span, kOnedEAN8LPatternTable[digit],
false);
113 result_span = AppendPattern(result_span, kOnedEAN8MiddlePattern,
false);
115 for (
int i = 4; i <= 7; i++) {
116 int32_t digit = FXSYS_DecimalCharToInt(contents[i]);
118 AppendPattern(result_span, kOnedEAN8LPatternTable[digit],
true);
120 AppendPattern(result_span, kOnedEAN8StartPattern,
true);
131 constexpr float kLeftPosition = 3.0f;
133 size_t iLength = str.GetLength();
134 std::vector<TextCharPos> charpos(iLength);
136 size_t iLen = tempStr.GetLength();
137 constexpr int32_t kWidth = 28;
140 int32_t iFontSize =
static_cast<int32_t>(fabs(m_fFontSize));
141 int32_t iTextHeight = iFontSize + 1;
143 CFX_Matrix matr(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
144 CFX_FloatRect rect(kLeftPosition, (
float)(m_Height - iTextHeight),
145 kLeftPosition + kWidth - 0.5, (
float)m_Height);
149 CFX_Matrix matr1(m_outputHScale, 0.0, 0.0, 1.0, 0.0, 0.0);
150 CFX_FloatRect rect1(kLeftPosition + 33, (
float)(m_Height - iTextHeight),
151 kLeftPosition + 33 + kWidth - 0.5, (
float)m_Height);
155 int32_t strWidth =
static_cast<int32_t>(kWidth * m_outputHScale);
157 pdfium::span<TextCharPos> charpos_span =
pdfium::make_span(charpos);
158 CalcTextInfo(tempStr, charpos, m_pFont, (
float)strWidth, iFontSize, blank);
160 CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
161 kLeftPosition * m_outputHScale,
162 (
float)(m_Height - iTextHeight + iFontSize));
164 device->DrawNormalText(charpos_span.first(iLen), m_pFont,
165 static_cast<
float>(iFontSize), affine_matrix1,
168 tempStr = str.Substr(4, 4);
169 iLen = tempStr.GetLength();
170 CalcTextInfo(tempStr, charpos_span.subspan(4), m_pFont, (
float)strWidth,
173 CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0,
174 (kLeftPosition + 33) * m_outputHScale,
175 (
float)(m_Height - iTextHeight + iFontSize));
177 device->DrawNormalText(charpos_span.subspan(4, iLen), m_pFont,
178 static_cast<
float>(iFontSize), affine_matrix1,