Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3231)

Unified Diff: core/fpdfapi/page/cpdf_streamcontentparser.cpp

Issue 2542743002: Fix initial kerning when there is a horzscale set (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/cpdf_streamcontentparser.cpp
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
index df0d5f111737a79d715783c3b7a5d80cf05e1f47..45a468f7a65d8e1910fc0c240adf6b1aa658cf40 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp
@@ -1271,7 +1271,9 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
if (fInitKerning != 0) {
if (!pFont->IsVertWriting()) {
m_pCurStates->m_TextX -=
- (fInitKerning * m_pCurStates->m_TextState.GetFontSize()) / 1000;
+ (fInitKerning * m_pCurStates->m_TextState.GetFontSize() *
+ m_pCurStates->m_TextHorzScale) /
+ 1000;
} else {
m_pCurStates->m_TextY -=
(fInitKerning * m_pCurStates->m_TextState.GetFontSize()) / 1000;
@@ -1313,7 +1315,8 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
if (pKerning && pKerning[nsegs - 1] != 0) {
if (!pFont->IsVertWriting()) {
m_pCurStates->m_TextX -=
- (pKerning[nsegs - 1] * m_pCurStates->m_TextState.GetFontSize()) /
+ (pKerning[nsegs - 1] * m_pCurStates->m_TextState.GetFontSize() *
+ m_pCurStates->m_TextHorzScale) /
1000;
} else {
m_pCurStates->m_TextY -=
@@ -1345,7 +1348,8 @@ void CPDF_StreamContentParser::Handle_ShowText_Positioning() {
if (nsegs == 0) {
for (size_t i = 0; i < n; i++) {
m_pCurStates->m_TextX -=
- (pArray->GetNumberAt(i) * m_pCurStates->m_TextState.GetFontSize()) /
+ (pArray->GetNumberAt(i) * m_pCurStates->m_TextState.GetFontSize() *
+ m_pCurStates->m_TextHorzScale) /
1000;
}
return;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698