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

Side by Side Diff: core/src/fpdfapi/fpdf_font/fpdf_font_charset.cpp

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 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/src/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/src/fpdfapi/fpdf_font/fpdf_font_cid.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 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
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
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
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 }
OLDNEW
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698