本文整理汇总了C++中setFontSize函数的典型用法代码示例。如果您正苦于以下问题:C++ setFontSize函数的具体用法?C++ setFontSize怎么用?C++ setFontSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setFontSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LLLineBuffer
LLConsole::LLConsole(const std::string& name, const LLRect &rect,
S32 font_size_index, F32 persist_time )
: LLLineBuffer(),
LLView(name, rect, FALSE),
mLinePersistTime(persist_time),
mFadeTime(persist_time - FADE_DURATION),
mFont(LLFontGL::getFontSansSerif()),
mConsoleWidth(0),
mConsoleHeight(0)
{
mTimer.reset();
setFontSize( font_size_index );
}
示例2: setWidth
// Constructor
Counter::Counter(int newWidth, int newHeight, int newX, int newY, int newFontSize, string newMessage, int newCountValue)
{
setWidth(newWidth);
setHeight(newHeight);
setX(newX);
setY(newY);
setFontSize(newFontSize);
setMessage(newMessage);
renderBox();
setCountValue(newCountValue);
}
示例3: setFontName
void Text::copySpecialProperties(Widget *widget)
{
Text* label = dynamic_cast<Text*>(widget);
if (label)
{
setFontName(label->_fontName);
setFontSize(label->getFontSize());
setString(label->getString());
setTouchScaleChangeEnabled(label->_touchScaleChangeEnabled);
setTextHorizontalAlignment(label->_labelRenderer->getHorizontalAlignment());
setTextVerticalAlignment(label->_labelRenderer->getVerticalAlignment());
setTextAreaSize(label->_labelRenderer->getDimensions());
}
}
示例4: setFontSize
void RichTextLabel::setTextProps(TextField* t)
{
if (t) {
setFontSize(t->getFontSize());
setFont(t->getFont());
colorGrp.setColor(QPalette::Text, t->getColor());
QTextCharFormat format;
format.setForeground(QBrush(colorGrp.color(QPalette::Text)));
QTextCursor cursor(text);
cursor.select(QTextCursor::Document);
cursor.mergeCharFormat(format);
}
}
示例5: LLFixedBuffer
LLConsole::LLConsole(const std::string& name, const U32 max_lines, const LLRect &rect,
S32 font_size_index, F32 persist_time )
:
LLFixedBuffer(max_lines),
LLView(name, rect, FALSE),
mLastBoxHeight(0),
mLastBoxWidth(0)
{
mLinePersistTime = persist_time; // seconds
mFadeTime = persist_time - FADE_DURATION;
setFontSize( font_size_index );
setMaxLines(gSavedSettings.getS32("ConsoleMaxLines"));
}
示例6: fontSize
LabelWidget::LabelWidget
(
const string &label,
const vec2 &pos
)
: fontSize(FONT_SIZE_NORMAL),
font(0)
{
setFont(g_Application.fontLarge);
setFontSize(FONT_SIZE_NORMAL);
setLabel(label);
setColor(white);
setRelativePos(pos);
}
示例7: LLUICtrl
LLConsole::LLConsole(const LLConsole::Params& p)
: LLUICtrl(p),
LLFixedBuffer(p.max_lines),
mLinePersistTime(p.persist_time), // seconds
mFont(p.font),
mConsoleWidth(0),
mConsoleHeight(0)
{
if (p.font_size_index.isProvided())
{
setFontSize(p.font_size_index);
}
mFadeTime = mLinePersistTime - FADE_DURATION;
setMaxLines(LLUI::sSettingGroups["config"]->getS32("ConsoleMaxLines"));
}
示例8: _callback
MenuButton::MenuButton(const char* label, std::tr1::function<void ()> callback) :
osgWidget::Label("", ""),
_callback(callback)
{
// styling
setFont("fonts/times.ttf");
setFontSize(MENU_BUTTON_FONT_SIZE);
setFontColor(MENU_BUTTON_FONT_COLOR);
setLabel(label);
setPadding(MENU_BUTTON_PADDING);
setAlignHorizontal(osgWidget::Widget::HA_LEFT);
// activate event handling for mouse clicks and moves
setEventMask(osgWidget::EVENT_MOUSE_PUSH | osgWidget::EVENT_MASK_MOUSE_MOVE);
}
示例9: open
//////////////////////////////////////////////////////////////////////////////////////////
// RtfWriter::open
//! Initialises the writer
//!
//! \param[in] const* font - Font name
//! \param[in] size - Font size in points
//! \param[in] const& cols - List of colours
//!
//! \throw wtl::logic_error - [Debug only] Writer is already open
//! \throw wtl::domain_error - I/O error occurred
//////////////////////////////////////////////////////////////////////////////////////////
void open(const char* font, UINT size, const std::list<COLORREF>& cols)
{
// Check stream is closed
if (!Closed)
throw wtl::logic_error(HERE, "Writer is already open");
Closed = false;
// Copy colours
for (COLORREF c : cols)
Colours.push_back(c);
// Write header
writeHeader(font);
setFontSize(size);
}
示例10: setFlagEnableAtStartup
void PointerCoordinates::loadConfiguration(void)
{
conf->beginGroup("PointerCoordinates");
setFlagEnableAtStartup(conf->value("enable_at_startup", false).toBool());
textColor = StelUtils::strToVec3f(conf->value("text_color", "1,0.5,0").toString());
setFontSize(conf->value("font_size", 14).toInt());
flagShowCoordinatesButton = conf->value("flag_show_button", true).toBool();
setCurrentCoordinatesPlaceKey(conf->value("current_displaying_place", "TopRight").toString());
setCurrentCoordinateSystemKey(conf->value("current_coordinate_system", "RaDecJ2000").toString());
QStringList cc = conf->value("custom_coordinates", "1,1").toString().split(",");
setCustomCoordinatesPlace(cc[0].toInt(), cc[1].toInt());
conf->endGroup();
}
示例11: ColorLabel
ColorLabel(const char* label):
osgWidget::Label(label, "") {
setFont("fonts/VeraMono.ttf");
setFontSize(14);
setFontColor(1.0f, 1.0f, 1.0f, 1.0f);
setColor(0.3f, 0.3f, 0.3f, 1.0f);
setPadding(2.0f);
setCanFill(true);
addSize(150.0f, 25.0f);
setLabel(label);
setEventMask(osgWidget::EVENT_MOUSE_PUSH | osgWidget::EVENT_MASK_MOUSE_MOVE);
}
示例12: clearScreen
void CTFTSerial::setLockoutInt()
{
// Clear the screen
clearScreen();
setFontSize(FONT_LARGE);
// Draw MMDVM logo
displayBitmap(0U, 0U, "MMDVM_sm.bmp");
gotoPosPixel(20U, 60U);
displayText("LOCKOUT");
m_mode = MODE_LOCKOUT;
}
示例13: OverlayWidget
InfoOverlay::InfoOverlay(QWidget *parent)
: OverlayWidget(parent),
fm(NULL)
{
setPalette(Qt::transparent);
setAttribute(Qt::WA_TransparentForMouseEvents);
textMarginX = 8;
textMarginY = 4;
textColor.setRgb(255, 255, 255, 255);
textShadowColor.setRgb(0, 0, 0, 200);
bgColor.setRgb(0, 0, 0, 90);
setFontSize(11);
setText("No file opened.");
hide();
}
示例14: setFontSize
void TextOverlay::setProperties(const QScriptValue& properties) {
Overlay2D::setProperties(properties);
_qmlElement->setX(_bounds.left());
_qmlElement->setY(_bounds.top());
_qmlElement->setWidth(_bounds.width());
_qmlElement->setHeight(_bounds.height());
_qmlElement->settextColor(toQmlColor(vec4(toGlm(_color), _alpha)));
QScriptValue font = properties.property("font");
if (font.isObject()) {
if (font.property("size").isValid()) {
setFontSize(font.property("size").toInt32());
}
QFont font(_qmlElement->fontFamily());
font.setPixelSize(_qmlElement->fontSize());
QFontMetrics fm(font);
_qmlElement->setlineHeight(fm.lineSpacing() * 1.2);
}
QScriptValue text = properties.property("text");
if (text.isValid()) {
setText(text.toVariant().toString());
}
QScriptValue backgroundColor = properties.property("backgroundColor");
if (backgroundColor.isValid()) {
QScriptValue red = backgroundColor.property("red");
QScriptValue green = backgroundColor.property("green");
QScriptValue blue = backgroundColor.property("blue");
if (red.isValid() && green.isValid() && blue.isValid()) {
_backgroundColor.red = red.toVariant().toInt();
_backgroundColor.green = green.toVariant().toInt();
_backgroundColor.blue = blue.toVariant().toInt();
}
}
if (properties.property("backgroundAlpha").isValid()) {
_backgroundAlpha = properties.property("backgroundAlpha").toVariant().toFloat();
}
_qmlElement->setbackgroundColor(toQmlColor(vec4(toGlm(_backgroundColor), _backgroundAlpha)));
if (properties.property("leftMargin").isValid()) {
setLeftMargin(properties.property("leftMargin").toVariant().toInt());
}
if (properties.property("topMargin").isValid()) {
setTopMargin(properties.property("topMargin").toVariant().toInt());
}
}
示例15: setFontSize
void TextLabel::setTextProps(TextField *field)
{
if (field) {
text = *field;
//lineHeight = t->getLineHeight();
shadow = field->getShadow();
alignment = field->getAlignment();
setFontSize(field->getFontSize());
setFont(field->getFont());
setColor(field->getColor());
setBGColor(field->getBGColor());
}
calculateTextSize();
}