本文整理汇总了C++中TextRun::setRTL方法的典型用法代码示例。如果您正苦于以下问题:C++ TextRun::setRTL方法的具体用法?C++ TextRun::setRTL怎么用?C++ TextRun::setRTL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextRun
的用法示例。
在下文中一共展示了TextRun::setRTL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawBidiText
void GraphicsContext::drawBidiText(const Font& font, const TextRun& run, const FloatPoint& point)
{
if (paintingDisabled())
return;
BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
WTF::Unicode::Direction paragraphDirection = run.ltr() ? WTF::Unicode::LeftToRight : WTF::Unicode::RightToLeft;
bidiResolver.setStatus(BidiStatus(paragraphDirection, paragraphDirection, paragraphDirection, new BidiContext(run.ltr() ? 0 : 1, paragraphDirection, run.directionalOverride())));
bidiResolver.setPosition(TextRunIterator(&run, 0));
bidiResolver.createBidiRunsForLine(TextRunIterator(&run, run.length()));
if (!bidiResolver.runCount())
return;
FloatPoint currPoint = point;
BidiCharacterRun* bidiRun = bidiResolver.firstRun();
while (bidiRun) {
TextRun subrun = run;
subrun.setText(run.data(bidiRun->start()), bidiRun->stop() - bidiRun->start());
subrun.setRTL(bidiRun->level() % 2);
subrun.setDirectionalOverride(bidiRun->dirOverride(false));
font.drawText(this, subrun, currPoint);
bidiRun = bidiRun->next();
// FIXME: Have Font::drawText return the width of what it drew so that we don't have to re-measure here.
if (bidiRun)
currPoint.move(font.floatWidth(subrun), 0.f);
}
bidiResolver.deleteRuns();
}