FastUIDraw
character_encoding.hpp
1 /*!
2  * \file font.hpp
3  * \brief file font.hpp
4  *
5  * Copyright 2016 by Intel.
6  *
7  * Contact: kevin.rogovin@gmail.com
8  *
9  * This Source Code Form is subject to the
10  * terms of the Mozilla Public License, v. 2.0.
11  * If a copy of the MPL was not distributed with
12  * this file, You can obtain one at
13  * http://mozilla.org/MPL/2.0/.
14  *
15  * \author Kevin Rogovin <kevin.rogovin@gmail.com>
16  *
17  */
18 
19 
20 #ifndef FASTUIDRAW_CHARACTER_ENCODING_HPP
21 #define FASTUIDRAW_CHARACTER_ENCODING_HPP
22 
23 #include <fastuidraw/util/util.hpp>
24 
25 namespace fastuidraw
26 {
27 /*!\addtogroup Glyph
28  * @{
29  */
30 
31 /*!\def FASTUIDRAW_CHARACTER_ENCODING_VALUE
32  * Conveniance macro to define a 32-bit character encoding scheme
33  * from four unsigned 8-bit values.
34  */
35 #define FASTUIDRAW_CHARACTER_ENCODING_VALUE(a, b, c, d) \
36  (uint32_t(a) << 24u) | (uint32_t(b) << 16u) | (uint32_t(c) << 8u) | uint32_t(d)
37 
38  /*!\brief
39  * A CharacterEncoding is used to decide how to interpret
40  * characters. The value itself is just a 32-bit value that
41  * mirrors the FT_Encoding of FreeType.
42  */
43  namespace CharacterEncoding
44  {
45  /*!
46  * \brief
47  * Enumeration type to define character encodings.
48  */
49  enum encoding_value_t:uint32_t
50  {
51  /*!
52  * Unicode character set to cover all version of Unicode.
53  */
55 
56  /*!
57  * Miscrosoft Symbol Encoding; uses the character codes
58  * 0xF020 - 0xF0FF.
59  */
61 
62  /*!
63  * Shift JIS encoding for Japanese characters.
64  */
66 
67  /*!
68  * Character encoding for the Simplified Chinese of the
69  * People's Republic of China.
70  */
72 
73  /*!
74  * Characted encoding for Traditional Chinese of Taiwan
75  * and Hong Kong
76  */
78 
79  /*!
80  * Encoding of the Korean characters as Extended Wansung
81  * (MS Windows code page 949). See also
82  * https://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WindowsBestFit/bestfit949.txt
83  */
85 
86  /*!
87  * The Korean standard character set (KS C 5601-1992).
88  * This corrresponds to MS Windows code page 1361.
89  */
91 
92  /*!
93  * Latin-1 character encoding as defined by Type 1 PostScript font,
94  * limited to 256 character codes.
95  */
97 
98  /*!
99  * Adobe Standard character encoding found in Type 1, CFF and
100  * OpenType/CFF fonts, limited to 256 character codes.
101  */
103 
104  /*!
105  * Adobe Expert character encoding found in Type 1, CFF and
106  * OpenType/CFF fonts, limited to 256 character codes.
107  */
109 
110  /*!
111  * Custom character encoding found in Type 1, CFF and
112  * OpenType/CFF fonts, limited to 256 character codes.
113  */
115 
116  /*!
117  * Apply Roman character encoding; a number of TrueType and
118  * OpenType fonts have this 8-bit encoding because quite
119  * older version of Mac OS support it.
120  */
122  };
123 
124  /*!
125  * Conveniance functions to create a CharacterEncoding value
126  * from an arbitary 4-tuple of uint8_t values.
127  */
128  inline
129  enum encoding_value_t
130  chracter_encoding(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
131  {
132  uint32_t v;
133  v = FASTUIDRAW_CHARACTER_ENCODING_VALUE(a, b, c, d);
134  return static_cast<enum encoding_value_t>(v);
135  }
136  }
137 
138 }
139 
140 #endif
encoding_value_t
Enumeration type to define character encodings.
all classes and functions of FastUIDraw are in the namespace fastuidraw.
Definition: colorstop.hpp:28
enum encoding_value_t chracter_encoding(uint8_t a, uint8_t b, uint8_t c, uint8_t d)
file util.hpp
#define FASTUIDRAW_CHARACTER_ENCODING_VALUE(a, b, c, d)