当前位置: 首页>>代码示例>>C++>>正文


C++ setFontSize函数代码示例

本文整理汇总了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 );
}
开发者ID:1234-,项目名称:SingularityViewer,代码行数:14,代码来源:llconsole.cpp

示例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);
}
开发者ID:nvahrenb,项目名称:CSE20212_final_project,代码行数:15,代码来源:counter.cpp

示例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());
    }
}
开发者ID:ElvisQin,项目名称:genius-x,代码行数:14,代码来源:UIText.cpp

示例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);
    }
}
开发者ID:KDE,项目名称:superkaramba,代码行数:14,代码来源:richtextlabel.cpp

示例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"));
}
开发者ID:xinyaojiejie,项目名称:Dale,代码行数:14,代码来源:llconsole.cpp

示例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);
}
开发者ID:foxostro,项目名称:arbarlith2,代码行数:14,代码来源:labelwidget.cpp

示例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"));
}
开发者ID:Xara,项目名称:Astra-Viewer-2,代码行数:15,代码来源:llconsole.cpp

示例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);
}
开发者ID:brownman,项目名称:Starjumper,代码行数:15,代码来源:MenuButton.cpp

示例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);
    }
开发者ID:nick-crowley,项目名称:Win32-Template-Library,代码行数:26,代码来源:RichTextWriter.hpp

示例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();
}
开发者ID:PhiTheta,项目名称:stellarium,代码行数:15,代码来源:PointerCoordinates.cpp

示例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);
    }
开发者ID:151706061,项目名称:OpenSceneGraph,代码行数:15,代码来源:osganimationeasemotion.cpp

示例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;
}
开发者ID:Boromatic,项目名称:MMDVMHost,代码行数:15,代码来源:TFTSerial.cpp

示例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();
}
开发者ID:sevoan,项目名称:qimgv,代码行数:15,代码来源:infooverlay.cpp

示例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());
    }
}
开发者ID:bwent,项目名称:hifi,代码行数:48,代码来源:TextOverlay.cpp

示例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();
}
开发者ID:KDE,项目名称:superkaramba,代码行数:16,代码来源:textlabel.cpp


注:本文中的setFontSize函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。