diff options
author | thestig <thestig@chromium.org> | 2016-06-20 10:38:52 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-20 10:38:52 -0700 |
commit | ec51ac3e4dfa8ee1da3d581b40f0b35af4563c9e (patch) | |
tree | 856b76dfb372807aaa984acedecff66984ec84b0 /core/fpdfapi/fpdf_font | |
parent | 54d027dbbff8a0270531855082e4f61cb457c173 (diff) | |
download | pdfium-ec51ac3e4dfa8ee1da3d581b40f0b35af4563c9e.tar.xz |
Another round of fx_ge cleanup.
- Clean up CFX_GEModule.
- Remove duplicate #defines in fx_ge.h
- Remove IsFontStyleFromCharCode() that always returns true.
- Mark a FXTEXT_CHARPOS field as Mac only.
Review-Url: https://codereview.chromium.org/2075333002
Diffstat (limited to 'core/fpdfapi/fpdf_font')
-rw-r--r-- | core/fpdfapi/fpdf_font/cpdf_cidfont.cpp | 18 | ||||
-rw-r--r-- | core/fpdfapi/fpdf_font/cpdf_cidfont.h | 1 |
2 files changed, 10 insertions, 9 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); |