本文整理汇总了C++中TextRun::setHorizontalGlyphStretch方法的典型用法代码示例。如果您正苦于以下问题:C++ TextRun::setHorizontalGlyphStretch方法的具体用法?C++ TextRun::setHorizontalGlyphStretch怎么用?C++ TextRun::setHorizontalGlyphStretch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextRun
的用法示例。
在下文中一共展示了TextRun::setHorizontalGlyphStretch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: offsetForPositionInFragment
int SVGInlineTextBox::offsetForPositionInFragment(
const SVGTextFragment& fragment,
LayoutUnit position,
bool includePartialGlyphs) const {
LineLayoutSVGInlineText lineLayoutItem =
LineLayoutSVGInlineText(this->getLineLayoutItem());
float scalingFactor = lineLayoutItem.scalingFactor();
ASSERT(scalingFactor);
const ComputedStyle& style = lineLayoutItem.styleRef();
TextRun textRun = constructTextRun(style, fragment);
// Eventually handle lengthAdjust="spacingAndGlyphs".
// FIXME: Handle vertical text.
if (fragment.isTransformed()) {
AffineTransform fragmentTransform = fragment.buildFragmentTransform();
textRun.setHorizontalGlyphStretch(
clampTo<float>(fragmentTransform.xScale()));
}
return fragment.characterOffset - start() +
lineLayoutItem.scaledFont().offsetForPosition(
textRun, position * scalingFactor, includePartialGlyphs);
}
示例2: offsetForPositionInFragment
int SVGInlineTextBox::offsetForPositionInFragment(const SVGTextFragment& fragment, float position, bool includePartialGlyphs) const
{
float scalingFactor = renderer().scalingFactor();
ASSERT(scalingFactor);
TextRun textRun = constructTextRun(&renderer().style(), fragment);
// Eventually handle lengthAdjust="spacingAndGlyphs".
// FIXME: Handle vertical text.
AffineTransform fragmentTransform;
fragment.buildFragmentTransform(fragmentTransform);
if (!fragmentTransform.isIdentity())
textRun.setHorizontalGlyphStretch(narrowPrecisionToFloat(fragmentTransform.xScale()));
return fragment.characterOffset - start() + renderer().scaledFont().offsetForPosition(textRun, position * scalingFactor, includePartialGlyphs);
}
示例3: offsetForPositionInFragment
int SVGInlineTextBox::offsetForPositionInFragment(const SVGTextFragment& fragment, FloatWillBeLayoutUnit position, bool includePartialGlyphs) const
{
LayoutSVGInlineText& textLayoutObject = toLayoutSVGInlineText(this->layoutObject());
float scalingFactor = textLayoutObject.scalingFactor();
ASSERT(scalingFactor);
const ComputedStyle& style = textLayoutObject.styleRef();
TextRun textRun = constructTextRun(style, fragment);
// Eventually handle lengthAdjust="spacingAndGlyphs".
// FIXME: Handle vertical text.
AffineTransform fragmentTransform;
fragment.buildFragmentTransform(fragmentTransform);
if (!fragmentTransform.isIdentity())
textRun.setHorizontalGlyphStretch(narrowPrecisionToFloat(fragmentTransform.xScale()));
return fragment.characterOffset - start() + textLayoutObject.scaledFont().offsetForPosition(textRun, position * scalingFactor, includePartialGlyphs);
}