本文整理汇总了C++中TextEditor::applyFontToAllText方法的典型用法代码示例。如果您正苦于以下问题:C++ TextEditor::applyFontToAllText方法的具体用法?C++ TextEditor::applyFontToAllText怎么用?C++ TextEditor::applyFontToAllText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextEditor
的用法示例。
在下文中一共展示了TextEditor::applyFontToAllText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePreviewBoxText
void updatePreviewBoxText()
{
Font* f = fonts [listBox->getSelectedRow()];
if (f != 0)
{
Font font (*f);
font.setHeight ((float) sizeSlider->getValue());
font.setBold (boldButton->getToggleState());
font.setItalic (italicButton->getToggleState());
font.setExtraKerningFactor ((float) kerningSlider->getValue());
font.setHorizontalScale ((float) horizontalScaleSlider->getValue());
textBox->applyFontToAllText (font);
}
}
示例2: refreshPreviewBoxFont
void refreshPreviewBoxFont()
{
const bool bold = boldToggle.getToggleState();
const bool italic = italicToggle.getToggleState();
const bool useStyle = ! (bold || italic);
Font font (fonts [listBox.getSelectedRow()]);
font = font.withPointHeight ((float) heightSlider.getValue())
.withExtraKerningFactor ((float) kerningSlider.getValue())
.withHorizontalScale ((float) scaleSlider.getValue());
if (bold) font = font.boldened();
if (italic) font = font.italicised();
updateStylesList (font);
styleBox.setEnabled (useStyle);
if (useStyle)
font = font.withTypefaceStyle (styleBox.getText());
demoTextBox.applyFontToAllText (font);
}