1 // Copyright 2014 The PDFium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 6 7 #ifndef XFA_FGAS_FONT_FGAS_FONTUTILS_H_ 8 #define XFA_FGAS_FONT_FGAS_FONTUTILS_H_ 9 10 #include <stdint.h> 11 12 #include "core/fxcrt/fx_codepage_forward.h" 13 #include "core/fxcrt/widestring.h" 14 15 struct FGAS_FONTUSB { 16 static constexpr uint16_t kNoBitField = 999; 17 18 uint16_t wStartUnicode; 19 uint16_t wEndUnicode; 20 uint16_t wBitField; 21 FX_CodePage wCodePage; 22 }; 23 24 const FGAS_FONTUSB* FGAS_GetUnicodeBitField(wchar_t wUnicode); 25 26 struct FGAS_FontInfo { 27 uint32_t dwFontNameHash; // WideString hash. 28 const char* pPsName; // Raw, POD struct. 29 const char* pReplaceFont; // Raw, POD struct. 30 uint16_t dwStyles; 31 FX_CodePage wCodePage; 32 }; 33 34 WideString FGAS_FontNameToEnglishName(const WideString& wsLocalName); 35 const FGAS_FontInfo* FGAS_FontInfoByFontName(WideStringView wsFontName); 36 37 #endif // XFA_FGAS_FONT_FGAS_FONTUTILS_H_ 38