Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
fx_unicode.h
Go to the documentation of this file.
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 CORE_FXCRT_FX_UNICODE_H_
8#define CORE_FXCRT_FX_UNICODE_H_
9
10#include <stdint.h>
11
12// NOTE: Order matters, less-than/greater-than comparisons are used.
13enum class FX_BIDICLASS : uint8_t {
14 kON = 0, // Other Neutral
15 kL = 1, // Left Letter
16 kR = 2, // Right Letter
17 kAN = 3, // Arabic Number
18 kEN = 4, // European Number
19 kAL = 5, // Arabic Letter
20 kNSM = 6, // Non-spacing Mark
21 kCS = 7, // Common Number Separator
22 kES = 8, // European Separator
23 kET = 9, // European Number Terminator
24 kBN = 10, // Boundary Neutral
25 kS = 11, // Segment Separator
26 kWS = 12, // Whitespace
27 kB = 13, // Paragraph Separator
28 kRLO = 14, // Right-to-Left Override
29 kRLE = 15, // Right-to-Left Embedding
30 kLRO = 16, // Left-to-Right Override
31 kLRE = 17, // Left-to-Right Embedding
32 kPDF = 18, // Pop Directional Format
33 kN = kON,
34};
35
36#ifdef PDF_ENABLE_XFA
37// As defined in http://www.unicode.org/reports/tr14
38enum class FX_BREAKPROPERTY : uint8_t {
39 kOP = 0,
40 kCL = 1,
41 kQU = 2,
42 kGL = 3,
43 kNS = 4,
44 kEX = 5,
45 kSY = 6,
46 kIS = 7,
47 kPR = 8,
48 kPO = 9,
49 kNU = 10,
50 kAL = 11,
51 kID = 12,
52 kIN = 13,
53 kHY = 14,
54 kBA = 15,
55 kBB = 16,
56 kB2 = 17,
57 kZW = 18,
58 kCM = 19,
59 kWJ = 20,
60 kH2 = 21,
61 kH3 = 22,
62 kJL = 23,
63 kJV = 24,
64 kJT = 25,
65 kBK = 26,
66 kCR = 27,
67 kLF = 28,
68 kNL = 29,
69 kSA = 30,
70 kSG = 31,
71 kCB = 32,
72 kXX = 33,
73 kAI = 34,
74 kSP = 35,
75 kNONE = 36,
76 kTB = 37,
77};
78
79enum class FX_CHARTYPE : uint8_t {
80 kUnknown = 0,
81 kTab,
82 kSpace,
83 kControl,
84 kCombination,
85 kNumeric,
86 kNormal,
87 kArabicAlef,
88 kArabicSpecial,
89 kArabicDistortion,
90 kArabicNormal,
91 kArabicForm,
92 kArabic,
93};
94#endif // PDF_ENABLE_XFA
95
96namespace pdfium {
97namespace unicode {
98
99constexpr wchar_t kRightSingleQuotationMark = 0x2019;
100constexpr wchar_t kLineSeparator = 0x2028;
101constexpr wchar_t kParagraphSeparator = 0x2029;
102constexpr wchar_t kBoxDrawingsLightVerical = 0x2502;
103constexpr wchar_t kZeroWidthNoBreakSpace = 0xfeff;
104
105wchar_t GetMirrorChar(wchar_t wch);
106FX_BIDICLASS GetBidiClass(wchar_t wch);
107
108#ifdef PDF_ENABLE_XFA
110
111// Analagous to ULineBreak in icu's uchar.h, but permuted order, and a
112// subset lacking some more recent additions.
114#endif // PDF_ENABLE_XFA
115
116} // namespace unicode
117} // namespace pdfium
118
119#endif // CORE_FXCRT_FX_UNICODE_H_
CFX_FloatRect(const FX_RECT &rect)
FX_RECT GetOuterRect() const
static constexpr uint32_t MakeTag(char c1, char c2, char c3, char c4)
CFX_FloatRect TransformRect(const CFX_FloatRect &rect) const
CFX_Matrix(float a1, float b1, float c1, float d1, float e1, float f1)
~CPDF_CIDFont() override
size_t CountChar(ByteStringView pString) const override
uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const override
bool IsCIDFont() const override
const uint8_t * GetCIDTransform(uint16_t cid) const
bool IsUnicodeCompatible() const override
int AppendChar(char *str, uint32_t charcode) const override
CFX_Point16 GetVertOrigin(uint16_t cid) const
int GetCharWidthF(uint32_t charcode) override
const CPDF_CIDFont * AsCIDFont() const override
uint16_t CIDFromCharCode(uint32_t charcode) const
bool Load() override
int GlyphFromCharCode(uint32_t charcode, bool *pVertGlyph) override
int16_t GetVertWidth(uint16_t cid) const
FX_RECT GetCharBBox(uint32_t charcode) override
static float CIDTransformToFloat(uint8_t ch)
bool IsVertWriting() const override
uint32_t CharCodeFromUnicode(wchar_t Unicode) const override
int GetCharSize(uint32_t charcode) const
WideString UnicodeFromCharCode(uint32_t charcode) const override
CPDF_CIDFont * AsCIDFont() override
static CIDSet CharsetFromOrdering(ByteStringView ordering)
CPDF_CMapParser(CPDF_CMap *pCMap)
void ParseWord(ByteStringView word)
bool IsVertWriting() const
Definition cpdf_cmap.h:61
void SetVertical(bool vert)
Definition cpdf_cmap.h:70
~CPDF_CMap() override
static constexpr size_t kDirectMapTableSize
Definition cpdf_cmap.h:37
CIDCoding GetCoding() const
Definition cpdf_cmap.h:75
size_t CountChar(ByteStringView pString) const
uint32_t GetNextChar(ByteStringView pString, size_t *pOffset) const
int AppendChar(char *str, uint32_t charcode) const
void SetCharset(CIDSet set)
Definition cpdf_cmap.h:78
bool IsLoaded() const
Definition cpdf_cmap.h:60
@ MixedTwoBytes
Definition cpdf_cmap.h:42
@ MixedFourBytes
Definition cpdf_cmap.h:43
const fxcmap::CMap * GetEmbedMap() const
Definition cpdf_cmap.h:76
uint16_t CIDFromCharCode(uint32_t charcode) const
void SetAdditionalMappings(std::vector< CIDRange > mappings)
int GetCharSize(uint32_t charcode) const
bool IsDirectCharcodeToCIDTableIsEmpty() const
Definition cpdf_cmap.h:83
void SetMixedFourByteLeadingRanges(std::vector< CodeRange > ranges)
CIDSet GetCharset() const
Definition cpdf_cmap.h:77
void SetDirectCharcodeToCIDTableRange(uint32_t start_code, uint32_t end_code, uint16_t start_cid)
void SetCodingScheme(CodingScheme scheme)
Definition cpdf_cmap.h:71
static CPDF_FontGlobals * GetInstance()
void LoadFontDescriptor(const CPDF_Dictionary *pFontDesc)
virtual uint32_t CharCodeFromUnicode(wchar_t Unicode) const
static bool UseTTCharmapMacRoman(const RetainPtr< CFX_Face > &face)
Definition cpdf_font.h:152
static bool UseTTCharmapMSUnicode(const RetainPtr< CFX_Face > &face)
Definition cpdf_font.h:146
virtual WideString UnicodeFromCharCode(uint32_t charcode) const
static FX_RECT GetCharBBoxForFace(const RetainPtr< CFX_Face > &face)
void CheckFontMetrics()
bool IsEmbedded() const
Definition cpdf_font.h:101
bool operator==(const char *ptr) const
pdfium::span< T > last(size_t count)
pdfium::span< const T > subspan(size_t offset, size_t count=pdfium::dynamic_extent) const
static FixedSizeDataVector Uninit(size_t size)
operator pdfium::span< const T >() const
pdfium::span< const T > first(size_t count) const
FixedSizeDataVector(FixedSizeDataVector< T > &&that) noexcept
FixedSizeDataVector(const FixedSizeDataVector &)=delete
pdfium::span< T > first(size_t count)
static FixedSizeDataVector TryZeroed(size_t size)
static FixedSizeDataVector Zeroed(size_t size)
pdfium::span< const T > last(size_t count) const
FixedSizeDataVector & operator=(const FixedSizeDataVector &)=delete
pdfium::span< T > subspan(size_t offset, size_t count=pdfium::dynamic_extent)
FixedSizeDataVector & operator=(FixedSizeDataVector< T > &&that) noexcept
WideString(wchar_t ch)
CharType operator[](const size_t index) const
Definition widestring.h:146
bool IsEmpty() const
Definition widestring.h:118
CIDSet
@ CIDSET_JAPAN1
@ CIDSET_UNKNOWN
@ CIDSET_GB1
@ CIDSET_NUM_SETS
CIDCoding
Definition cpdf_cmap.h:24
uint32_t CharCodeFromUnicodeForEncoding(fxge::FontEncoding encoding, wchar_t unicode)
FontEncoding
FX_CodePage FX_GetCodePageFromCharset(FX_Charset charset)
size_t FX_WideCharToMultiByte(FX_CodePage codepage, WideStringView wstr, pdfium::span< char > buf)
FX_Charset
Definition fx_codepage.h:70
@ kChineseTraditional
@ kMSWin_EasternEuropean
@ kChineseSimplified
@ kMAC_ChineseTraditional
@ kMAC_ChineseSimplified
@ kMAC_EasternEuropean
size_t FX_MultiByteToWideChar(FX_CodePage codepage, ByteStringView bstr, pdfium::span< wchar_t > buf)
const FX_CharsetUnicodes kFX_CharsetUnicodes[8]
FX_Charset FX_GetCharsetFromCodePage(FX_CodePage codepage)
FX_CodePage FX_GetACP()
FX_Charset FX_GetCharsetFromInt(int value)
FX_CodePage
Definition fx_codepage.h:18
@ kMSWin_EasternEuropean
@ kMAC_ChineseTraditional
@ kMAC_ChineseSimplified
@ kMAC_EasternEuropean
@ kMSDOS_EasternEuropean
@ kMSDOS_FrenchCanadian
@ kMSWin_WesternEuropean
@ kMSDOS_WesternEuropean
bool FX_CharSetIsCJK(FX_Charset uCharset)
wchar_t UnicodeFromAdobeName(const char *name)
Definition fx_font.cpp:138
#define FXFONT_FW_NORMAL
Definition fx_font.h:22
FX_BIDICLASS
Definition fx_unicode.h:13
constexpr wchar_t kBoxDrawingsLightVerical
Definition fx_unicode.h:102
wchar_t GetMirrorChar(wchar_t wch)
constexpr wchar_t kZeroWidthNoBreakSpace
Definition fx_unicode.h:103
constexpr wchar_t kRightSingleQuotationMark
Definition fx_unicode.h:99
constexpr wchar_t kLineSeparator
Definition fx_unicode.h:100
FX_BIDICLASS GetBidiClass(wchar_t wch)
constexpr wchar_t kParagraphSeparator
Definition fx_unicode.h:101
#define CONSTRUCT_VIA_MAKE_RETAIN
Definition retain_ptr.h:224
uint16_t m_StartCID
Definition cpdf_cmap.h:55
uint32_t m_StartCode
Definition cpdf_cmap.h:53
uint8_t m_Lower[4]
Definition cpdf_cmap.h:48
uint8_t m_Upper[4]
Definition cpdf_cmap.h:49
FX_Charset m_Charset
UNOWNED_PTR_EXCLUSION const uint16_t * m_pUnicodes
FX_RECT & operator=(const FX_RECT &that)=default
int32_t bottom
int32_t right
int32_t top
constexpr FX_RECT(int l, int t, int r, int b)
#define UNOWNED_PTR_EXCLUSION