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

Side by Side Diff: core/fpdfapi/fpdf_font/cpdf_fontencoding.cpp

Issue 1832173003: Remove FX_DWORD from core/ and delete definition (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_font/cpdf_simplefont.h » ('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/fpdfapi/fpdf_font/include/cpdf_fontencoding.h" 7 #include "core/fpdfapi/fpdf_font/include/cpdf_fontencoding.h"
8 8
9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h" 9 #include "core/fpdfapi/fpdf_parser/include/cpdf_name.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_array.h"
(...skipping 1613 matching lines...) Expand 10 before | Expand all | Expand 10 after
1624 "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", 1624 "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132",
1625 "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", 1625 "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141",
1626 "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", 1626 "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150",
1627 "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", 1627 "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159",
1628 "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", 1628 "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167",
1629 "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", 1629 "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175",
1630 "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", 1630 "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200",
1631 "a182", NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198", 1631 "a182", NULL, "a201", "a183", "a184", "a197", "a185", "a194", "a198",
1632 "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL}; 1632 "a186", "a195", "a187", "a188", "a189", "a190", "a191", NULL};
1633 1633
1634 FX_DWORD PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) { 1634 uint32_t PDF_FindCode(const uint16_t* pCodes, uint16_t unicode) {
1635 for (FX_DWORD i = 0; i < 256; i++) 1635 for (uint32_t i = 0; i < 256; i++)
1636 if (pCodes[i] == unicode) 1636 if (pCodes[i] == unicode)
1637 return i; 1637 return i;
1638 return 0; 1638 return 0;
1639 } 1639 }
1640 1640
1641 } // namespace 1641 } // namespace
1642 1642
1643 CPDF_FontEncoding::CPDF_FontEncoding() { 1643 CPDF_FontEncoding::CPDF_FontEncoding() {
1644 FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes)); 1644 FXSYS_memset(m_Unicodes, 0, sizeof(m_Unicodes));
1645 } 1645 }
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 pDiff->Add(new CPDF_Number(i)); 1706 pDiff->Add(new CPDF_Number(i));
1707 pDiff->Add(new CPDF_Name(PDF_AdobeNameFromUnicode(m_Unicodes[i]))); 1707 pDiff->Add(new CPDF_Name(PDF_AdobeNameFromUnicode(m_Unicodes[i])));
1708 } 1708 }
1709 1709
1710 CPDF_Dictionary* pDict = new CPDF_Dictionary; 1710 CPDF_Dictionary* pDict = new CPDF_Dictionary;
1711 pDict->SetAtName("BaseEncoding", "WinAnsiEncoding"); 1711 pDict->SetAtName("BaseEncoding", "WinAnsiEncoding");
1712 pDict->SetAt("Differences", pDiff); 1712 pDict->SetAt("Differences", pDiff);
1713 return pDict; 1713 return pDict;
1714 } 1714 }
1715 1715
1716 FX_DWORD FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) { 1716 uint32_t FT_CharCodeFromUnicode(int encoding, FX_WCHAR unicode) {
1717 switch (encoding) { 1717 switch (encoding) {
1718 case FXFT_ENCODING_UNICODE: 1718 case FXFT_ENCODING_UNICODE:
1719 return unicode; 1719 return unicode;
1720 case FXFT_ENCODING_ADOBE_STANDARD: 1720 case FXFT_ENCODING_ADOBE_STANDARD:
1721 return PDF_FindCode(StandardEncoding, unicode); 1721 return PDF_FindCode(StandardEncoding, unicode);
1722 case FXFT_ENCODING_ADOBE_EXPERT: 1722 case FXFT_ENCODING_ADOBE_EXPERT:
1723 return PDF_FindCode(MacExpertEncoding, unicode); 1723 return PDF_FindCode(MacExpertEncoding, unicode);
1724 case FXFT_ENCODING_ADOBE_LATIN_1: 1724 case FXFT_ENCODING_ADOBE_LATIN_1:
1725 return PDF_FindCode(AdobeWinAnsiEncoding, unicode); 1725 return PDF_FindCode(AdobeWinAnsiEncoding, unicode);
1726 case FXFT_ENCODING_APPLE_ROMAN: 1726 case FXFT_ENCODING_APPLE_ROMAN:
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
1789 case PDFFONT_ENCODING_ADOBE_SYMBOL: 1789 case PDFFONT_ENCODING_ADOBE_SYMBOL:
1790 return AdobeSymbolEncodingNames[charcode]; 1790 return AdobeSymbolEncodingNames[charcode];
1791 case PDFFONT_ENCODING_ZAPFDINGBATS: 1791 case PDFFONT_ENCODING_ZAPFDINGBATS:
1792 return ZapfEncodingNames[charcode]; 1792 return ZapfEncodingNames[charcode];
1793 case PDFFONT_ENCODING_PDFDOC: 1793 case PDFFONT_ENCODING_PDFDOC:
1794 return PDFDocEncodingNames[charcode]; 1794 return PDFDocEncodingNames[charcode];
1795 } 1795 }
1796 return nullptr; 1796 return nullptr;
1797 } 1797 }
1798 1798
1799 FX_WCHAR FT_UnicodeFromCharCode(int encoding, FX_DWORD charcode) { 1799 FX_WCHAR FT_UnicodeFromCharCode(int encoding, uint32_t charcode) {
1800 switch (encoding) { 1800 switch (encoding) {
1801 case FXFT_ENCODING_UNICODE: 1801 case FXFT_ENCODING_UNICODE:
1802 return (uint16_t)charcode; 1802 return (uint16_t)charcode;
1803 case FXFT_ENCODING_ADOBE_STANDARD: 1803 case FXFT_ENCODING_ADOBE_STANDARD:
1804 return StandardEncoding[(uint8_t)charcode]; 1804 return StandardEncoding[(uint8_t)charcode];
1805 case FXFT_ENCODING_ADOBE_EXPERT: 1805 case FXFT_ENCODING_ADOBE_EXPERT:
1806 return MacExpertEncoding[(uint8_t)charcode]; 1806 return MacExpertEncoding[(uint8_t)charcode];
1807 case FXFT_ENCODING_ADOBE_LATIN_1: 1807 case FXFT_ENCODING_ADOBE_LATIN_1:
1808 return AdobeWinAnsiEncoding[(uint8_t)charcode]; 1808 return AdobeWinAnsiEncoding[(uint8_t)charcode];
1809 case FXFT_ENCODING_APPLE_ROMAN: 1809 case FXFT_ENCODING_APPLE_ROMAN:
1810 return MacRomanEncoding[(uint8_t)charcode]; 1810 return MacRomanEncoding[(uint8_t)charcode];
1811 case PDFFONT_ENCODING_PDFDOC: 1811 case PDFFONT_ENCODING_PDFDOC:
1812 return PDFDocEncoding[(uint8_t)charcode]; 1812 return PDFDocEncoding[(uint8_t)charcode];
1813 } 1813 }
1814 return 0; 1814 return 0;
1815 } 1815 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_font/cpdf_font.cpp ('k') | core/fpdfapi/fpdf_font/cpdf_simplefont.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698