diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-04-09 20:33:45 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-04-09 20:33:45 +0000 |
commit | e372ad7333bdd6bb0c579cf074843ef0c6f3414f (patch) | |
tree | 9928344d0def23d3fb070713a88947aceb6b5c71 /core/fpdfapi/render | |
parent | 0d8e530fbf898c1ba1ba4d3d91aa17e3fd4d8317 (diff) | |
download | pdfium-e372ad7333bdd6bb0c579cf074843ef0c6f3414f.tar.xz |
Use ByteStringView / pdfium::span in CPDF font as appropriate.chromium/3393
Change-Id: I92c7ba605bf95a9023ad046b8dddebe0a0592802
Reviewed-on: https://pdfium-review.googlesource.com/29992
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/render')
-rw-r--r-- | core/fpdfapi/render/cpdf_textrenderer.cpp | 6 |
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; |