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 "../../../include/fpdfapi/fpdf_page.h" | 7 #include "../../../include/fpdfapi/fpdf_page.h" |
8 #include "../../../include/fxge/fx_freetype.h" | 8 #include "../../../include/fxge/fx_freetype.h" |
9 extern FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR*); | 9 extern FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR*); |
10 const struct _UnicodeAlt { | 10 const struct _UnicodeAlt { |
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", | 468 "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", |
469 "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", | 469 "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", |
470 "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", | 470 "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", |
471 "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", | 471 "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", |
472 "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", | 472 "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", |
473 "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", | 473 "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", |
474 "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", | 474 "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", |
475 NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198", | 475 NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198", |
476 "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL | 476 "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL |
477 }; | 477 }; |
478 const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, FX_BYTE charcode
) | 478 const FX_CHAR* PDF_CharNameFromPredefinedCharSet(int encoding, uint8_t charcode
) |
479 { | 479 { |
480 if (encoding == PDFFONT_ENCODING_PDFDOC) { | 480 if (encoding == PDFFONT_ENCODING_PDFDOC) { |
481 if (charcode < 24) { | 481 if (charcode < 24) { |
482 return NULL; | 482 return NULL; |
483 } | 483 } |
484 charcode -= 24; | 484 charcode -= 24; |
485 } else { | 485 } else { |
486 if (charcode < 32) { | 486 if (charcode < 32) { |
487 return NULL; | 487 return NULL; |
488 } | 488 } |
(...skipping 16 matching lines...) Expand all Loading... |
505 return PDFDocEncodingNames[charcode]; | 505 return PDFDocEncodingNames[charcode]; |
506 } | 506 } |
507 return NULL; | 507 return NULL; |
508 } | 508 } |
509 FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) | 509 FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) |
510 { | 510 { |
511 switch (encoding) { | 511 switch (encoding) { |
512 case FXFT_ENCODING_UNICODE: | 512 case FXFT_ENCODING_UNICODE: |
513 return (FX_WORD)charcode; | 513 return (FX_WORD)charcode; |
514 case FXFT_ENCODING_ADOBE_STANDARD: | 514 case FXFT_ENCODING_ADOBE_STANDARD: |
515 return StandardEncoding[(FX_BYTE)charcode]; | 515 return StandardEncoding[(uint8_t)charcode]; |
516 case FXFT_ENCODING_ADOBE_EXPERT: | 516 case FXFT_ENCODING_ADOBE_EXPERT: |
517 return MacExpertEncoding[(FX_BYTE)charcode]; | 517 return MacExpertEncoding[(uint8_t)charcode]; |
518 case FXFT_ENCODING_ADOBE_LATIN_1: | 518 case FXFT_ENCODING_ADOBE_LATIN_1: |
519 return AdobeWinAnsiEncoding[(FX_BYTE)charcode]; | 519 return AdobeWinAnsiEncoding[(uint8_t)charcode]; |
520 case FXFT_ENCODING_APPLE_ROMAN: | 520 case FXFT_ENCODING_APPLE_ROMAN: |
521 return MacRomanEncoding[(FX_BYTE)charcode]; | 521 return MacRomanEncoding[(uint8_t)charcode]; |
522 case PDFFONT_ENCODING_PDFDOC: | 522 case PDFFONT_ENCODING_PDFDOC: |
523 return PDFDocEncoding[(FX_BYTE)charcode]; | 523 return PDFDocEncoding[(uint8_t)charcode]; |
524 } | 524 } |
525 return 0; | 525 return 0; |
526 } | 526 } |
527 static FX_DWORD PDF_FindCode(const FX_WORD* pCodes, FX_WORD unicode) | 527 static FX_DWORD PDF_FindCode(const FX_WORD* pCodes, FX_WORD unicode) |
528 { | 528 { |
529 for (FX_DWORD i = 0; i < 256; i ++) | 529 for (FX_DWORD i = 0; i < 256; i ++) |
530 if (pCodes[i] == unicode) { | 530 if (pCodes[i] == unicode) { |
531 return i; | 531 return i; |
532 } | 532 } |
533 return 0; | 533 return 0; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name) | 617 FX_WCHAR PDF_UnicodeFromAdobeName(const FX_CHAR* name) |
618 { | 618 { |
619 return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF); | 619 return (FX_WCHAR)(FXFT_unicode_from_adobe_name(name) & 0x7FFFFFFF); |
620 } | 620 } |
621 CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode) | 621 CFX_ByteString PDF_AdobeNameFromUnicode(FX_WCHAR unicode) |
622 { | 622 { |
623 char glyph_name[64]; | 623 char glyph_name[64]; |
624 FXFT_adobe_name_from_unicode(glyph_name, unicode); | 624 FXFT_adobe_name_from_unicode(glyph_name, unicode); |
625 return CFX_ByteString(glyph_name, -1); | 625 return CFX_ByteString(glyph_name, -1); |
626 } | 626 } |
OLD | NEW |