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

Unified Diff: core/fpdfdoc/cpdf_variabletext.cpp

Issue 2337973004: Wordstyle not being used to calculate word width (Closed)
Patch Set: Created 4 years, 3 months 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 | core/fpdfdoc/ctypeset.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpdf_variabletext.cpp
diff --git a/core/fpdfdoc/cpdf_variabletext.cpp b/core/fpdfdoc/cpdf_variabletext.cpp
index 12cf274321476ebba95840b5d61964653292f6b7..93d970c0eaa93c0c6100944268ad50ed8f18e2ec 100644
--- a/core/fpdfdoc/cpdf_variabletext.cpp
+++ b/core/fpdfdoc/cpdf_variabletext.cpp
@@ -34,8 +34,7 @@ CPDF_VariableText::Provider::Provider(IPVT_FontMap* pFontMap)
CPDF_VariableText::Provider::~Provider() {}
int32_t CPDF_VariableText::Provider::GetCharWidth(int32_t nFontIndex,
- uint16_t word,
- int32_t nWordStyle) {
+ uint16_t word) {
if (CPDF_Font* pPDFFont = m_pFontMap->GetPDFFont(nFontIndex)) {
uint32_t charcode = pPDFFont->CharCodeFromUnicode(word);
if (charcode != CPDF_Font::kInvalidCharCode)
@@ -785,21 +784,17 @@ FX_FLOAT CPDF_VariableText::GetWordWidth(int32_t nFontIndex,
FX_FLOAT fCharSpace,
int32_t nHorzScale,
FX_FLOAT fFontSize,
- FX_FLOAT fWordTail,
- int32_t nWordStyle) {
- return (GetCharWidth(nFontIndex, Word, SubWord, nWordStyle) * fFontSize *
- kFontScale +
+ FX_FLOAT fWordTail) {
+ return (GetCharWidth(nFontIndex, Word, SubWord) * fFontSize * kFontScale +
fCharSpace) *
nHorzScale * kScalePercent +
fWordTail;
}
FX_FLOAT CPDF_VariableText::GetWordWidth(const CPVT_WordInfo& WordInfo) {
- return GetWordWidth(
- GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(),
- GetCharSpace(WordInfo), GetHorzScale(WordInfo), GetWordFontSize(WordInfo),
- WordInfo.fWordTail,
- WordInfo.pWordProps ? WordInfo.pWordProps->nWordStyle : 0);
+ return GetWordWidth(GetWordFontIndex(WordInfo), WordInfo.Word, GetSubWord(),
+ GetCharSpace(WordInfo), GetHorzScale(WordInfo),
+ GetWordFontSize(WordInfo), WordInfo.fWordTail);
}
FX_FLOAT CPDF_VariableText::GetLineAscent(const CPVT_SectionInfo& SecInfo) {
@@ -1066,12 +1061,11 @@ CPVT_FloatRect CPDF_VariableText::RearrangeSections(
int32_t CPDF_VariableText::GetCharWidth(int32_t nFontIndex,
uint16_t Word,
- uint16_t SubWord,
- int32_t nWordStyle) {
+ uint16_t SubWord) {
if (!m_pVTProvider)
return 0;
uint16_t word = SubWord ? SubWord : Word;
- return m_pVTProvider->GetCharWidth(nFontIndex, word, nWordStyle);
+ return m_pVTProvider->GetCharWidth(nFontIndex, word);
}
int32_t CPDF_VariableText::GetTypeAscent(int32_t nFontIndex) {
« no previous file with comments | « no previous file | core/fpdfdoc/ctypeset.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698