Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2028)

Unified Diff: core/src/fxge/ge/fx_ge_font.cpp

Issue 1296753003: Cleanup CFX_UnicodeEncoding and remove IFX_FontEncoding. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp ('k') | core/src/fxge/ge/text_int.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxge/ge/fx_ge_font.cpp
diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp
index 8be177ed14c48bb9bcfa5b67ecdba9c26dfd465f..d72adc36bf13d4e93c81175f50dfd328d7cf2051 100644
--- a/core/src/fxge/ge/fx_ge_font.cpp
+++ b/core/src/fxge/ge/fx_ge_font.cpp
@@ -379,48 +379,27 @@ int CFX_Font::GetULthickness() {
FXFT_Get_Face_UnderLineThickness(m_Face));
return thickness;
}
-CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont) {
- m_pFont = pFont;
+
+CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont) : m_pFont(pFont) {
+}
+
+CFX_UnicodeEncoding::~CFX_UnicodeEncoding() {
}
+
FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCode(FX_DWORD charcode) {
FXFT_Face face = m_pFont->GetFace();
- if (!face) {
+ if (!face)
return charcode;
- }
- if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0) {
+
+ if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0)
return FXFT_Get_Char_Index(face, charcode);
- }
+
if (m_pFont->m_pSubstFont && m_pFont->m_pSubstFont->m_Charset == 2) {
FX_DWORD index = 0;
- if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0) {
+ if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0)
index = FXFT_Get_Char_Index(face, charcode);
- }
- if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN)) {
+ if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN))
return FXFT_Get_Char_Index(face, charcode);
- }
}
return charcode;
}
-FX_DWORD CFX_UnicodeEncoding::GlyphFromCharCodeEx(FX_DWORD charcode,
- int encoding) {
- FXFT_Face face = m_pFont->GetFace();
- if (!face) {
- return charcode;
- }
- if (encoding == ENCODING_UNICODE) {
- return GlyphFromCharCode(charcode);
- }
- int nmaps = FXFT_Get_Face_CharmapCount(m_pFont->m_Face);
- int i = 0;
- while (i < nmaps) {
- int encoding = FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i++]);
- if (encoding != FXFT_ENCODING_UNICODE) {
- FXFT_Select_Charmap(face, encoding);
- break;
- }
- }
- return FXFT_Get_Char_Index(face, charcode);
-}
-IFX_FontEncoding* FXGE_CreateUnicodeEncoding(CFX_Font* pFont) {
- return new CFX_UnicodeEncoding(pFont);
-}
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_doc.cpp ('k') | core/src/fxge/ge/text_int.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698