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

Side by Side Diff: core/fxge/ge/cfx_unicodeencoding.cpp

Issue 2377393002: Move core/fxge/include to core/fxge (Closed)
Patch Set: Rebase to master Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « core/fxge/ge/cfx_substfont.cpp ('k') | core/fxge/ge/cfx_unicodeencodingex.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fxge/include/cfx_unicodeencoding.h" 7 #include "core/fxge/cfx_unicodeencoding.h"
8 8
9 #include "core/fxge/include/fx_font.h" 9 #include "core/fxge/fx_font.h"
10 #include "core/fxge/include/fx_freetype.h" 10 #include "core/fxge/fx_freetype.h"
11 11
12 CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont) : m_pFont(pFont) {} 12 CFX_UnicodeEncoding::CFX_UnicodeEncoding(CFX_Font* pFont) : m_pFont(pFont) {}
13 13
14 CFX_UnicodeEncoding::~CFX_UnicodeEncoding() {} 14 CFX_UnicodeEncoding::~CFX_UnicodeEncoding() {}
15 15
16 uint32_t CFX_UnicodeEncoding::GlyphFromCharCode(uint32_t charcode) { 16 uint32_t CFX_UnicodeEncoding::GlyphFromCharCode(uint32_t charcode) {
17 FXFT_Face face = m_pFont->GetFace(); 17 FXFT_Face face = m_pFont->GetFace();
18 if (!face) 18 if (!face)
19 return charcode; 19 return charcode;
20 20
21 if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0) 21 if (FXFT_Select_Charmap(face, FXFT_ENCODING_UNICODE) == 0)
22 return FXFT_Get_Char_Index(face, charcode); 22 return FXFT_Get_Char_Index(face, charcode);
23 23
24 if (m_pFont->GetSubstFont() && 24 if (m_pFont->GetSubstFont() &&
25 m_pFont->GetSubstFont()->m_Charset == FXFONT_SYMBOL_CHARSET) { 25 m_pFont->GetSubstFont()->m_Charset == FXFONT_SYMBOL_CHARSET) {
26 uint32_t index = 0; 26 uint32_t index = 0;
27 if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0) 27 if (FXFT_Select_Charmap(face, FXFT_ENCODING_MS_SYMBOL) == 0)
28 index = FXFT_Get_Char_Index(face, charcode); 28 index = FXFT_Get_Char_Index(face, charcode);
29 if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN)) 29 if (!index && !FXFT_Select_Charmap(face, FXFT_ENCODING_APPLE_ROMAN))
30 return FXFT_Get_Char_Index(face, charcode); 30 return FXFT_Get_Char_Index(face, charcode);
31 } 31 }
32 return charcode; 32 return charcode;
33 } 33 }
OLDNEW
« no previous file with comments | « core/fxge/ge/cfx_substfont.cpp ('k') | core/fxge/ge/cfx_unicodeencodingex.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698