summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-17 18:36:43 -0700
committerLei Zhang <thestig@chromium.org>2015-08-17 18:36:43 -0700
commit1b0023986bc22ce362097b25deb9746b693ef235 (patch)
tree4d18ffc5f9eff4ac4659531621be8d2c28e3c71c /core/include
parenta0f67247277f666d80899985eda3c19f3641b9bf (diff)
downloadpdfium-1b0023986bc22ce362097b25deb9746b693ef235.tar.xz
Merge to XFA: Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding.
Similarly, Clean up CFX_UnicodeEncodingEx and remove IFX_FontEncodingEx. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1296753003 . (cherry picked from commit 52a48aadc19b2dee8abeb702269bb168eb6b6999) Review URL: https://codereview.chromium.org/1297083002 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fxge/fx_font.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/core/include/fxge/fx_font.h b/core/include/fxge/fx_font.h
index ff664f9532..7eaa323717 100644
--- a/core/include/fxge/fx_font.h
+++ b/core/include/fxge/fx_font.h
@@ -140,18 +140,6 @@ class CFX_Font {
#define ENCODING_INTERNAL 0
#define ENCODING_UNICODE 1
-class IFX_FontEncoding {
- public:
- virtual ~IFX_FontEncoding() {}
-
- virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode) = 0;
-
- virtual CFX_WideString UnicodeFromCharCode(FX_DWORD charcode) const = 0;
-
- virtual FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const = 0;
-};
-
-IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont);
#define FXFM_ENC_TAG(a, b, c, d) \
(((FX_DWORD)(a) << 24) | ((FX_DWORD)(b) << 16) | ((FX_DWORD)(c) << 8) | \
(FX_DWORD)(d))
@@ -169,17 +157,37 @@ IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont);
#define FXFM_ENCODING_ADOBE_LATIN_1 FXFM_ENC_TAG('l', 'a', 't', '1')
#define FXFM_ENCODING_OLD_LATIN_2 FXFM_ENC_TAG('l', 'a', 't', '2')
#define FXFM_ENCODING_APPLE_ROMAN FXFM_ENC_TAG('a', 'r', 'm', 'n')
-class IFX_FontEncodingEx : public IFX_FontEncoding {
+
+class CFX_UnicodeEncoding {
+ public:
+ explicit CFX_UnicodeEncoding(CFX_Font* pFont);
+ virtual ~CFX_UnicodeEncoding();
+
+ virtual FX_DWORD GlyphFromCharCode(FX_DWORD charcode);
+
+ protected:
+ // Unowned, not nullptr.
+ CFX_Font* m_pFont;
+};
+
+class CFX_UnicodeEncodingEx : public CFX_UnicodeEncoding {
public:
- virtual FX_DWORD GlyphIndexFromName(const FX_CHAR* pStrName) = 0;
+ CFX_UnicodeEncodingEx(CFX_Font* pFont, FX_DWORD EncodingID);
+ ~CFX_UnicodeEncodingEx() override;
- virtual CFX_ByteString NameFromGlyphIndex(FX_DWORD dwGlyphIndex) = 0;
+ // CFX_UnicodeEncoding:
+ FX_DWORD GlyphFromCharCode(FX_DWORD charcode) override;
- virtual FX_DWORD CharCodeFromGlyphIndex(FX_DWORD dwGlyphIndex) = 0;
+ FX_DWORD CharCodeFromUnicode(FX_WCHAR Unicode) const;
+
+ private:
+ FX_DWORD m_nEncodingID;
};
-IFX_FontEncodingEx* FX_CreateFontEncodingEx(
+
+CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(
CFX_Font* pFont,
FX_DWORD nEncodingID = FXFM_ENCODING_NONE);
+
#define FXFONT_SUBST_MM 0x01
#define FXFONT_SUBST_GLYPHPATH 0x04
#define FXFONT_SUBST_CLEARTYPE 0x08