summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_page')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp12
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp8
3 files changed, 12 insertions, 12 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index d589d5809f..f05c4bea92 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -71,17 +71,17 @@ void CPDF_TextObject::GetItemInfo(int index, CPDF_TextObjectItem* pInfo) const {
return;
}
CPDF_Font* pFont = m_TextState.GetFont();
- if (pFont->GetFontType() != PDFFONT_CIDFONT) {
+ if (!pFont->IsCIDFont()) {
return;
}
- if (!((CPDF_CIDFont*)pFont)->IsVertWriting()) {
+ if (!pFont->AsCIDFont()->IsVertWriting()) {
return;
}
- FX_WORD CID = ((CPDF_CIDFont*)pFont)->CIDFromCharCode(pInfo->m_CharCode);
+ FX_WORD CID = pFont->AsCIDFont()->CIDFromCharCode(pInfo->m_CharCode);
pInfo->m_OriginY = pInfo->m_OriginX;
pInfo->m_OriginX = 0;
short vx, vy;
- ((CPDF_CIDFont*)pFont)->GetVertOrigin(CID, vx, vy);
+ pFont->AsCIDFont()->GetVertOrigin(CID, vx, vy);
FX_FLOAT fontsize = m_TextState.GetFontSize();
pInfo->m_OriginX -= fontsize * vx / 1000;
pInfo->m_OriginY -= fontsize * vy / 1000;
@@ -214,7 +214,7 @@ FX_FLOAT CPDF_TextObject::GetCharWidth(FX_DWORD charcode) const {
FX_FLOAT fontsize = m_TextState.GetFontSize() / 1000;
CPDF_Font* pFont = m_TextState.GetFont();
FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
}
@@ -236,7 +236,7 @@ void CPDF_TextObject::CalcPositionData(FX_FLOAT* pTextAdvanceX,
FX_FLOAT max_y = -10000 * 1.0f;
CPDF_Font* pFont = m_TextState.GetFont();
FX_BOOL bVertWriting = FALSE;
- CPDF_CIDFont* pCIDFont = pFont->GetCIDFont();
+ CPDF_CIDFont* pCIDFont = pFont->AsCIDFont();
if (pCIDFont) {
bVertWriting = pCIDFont->IsVertWriting();
}
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
index 756e08646a..85b026f8e8 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_doc.cpp
@@ -261,12 +261,12 @@ CPDF_Font* CPDF_DocPageData::GetStandardFont(const CFX_ByteStringC& fontName,
continue;
if (pFont->IsEmbedded())
continue;
- if (pFont->GetFontType() != PDFFONT_TYPE1)
+ if (!pFont->IsType1Font())
continue;
if (pFont->GetFontDict()->KeyExist("Widths"))
continue;
- CPDF_Type1Font* pT1Font = pFont->GetType1Font();
+ CPDF_Type1Font* pT1Font = pFont->AsType1Font();
if (pEncoding && !pT1Font->GetEncoding()->IsIdentical(pEncoding))
continue;
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
index 3018630463..465c74a425 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp
@@ -1258,9 +1258,9 @@ CPDF_Font* CPDF_StreamContentParser::FindFont(const CFX_ByteString& name) {
}
CPDF_Font* pFont = m_pDocument->LoadFont(pFontDict);
- if (pFont && pFont->GetType3Font()) {
- pFont->GetType3Font()->SetPageResources(m_pResources);
- pFont->GetType3Font()->CheckType3FontMetrics();
+ if (pFont && pFont->IsType3Font()) {
+ pFont->AsType3Font()->SetPageResources(m_pResources);
+ pFont->AsType3Font()->CheckType3FontMetrics();
}
return pFont;
}
@@ -1336,7 +1336,7 @@ void CPDF_StreamContentParser::AddTextObject(CFX_ByteString* pStrs,
return;
}
int textmode;
- if (pFont->GetFontType() == PDFFONT_TYPE3) {
+ if (pFont->IsType3Font()) {
textmode = 0;
} else {
textmode = m_pCurStates->m_TextState.GetObject()->m_TextMode;