本文整理汇总了C++中FontInfo::realize方法的典型用法代码示例。如果您正苦于以下问题:C++ FontInfo::realize方法的具体用法?C++ FontInfo::realize怎么用?C++ FontInfo::realize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontInfo
的用法示例。
在下文中一共展示了FontInfo::realize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCharFont
void Text::setCharFont(pit_type pit,
pos_type pos, Font const & fnt, Font const & display_font)
{
Buffer const & buffer = owner_->buffer();
Font font = fnt;
Layout const & layout = pars_[pit].layout();
// Get concrete layout font to reduce against
FontInfo layoutfont;
if (pos < pars_[pit].beginOfBody())
layoutfont = layout.labelfont;
else
layoutfont = layout.font;
// Realize against environment font information
if (pars_[pit].getDepth()) {
pit_type tp = pit;
while (!layoutfont.resolved() &&
tp != pit_type(paragraphs().size()) &&
pars_[tp].getDepth()) {
tp = outerHook(tp);
if (tp != pit_type(paragraphs().size()))
layoutfont.realize(pars_[tp].layout().font);
}
}
// Inside inset, apply the inset's font attributes if any
// (charstyle!)
if (!isMainText())
layoutfont.realize(display_font.fontInfo());
layoutfont.realize(buffer.params().getFont().fontInfo());
// Now, reduce font against full layout font
font.fontInfo().reduce(layoutfont);
pars_[pit].setFont(pos, font);
}
示例2: labelFont
// Note that this is supposed to return a fully realized font.
FontInfo Text::labelFont(Paragraph const & par) const
{
Buffer const & buffer = owner_->buffer();
Layout const & layout = par.layout();
if (!par.getDepth()) {
FontInfo lf = layout.reslabelfont;
// In case the default family has been customized
if (layout.labelfont.family() == INHERIT_FAMILY)
lf.setFamily(buffer.params().getFont().fontInfo().family());
return lf;
}
FontInfo font = layout.labelfont;
// Realize with the fonts of lesser depth.
font.realize(buffer.params().getFont().fontInfo());
return font;
}