OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 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/ge/fx_text_int.h" | 7 #include "core/fxge/ge/fx_text_int.h" |
8 #include "core/include/fxge/fx_freetype.h" | 8 #include "core/include/fxge/fx_freetype.h" |
9 #include "core/include/fxge/fx_ge.h" | 9 #include "core/include/fxge/fx_ge.h" |
10 | 10 |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 481 |
482 FX_DWORD CFX_UnicodeEncodingEx::GlyphFromCharCode(FX_DWORD charcode) { | 482 FX_DWORD CFX_UnicodeEncodingEx::GlyphFromCharCode(FX_DWORD charcode) { |
483 FXFT_Face face = m_pFont->GetFace(); | 483 FXFT_Face face = m_pFont->GetFace(); |
484 FT_UInt nIndex = FXFT_Get_Char_Index(face, charcode); | 484 FT_UInt nIndex = FXFT_Get_Char_Index(face, charcode); |
485 if (nIndex > 0) { | 485 if (nIndex > 0) { |
486 return nIndex; | 486 return nIndex; |
487 } | 487 } |
488 int nmaps = FXFT_Get_Face_CharmapCount(face); | 488 int nmaps = FXFT_Get_Face_CharmapCount(face); |
489 int m = 0; | 489 int m = 0; |
490 while (m < nmaps) { | 490 while (m < nmaps) { |
491 int nEncodingID = | 491 FX_DWORD nEncodingID = |
492 FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[m++]); | 492 FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[m++]); |
493 if (m_nEncodingID == nEncodingID) { | 493 if (m_nEncodingID == nEncodingID) { |
494 continue; | 494 continue; |
495 } | 495 } |
496 int error = FXFT_Select_Charmap(face, nEncodingID); | 496 int error = FXFT_Select_Charmap(face, nEncodingID); |
497 if (error) { | 497 if (error) { |
498 continue; | 498 continue; |
499 } | 499 } |
500 nIndex = FXFT_Get_Char_Index(face, charcode); | 500 nIndex = FXFT_Get_Char_Index(face, charcode); |
501 if (nIndex > 0) { | 501 if (nIndex > 0) { |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 for (size_t i = 0; i < FX_ArraySize(g_EncodingID); ++i) { | 536 for (size_t i = 0; i < FX_ArraySize(g_EncodingID); ++i) { |
537 CFX_UnicodeEncodingEx* pFontEncoding = | 537 CFX_UnicodeEncodingEx* pFontEncoding = |
538 _FXFM_CreateFontEncoding(pFont, g_EncodingID[i]); | 538 _FXFM_CreateFontEncoding(pFont, g_EncodingID[i]); |
539 if (pFontEncoding) { | 539 if (pFontEncoding) { |
540 return pFontEncoding; | 540 return pFontEncoding; |
541 } | 541 } |
542 } | 542 } |
543 return NULL; | 543 return NULL; |
544 } | 544 } |
545 #endif // PDF_ENABLE_XFA | 545 #endif // PDF_ENABLE_XFA |
OLD | NEW |