• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2017 PDFium Authors. All rights reserved.
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_LAYOUT_CFX_CHAR_H_
8 #define XFA_FGAS_LAYOUT_CFX_CHAR_H_
9 
10 #include <stdint.h>
11 
12 #include <vector>
13 
14 #include "core/fxcrt/fx_unicode.h"
15 #include "core/fxcrt/retain_ptr.h"
16 #include "xfa/fgas/layout/cfx_textuserdata.h"
17 #include "xfa/fgas/layout/fx_linebreak.h"
18 
19 enum class CFX_BreakType : uint8_t { None = 0, Piece, Line, Paragraph, Page };
20 
21 class CFX_Char {
22  public:
23   static void BidiLine(std::vector<CFX_Char>* chars, size_t iCount);
24 
25   explicit CFX_Char(uint16_t wCharCode);
26   CFX_Char(uint16_t wCharCode,
27            int32_t iHorizontalScale,
28            int32_t iVerticalScale);
29   CFX_Char(const CFX_Char& other);
30   ~CFX_Char();
31 
32   FX_CHARTYPE GetCharType() const;
33 
char_code()34   uint16_t char_code() const { return m_wCharCode; }
horizonal_scale()35   int16_t horizonal_scale() const { return m_iHorizontalScale; }
vertical_scale()36   int16_t vertical_scale() const { return m_iVerticalScale; }
37 
38   CFX_BreakType m_dwStatus = CFX_BreakType::None;
39   FX_BIDICLASS m_iBidiClass = FX_BIDICLASS::kON;
40   FX_LINEBREAKTYPE m_eLineBreakType = FX_LINEBREAKTYPE::kUNKNOWN;
41   uint32_t m_dwCharStyles = 0;
42   int32_t m_iCharWidth = 0;
43   uint16_t m_iBidiLevel = 0;
44   uint16_t m_iBidiPos = 0;
45   uint16_t m_iBidiOrder = 0;
46   int32_t m_iFontSize = 0;
47   uint32_t m_dwIdentity = 0;
48   RetainPtr<CFX_TextUserData> m_pUserData;
49 
50  private:
51   uint16_t m_wCharCode;
52   int32_t m_iHorizontalScale;
53   int32_t m_iVerticalScale;
54 };
55 
56 #endif  // XFA_FGAS_LAYOUT_CFX_CHAR_H_
57