diff options
Diffstat (limited to 'fxbarcode/oned')
-rw-r--r-- | fxbarcode/oned/BC_OneDimWriter.cpp | 5 | ||||
-rw-r--r-- | fxbarcode/oned/BC_OneDimWriter.h | 3 | ||||
-rw-r--r-- | fxbarcode/oned/BC_OnedEAN13Writer.cpp | 14 | ||||
-rw-r--r-- | fxbarcode/oned/BC_OnedEAN8Writer.cpp | 10 | ||||
-rw-r--r-- | fxbarcode/oned/BC_OnedUPCAWriter.cpp | 18 |
5 files changed, 27 insertions, 23 deletions
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp index a7539e4897..22cc09513f 100644 --- a/fxbarcode/oned/BC_OneDimWriter.cpp +++ b/fxbarcode/oned/BC_OneDimWriter.cpp @@ -197,7 +197,7 @@ void CBC_OneDimWriter::ShowDeviceChars(CFX_RenderDevice* device, if (matrix) { affine_matrix.Concat(*matrix); } - device->DrawNormalText(str.GetLength(), pCharPos, m_pFont, + device->DrawNormalText(str.GetLength(), pCharPos, m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix, m_fontColor, FXTEXT_CLEARTYPE); } @@ -224,7 +224,8 @@ bool CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents, } int32_t iFontSize = (int32_t)fabs(m_fFontSize); int32_t iTextHeight = iFontSize + 1; - CalcTextInfo(str, charpos.data(), m_pFont, geWidth, iFontSize, charsLen); + CalcTextInfo(str, charpos.data(), m_pFont.Get(), geWidth, iFontSize, + charsLen); if (charsLen < 1) return true; diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h index 3bd1b611c6..d81a3e0a0a 100644 --- a/fxbarcode/oned/BC_OneDimWriter.h +++ b/fxbarcode/oned/BC_OneDimWriter.h @@ -10,6 +10,7 @@ #include <memory> #include <vector> +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxge/cfx_renderdevice.h" #include "fxbarcode/BC_Library.h" #include "fxbarcode/BC_Writer.h" @@ -86,7 +87,7 @@ class CBC_OneDimWriter : public CBC_Writer { bool m_bPrintChecksum; int32_t m_iDataLenth; bool m_bCalcChecksum; - CFX_Font* m_pFont; + CFX_UnownedPtr<CFX_Font> m_pFont; float m_fFontSize; int32_t m_iFontStyle; uint32_t m_fontColor; diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp index bae43b464e..0e4bab9518 100644 --- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp @@ -192,7 +192,7 @@ bool CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, iLen = tempStr.GetLength(); strWidth = (int32_t)(strWidth * m_outputHScale); - CalcTextInfo(tempStr, &charpos[1], m_pFont, (float)strWidth, iFontSize, + CalcTextInfo(tempStr, &charpos[1], m_pFont.Get(), (float)strWidth, iFontSize, blank); { CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, @@ -200,13 +200,13 @@ bool CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, (float)(m_Height - iTextHeight) + iFontSize); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, &charpos[1], m_pFont, + device->DrawNormalText(iLen, &charpos[1], m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(7, 6); iLen = tempStr.GetLength(); - CalcTextInfo(tempStr, &charpos[7], m_pFont, (float)strWidth, iFontSize, + CalcTextInfo(tempStr, &charpos[7], m_pFont.Get(), (float)strWidth, iFontSize, blank); { CFX_Matrix affine_matrix1( @@ -215,7 +215,7 @@ bool CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, &charpos[7], m_pFont, + device->DrawNormalText(iLen, &charpos[7], m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } @@ -224,14 +224,14 @@ bool CBC_OnedEAN13Writer::ShowChars(const CFX_WideStringC& contents, strWidth = multiple * 7; strWidth = (int32_t)(strWidth * m_outputHScale); - CalcTextInfo(tempStr, charpos.data(), m_pFont, (float)strWidth, iFontSize, - blank); + CalcTextInfo(tempStr, charpos.data(), m_pFont.Get(), (float)strWidth, + iFontSize, blank); { CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, 0.0, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, charpos.data(), m_pFont, + device->DrawNormalText(iLen, charpos.data(), m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp index 49d77b72c4..f891c08fc6 100644 --- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp +++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp @@ -184,20 +184,20 @@ bool CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, device->FillRect(&re, m_backgroundColor); strWidth = (int32_t)(strWidth * m_outputHScale); - CalcTextInfo(tempStr, charpos.data(), m_pFont, (float)strWidth, iFontSize, - blank); + CalcTextInfo(tempStr, charpos.data(), m_pFont.Get(), (float)strWidth, + iFontSize, blank); { CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, (float)leftPosition * m_outputHScale, (float)(m_Height - iTextHeight + iFontSize)); affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, charpos.data(), m_pFont, + device->DrawNormalText(iLen, charpos.data(), m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(4, 4); iLen = tempStr.GetLength(); - CalcTextInfo(tempStr, &charpos[4], m_pFont, (float)strWidth, iFontSize, + CalcTextInfo(tempStr, &charpos[4], m_pFont.Get(), (float)strWidth, iFontSize, blank); { CFX_Matrix affine_matrix1( @@ -206,7 +206,7 @@ bool CBC_OnedEAN8Writer::ShowChars(const CFX_WideStringC& contents, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, &charpos[4], m_pFont, + device->DrawNormalText(iLen, &charpos[4], m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } diff --git a/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/fxbarcode/oned/BC_OnedUPCAWriter.cpp index 614268e742..78ada1783a 100644 --- a/fxbarcode/oned/BC_OnedUPCAWriter.cpp +++ b/fxbarcode/oned/BC_OnedUPCAWriter.cpp @@ -158,20 +158,20 @@ bool CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, device->FillRect(&re, m_backgroundColor); strWidth = strWidth * m_outputHScale; - CalcTextInfo(tempStr, &charpos[1], m_pFont, strWidth, iFontSize, blank); + CalcTextInfo(tempStr, &charpos[1], m_pFont.Get(), strWidth, iFontSize, blank); { CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, (float)leftPosition * m_outputHScale, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, &charpos[1], m_pFont, + device->DrawNormalText(iLen, &charpos[1], m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(6, 5); iLen = tempStr.GetLength(); - CalcTextInfo(tempStr, &charpos[6], m_pFont, strWidth, iFontSize, blank); + CalcTextInfo(tempStr, &charpos[6], m_pFont.Get(), strWidth, iFontSize, blank); { CFX_Matrix affine_matrix1( 1.0, 0.0, 0.0, -1.0, @@ -179,7 +179,7 @@ bool CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, &charpos[6], m_pFont, + device->DrawNormalText(iLen, &charpos[6], m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } @@ -188,19 +188,21 @@ bool CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, strWidth = (float)multiple * 7; strWidth = strWidth * m_outputHScale; - CalcTextInfo(tempStr, charpos.data(), m_pFont, strWidth, iFontSize, blank); + CalcTextInfo(tempStr, charpos.data(), m_pFont.Get(), strWidth, iFontSize, + blank); { CFX_Matrix affine_matrix1(1.0, 0.0, 0.0, -1.0, 0, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, charpos.data(), m_pFont, + device->DrawNormalText(iLen, charpos.data(), m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } tempStr = str.Mid(11, 1); iLen = tempStr.GetLength(); - CalcTextInfo(tempStr, &charpos[11], m_pFont, strWidth, iFontSize, blank); + CalcTextInfo(tempStr, &charpos[11], m_pFont.Get(), strWidth, iFontSize, + blank); { CFX_Matrix affine_matrix1( 1.0, 0.0, 0.0, -1.0, @@ -208,7 +210,7 @@ bool CBC_OnedUPCAWriter::ShowChars(const CFX_WideStringC& contents, (float)(m_Height - iTextHeight + iFontSize)); if (matrix) affine_matrix1.Concat(*matrix); - device->DrawNormalText(iLen, &charpos[11], m_pFont, + device->DrawNormalText(iLen, &charpos[11], m_pFont.Get(), static_cast<float>(iFontSize), &affine_matrix1, m_fontColor, FXTEXT_CLEARTYPE); } |