summaryrefslogtreecommitdiff
path: root/core/fpdfapi/render/cpdf_textrenderer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/render/cpdf_textrenderer.cpp')
-rw-r--r--core/fpdfapi/render/cpdf_textrenderer.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/fpdfapi/render/cpdf_textrenderer.cpp b/core/fpdfapi/render/cpdf_textrenderer.cpp
index 711dbfaf39..7aeddf0a61 100644
--- a/core/fpdfapi/render/cpdf_textrenderer.cpp
+++ b/core/fpdfapi/render/cpdf_textrenderer.cpp
@@ -83,18 +83,18 @@ void CPDF_TextRenderer::DrawTextString(CFX_RenderDevice* pDevice,
if (pFont->IsType3Font())
return;
- int nChars = pFont->CountChar(str.c_str(), str.GetLength());
+ int nChars = pFont->CountChar(str.AsStringView());
if (nChars <= 0)
return;
- int offset = 0;
+ size_t offset = 0;
std::vector<uint32_t> codes;
std::vector<float> positions;
codes.resize(nChars);
positions.resize(nChars - 1);
float cur_pos = 0;
for (int i = 0; i < nChars; i++) {
- codes[i] = pFont->GetNextChar(str.c_str(), str.GetLength(), offset);
+ codes[i] = pFont->GetNextChar(str.AsStringView(), offset);
if (i)
positions[i - 1] = cur_pos;
cur_pos += pFont->GetCharWidthF(codes[i]) * font_size / 1000;