本文整理汇总了C++中TextRun::allowsTrailingExpansion方法的典型用法代码示例。如果您正苦于以下问题:C++ TextRun::allowsTrailingExpansion方法的具体用法?C++ TextRun::allowsTrailingExpansion怎么用?C++ TextRun::allowsTrailingExpansion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextRun
的用法示例。
在下文中一共展示了TextRun::allowsTrailingExpansion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: it
TextRunComponent::TextRunComponent(const UChar *start, int length, const TextRun& parentTextRun, const Font &font, int o)
: m_textRun(start, length, 0, 0
, parentTextRun.allowsTrailingExpansion() ? TextRun::AllowTrailingExpansion : TextRun::ForbidTrailingExpansion
, parentTextRun.direction()
, parentTextRun.directionalOverride())
, m_offset(o)
, m_spaces(0)
{
m_textRun.setTabSize(parentTextRun.allowTabs(), parentTextRun.tabSize());
WidthIterator it(&font, m_textRun);
it.advance(m_textRun.length(), 0);
m_width = it.m_runWidthSoFar;
}
示例2: ASSERT
ShapeResultSpacing::ShapeResultSpacing(const TextRun& run,
const FontDescription& fontDescription)
: m_textRun(run)
, m_letterSpacing(fontDescription.letterSpacing())
, m_wordSpacing(fontDescription.wordSpacing())
, m_expansion(run.expansion())
, m_expansionPerOpportunity(0)
, m_expansionOpportunityCount(0)
, m_textJustify(TextJustify::TextJustifyAuto)
, m_hasSpacing(false)
, m_normalizeSpace(run.normalizeSpace())
, m_allowTabs(run.allowTabs())
, m_isAfterExpansion(false)
, m_isVerticalOffset(fontDescription.isVerticalAnyUpright())
{
if (m_textRun.spacingDisabled())
return;
if (!m_letterSpacing && !m_wordSpacing && !m_expansion)
return;
m_hasSpacing = true;
if (!m_expansion)
return;
// Setup for justifications (expansions.)
m_textJustify = run.getTextJustify();
m_isAfterExpansion = !run.allowsLeadingExpansion();
bool isAfterExpansion = m_isAfterExpansion;
m_expansionOpportunityCount = Character::expansionOpportunityCount(run,
isAfterExpansion);
if (isAfterExpansion && !run.allowsTrailingExpansion()) {
ASSERT(m_expansionOpportunityCount > 0);
--m_expansionOpportunityCount;
}
if (m_expansionOpportunityCount)
m_expansionPerOpportunity = m_expansion / m_expansionOpportunityCount;
}