summaryrefslogtreecommitdiff
path: root/core/fpdfapi
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi')
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_cidfont.cpp18
-rw-r--r--core/fpdfapi/fpdf_font/cpdf_cidfont.h1
-rw-r--r--core/fpdfapi/fpdf_render/fpdf_render_text.cpp2
3 files changed, 11 insertions, 10 deletions
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
index af4121da16..317e6ddb01 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.cpp
@@ -775,34 +775,36 @@ int CPDF_CIDFont::GlyphFromCharCode(uint32_t charcode, FX_BOOL* pVertGlyph) {
const uint8_t* pdata = m_pStreamAcc->GetData() + byte_pos;
return pdata[0] * 256 + pdata[1];
}
+
uint32_t CPDF_CIDFont::GetNextChar(const FX_CHAR* pString,
int nStrLen,
int& offset) const {
return m_pCMap->GetNextChar(pString, nStrLen, offset);
}
+
int CPDF_CIDFont::GetCharSize(uint32_t charcode) const {
return m_pCMap->GetCharSize(charcode);
}
+
int CPDF_CIDFont::CountChar(const FX_CHAR* pString, int size) const {
return m_pCMap->CountChar(pString, size);
}
+
int CPDF_CIDFont::AppendChar(FX_CHAR* str, uint32_t charcode) const {
return m_pCMap->AppendChar(str, charcode);
}
+
FX_BOOL CPDF_CIDFont::IsUnicodeCompatible() const {
- if (!m_pCMap->IsLoaded() || !m_pCID2UnicodeMap ||
- !m_pCID2UnicodeMap->IsLoaded()) {
- return m_pCMap->m_Coding != CIDCODING_UNKNOWN;
- }
- return TRUE;
-}
-FX_BOOL CPDF_CIDFont::IsFontStyleFromCharCode(uint32_t charcode) const {
- return TRUE;
+ if (m_pCID2UnicodeMap && m_pCID2UnicodeMap->IsLoaded() && m_pCMap->IsLoaded())
+ return TRUE;
+ return m_pCMap->m_Coding != CIDCODING_UNKNOWN;
}
+
void CPDF_CIDFont::LoadSubstFont() {
m_Font.LoadSubst(m_BaseFont, !m_bType1, m_Flags, m_StemV * 5, m_ItalicAngle,
g_CharsetCPs[m_Charset], IsVertWriting());
}
+
void CPDF_CIDFont::LoadMetricsArray(CPDF_Array* pArray,
CFX_ArrayTemplate<uint32_t>& result,
int nElements) {
diff --git a/core/fpdfapi/fpdf_font/cpdf_cidfont.h b/core/fpdfapi/fpdf_font/cpdf_cidfont.h
index f1c72c65cf..5abb20f7aa 100644
--- a/core/fpdfapi/fpdf_font/cpdf_cidfont.h
+++ b/core/fpdfapi/fpdf_font/cpdf_cidfont.h
@@ -61,7 +61,6 @@ class CPDF_CIDFont : public CPDF_Font {
const uint8_t* GetCIDTransform(uint16_t CID) const;
short GetVertWidth(uint16_t CID) const;
void GetVertOrigin(uint16_t CID, short& vx, short& vy) const;
- virtual FX_BOOL IsFontStyleFromCharCode(uint32_t charcode) const;
protected:
int GetGlyphIndex(uint32_t unicodeb, FX_BOOL* pVertGlyph);
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
index 5b0ad96aee..2da51b90d5 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_text.cpp
@@ -562,7 +562,7 @@ void CPDF_CharPosList::Load(int nChars,
FX_BOOL bVert = FALSE;
FXTEXT_CHARPOS& charpos = m_pCharPos[m_nChars++];
if (pCIDFont) {
- charpos.m_bFontStyle = pCIDFont->IsFontStyleFromCharCode(CharCode);
+ charpos.m_bFontStyle = true;
}
charpos.m_GlyphIndex = pFont->GlyphFromCharCode(CharCode, &bVert);
#if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_