qfont.cpp
来自「pixil 最新的嵌入linux 應用程序集,別的地方很難下載」· C++ 代码 · 共 119 行
CPP
119 行
#include "qfont.h"#ifdef NEVER // *** original method saved for posterityvoid QFont::SelectFont() const{ if(weight() > Normal) fl_font(FL_COURIER+1,m_nPixelSize); else fl_font(FL_COURIER,m_nPixelSize); }#endifvoid QFont::SelectFont() const{ char fname[256]; int ftype; // determine base font strcpy(fname,(char *)m_sFamily); if(fname[0] == 0x00) ftype = FL_HELVETICA; else if(stricmp(fname,"times") == 0) ftype = FL_TIMES; else if(stricmp(fname,"courier") == 0) ftype = FL_COURIER; else ftype = FL_HELVETICA; // determine font weight if(weight() == Bold) ftype += FL_BOLD; // determine font italic if(italic() == TRUE) ftype += FL_ITALIC; // set the font fl_font(ftype,m_nPixelSize); }// CRH for qpushbuttonconst int QFont::getFont() const{ char fname[256]; int ftype; // determine base font strcpy(fname,(char *)m_sFamily); if(fname[0] == 0x00) ftype = FL_HELVETICA; else if(stricmp(fname,"times") == 0) ftype = FL_TIMES; else if(stricmp(fname,"courier") == 0) ftype = FL_COURIER; else ftype = FL_HELVETICA; // determine font weight if(weight() == Bold) ftype += FL_BOLD; // determine font italic if(italic() == TRUE) ftype += FL_ITALIC; // return the font return ftype; }QFont::QFont() { m_nPixelSize=12;}#ifdef NEVER // *** original method saved for posterityQFont::QFont ( const QString & family, int pointSize, int weight, bool italic) { m_nPixelSize = pointSize;}#endifQFont::QFont ( const QString & family, int pointSize, int weight, bool italic) { m_sFamily = family; m_nPixelSize = pointSize; m_nWeight = weight; m_bItalic = italic; m_bUnderline = false; m_bStrikeOut = false;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?