diff options
Diffstat (limited to 'core/fpdfapi/page')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser.cpp | 9 | ||||
-rw-r--r-- | core/fpdfapi/page/cpdf_textobject.h | 10 |
2 files changed, 9 insertions, 10 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.cpp b/core/fpdfapi/page/cpdf_streamcontentparser.cpp index 47aa20938a..4ba1d2a44e 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser.cpp @@ -1262,10 +1262,11 @@ void CPDF_StreamContentParser::AddTextObject(ByteString* pStrs, pCTM[3] = m_pCurStates->m_CTM.d; } pText->SetSegments(pStrs, pKerning, nsegs); - pText->m_Pos = m_mtContentToUser.Transform( - m_pCurStates->m_CTM.Transform(m_pCurStates->m_TextMatrix.Transform( - CFX_PointF(m_pCurStates->m_TextPos.x, - m_pCurStates->m_TextPos.y + m_pCurStates->m_TextRise)))); + pText->SetPosition( + m_mtContentToUser.Transform(m_pCurStates->m_CTM.Transform( + m_pCurStates->m_TextMatrix.Transform(CFX_PointF( + m_pCurStates->m_TextPos.x, + m_pCurStates->m_TextPos.y + m_pCurStates->m_TextRise))))); m_pCurStates->m_TextPos += pText->CalcPositionData(m_pCurStates->m_TextHorzScale); diff --git a/core/fpdfapi/page/cpdf_textobject.h b/core/fpdfapi/page/cpdf_textobject.h index 5cffbd1434..02653dc2aa 100644 --- a/core/fpdfapi/page/cpdf_textobject.h +++ b/core/fpdfapi/page/cpdf_textobject.h @@ -48,20 +48,18 @@ class CPDF_TextObject : public CPDF_PageObject { float GetFontSize() const; void SetText(const ByteString& text); + void SetPosition(CFX_PointF pos) { m_Pos = pos; } void SetPosition(float x, float y); void RecalcPositionData(); - private: - friend class CPDF_RenderStatus; - friend class CPDF_StreamContentParser; - friend class CPDF_TextRenderer; - friend class CPDF_PageContentGenerator; + const std::vector<uint32_t>& GetCharCodes() const { return m_CharCodes; } + const std::vector<float>& GetCharPositions() const { return m_CharPos; } void SetSegments(const ByteString* pStrs, const float* pKerning, int nSegs); - CFX_PointF CalcPositionData(float horz_scale); + private: CFX_PointF m_Pos; std::vector<uint32_t> m_CharCodes; std::vector<float> m_CharPos; |