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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 FXFT_Face face = m_pFont->GetFace(); | 515 FXFT_Face face = m_pFont->GetFace(); |
516 int nmaps = FXFT_Get_Face_CharmapCount(face); | 516 int nmaps = FXFT_Get_Face_CharmapCount(face); |
517 for (int i = 0; i < nmaps; i++) { | 517 for (int i = 0; i < nmaps; i++) { |
518 int nEncodingID = | 518 int nEncodingID = |
519 FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i]); | 519 FXFT_Get_Charmap_Encoding(FXFT_Get_Face_Charmaps(face)[i]); |
520 if (nEncodingID == FXFM_ENCODING_UNICODE || | 520 if (nEncodingID == FXFM_ENCODING_UNICODE || |
521 nEncodingID == FXFM_ENCODING_MS_SYMBOL) { | 521 nEncodingID == FXFM_ENCODING_MS_SYMBOL) { |
522 return Unicode; | 522 return Unicode; |
523 } | 523 } |
524 } | 524 } |
525 return -1; | 525 return static_cast<FX_DWORD>(-1); |
526 } | 526 } |
527 | 527 |
528 CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(CFX_Font* pFont, | 528 CFX_UnicodeEncodingEx* FX_CreateFontEncodingEx(CFX_Font* pFont, |
529 FX_DWORD nEncodingID) { | 529 FX_DWORD nEncodingID) { |
530 if (!pFont || !pFont->GetFace()) | 530 if (!pFont || !pFont->GetFace()) |
531 return nullptr; | 531 return nullptr; |
532 | 532 |
533 if (nEncodingID != FXFM_ENCODING_NONE) | 533 if (nEncodingID != FXFM_ENCODING_NONE) |
534 return _FXFM_CreateFontEncoding(pFont, nEncodingID); | 534 return _FXFM_CreateFontEncoding(pFont, nEncodingID); |
535 | 535 |
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 |