7#include "xfa/fgas/layout/cfgas_break.h"
13#include "core/fxcrt/fx_safe_types.h"
14#include "core/fxcrt/stl_util.h"
15#include "xfa/fgas/font/cfgas_gefont.h"
26 m_eCharType = FX_CHARTYPE::kUnknown;
27 for (CFGAS_BreakLine& line : m_Lines)
32 m_dwLayoutStyles = dwLayoutStyles;
33 m_bSingleLine = !!(m_dwLayoutStyles & LayoutStyle::kSingleLine);
34 m_bCombText = !!(m_dwLayoutStyles & LayoutStyle::kCombText);
38 iScale =
std::max(iScale, 0);
57 if (!pFont || pFont == m_pFont)
61 m_pFont = std::move(pFont);
82 FX_SAFE_INT32 line_width = m_iLineWidth;
84 return line_width.IsValid() && width > line_width.ValueOrDie();
88 return chartype >= FX_CHARTYPE::kArabicAlef ? FX_CHARTYPE::kArabic : chartype;
100 if (wch != L'\r' && wch != L'\n')
114 if (fLineStart > fLineEnd)
119 m_pCurLine->m_iStart = std::min(m_pCurLine->m_iStart, m_iLineWidth);
120 m_pCurLine->m_iStart = std::max(m_pCurLine->m_iStart, m_iLineStart);
125 bool bRichText)
const {
126 std::vector<CFGAS_Char>& tca = m_pCurLine->m_LineChars;
127 if (!
fxcrt::IndexInBounds(tca, index))
130 int32_t iStart =
fxcrt::CollectionSize<int32_t>(tca) - 1;
131 while (iStart > -1) {
133 if (((bRichText && pTC->m_iCharWidth < 0) || bOmitChar) &&
134 pTC->GetCharType() == FX_CHARTYPE::kCombination) {
144 return HasLine() ? fxcrt::CollectionSize<int32_t>(
145 m_Lines[m_iReadyLineIndex].m_LinePieces)
150 int32_t index)
const {
153 if (!fxcrt::IndexInBounds(m_Lines[m_iReadyLineIndex].m_LinePieces, index))
155 return &m_Lines[m_iReadyLineIndex].m_LinePieces[index];
160 m_Lines[m_iReadyLineIndex].Clear();
CFGAS_Break(Mask< LayoutStyle > dwLayoutStyles)
void SetCharSpace(float fCharSpace)
int32_t m_iHorizontalScale
void SetVerticalScale(int32_t iScale)
void SetFontSize(float fFontSize)
CFGAS_Char * GetLastChar(int32_t index, bool bOmitChar, bool bRichText) const
void SetHorizontalScale(int32_t iScale)
wchar_t m_wParagraphBreakChar
const CFGAS_BreakPiece * GetBreakPieceUnstable(int32_t index) const
void SetLineBreakTolerance(float fTolerance)
void SetLineBoundary(float fLineStart, float fLineEnd)
void SetFont(RetainPtr< CFGAS_GEFont > pFont)
int32_t CountBreakPieces() const
void SetLayoutStyles(Mask< LayoutStyle > dwLayoutStyles)
bool IsGreaterThanLineWidth(int32_t width) const
void SetParagraphBreakChar(wchar_t wch)
static const float kConversionFactor
void SetTabWidth(float fTabWidth)
static const int kMinimumTabWidth
FX_CHARTYPE GetUnifiedCharType(FX_CHARTYPE dwType) const
int FXSYS_roundf(float f)