• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetFontSize函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetFontSize函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFontSize函数的具体用法?C++ GetFontSize怎么用?C++ GetFontSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetFontSize函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetFontSize

void CAbstractTextEdit::Render()
{
	CAbstractLabel::Render();
	
	if(m_Composing)
	{
		int FontSize = GetFontSize();
		vec4 FontColor = 1.0f;
		
		CRect ComposingRect = CRect(
			GetTextRect().x + GetTextRect().w,
			GetTextRect().y,
			TextRenderer()->GetTextWidth(&m_ComposingTextCache),
			GetTextRect().h
		);
		
		const CAsset_GuiLabelStyle* pLabelStyle = AssetsManager()->GetAsset<CAsset_GuiLabelStyle>(CAssetPath::GuiLabelStyleSystem(GUILABELSTYLE_COMPOSING));
		if(pLabelStyle)
		{
			FontSize = Context()->ApplyGuiScale(pLabelStyle->GetFontSize());
			FontColor = pLabelStyle->m_TextColor;
			
			CRect Rect = ComposingRect;
			int Padding = Context()->ApplyGuiScale(pLabelStyle->GetPadding());
			Rect.AddMargin(Padding);
			ComposingRect.x += Padding;
			
			AssetsRenderer()->DrawGuiRect(&ComposingRect, pLabelStyle->GetRectPath());
		}
		m_ComposingTextCache.SetFontSize(GetFontSize());
		m_ComposingTextCache.SetBoxSize(ivec2(-1, ComposingRect.h));
		TextRenderer()->DrawText(&m_ComposingTextCache, ivec2(ComposingRect.x, ComposingRect.y), FontColor);
	}
	
	// render the cursor
			// cursor position
	if(m_TextCursor.m_TextIter >= 0)
	{
		if((2*time_get()/time_freq()) % 2)
		{
			Graphics()->TextureClear();
			Graphics()->LinesBegin();
			Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f);
			
			float x = m_TextCursor.m_Position.x + 0.5f;
			float y0 = GetTextRect().y;
			float y1 = GetTextRect().y + GetTextRect().h;
			IGraphics::CLineItem Line(x, y0, x, y1);
			Graphics()->LinesDraw(&Line, 1);
			
			Graphics()->LinesEnd();
		}
	}
}
开发者ID:teeworlds-modapi,项目名称:teeworlds,代码行数:54,代码来源:text-edit.cpp


示例2: GetFontSize

nsFontSizeTextAttr::nsFontSizeTextAttr(nsIFrame *aRootFrame, nsIFrame *aFrame) :
  nsTextAttr<nscoord>(aFrame == nsnull)
{
  mDC = aRootFrame->PresContext()->DeviceContext();

  mRootNativeValue = GetFontSize(aRootFrame);
  mIsRootDefined = true;

  if (aFrame) {
    mNativeValue = GetFontSize(aFrame);
    mIsDefined = true;
  }
}
开发者ID:AntonSilviu,项目名称:v8monkey,代码行数:13,代码来源:nsTextAttrs.cpp


示例3: __LOGSTR

void CButton::ConstructL()
    {
    #ifdef __DEBUG
    __LOGSTR("Construct");
    #endif
    CActiveScheduler::Add(this);
    iColor = KRgbRed;
    iWs = RWsSession();
    iFs.Connect();
    iWs.Connect(iFs);
    iWg = RWindowGroup(iWs);
    iWg.Construct((TUint32)&iWg,EFalse);
    iWg.SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
    iWg.EnableReceiptOfFocus(ETrue);

    iWindow = RWindow(iWs);
    iWindow.Construct(iWg,(TUint32)&iWg+1);
    iWindow.Activate();
    iWindow.SetNonFading(ETrue);
    //
    iWindow.SetBackgroundColor(KRgbBlack);

    iScreen=new (ELeave) CWsScreenDevice(iWs);
    User::LeaveIfError(iScreen->Construct());
    User::LeaveIfError(iScreen->CreateContext(iGc));
    GetFontSize();
    iScreenSize.iY = iScreen->GetCurrentScreenModeAttributes().iScreenSize.iHeight;
    iScreenSize.iX = iScreen->GetCurrentScreenModeAttributes().iScreenSize.iWidth;
    iWindow.SetExtent(TPoint(0,iScreenSize.iY-60),TSize(iScreenSize.iX,60));
    iWs.Flush();
    Draw();
    iWs.Flush();
    }
开发者ID:Seikareikou,项目名称:symbian,代码行数:33,代码来源:Button.cpp


示例4: UpdateFontSize

  void UpdateFontSize()
  {
    int font_size = GetFontSize();

    for (auto const& em : em_converters_)
      em->SetFontSize(font_size);
  }
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:7,代码来源:UnitySettings.cpp


示例5: CreateFormatterArgsDoc

// we don't use CreateFormatterArgsDoc() to not introduce dependency
// on gGlobalPrefs in EngineDump
HtmlFormatterArgs *CreateFormatterArgsDoc2(Doc doc, int dx, int dy, PoolAllocator *textAllocator)
{
    HtmlFormatterArgs *args = CreateFormatterArgsDoc(doc, dx, dy, textAllocator);
    args->SetFontName(GetFontName());
    args->fontSize = GetFontSize();
    return args;
}
开发者ID:azaleafisitania,项目名称:sumatrapdf,代码行数:9,代码来源:EbookController.cpp


示例6: GetCombinedPos

int GuiTextEdit::CalcCursorPos(float mousex)
{
  float startX = GetCombinedPos().x;
  float sizeX = GetSize().x;

  if (mousex < startX)
  {
    return m_first;
  }
  else if (mousex > startX + sizeX)
  {
    return m_last;
  }

  int pos = m_caret;
  for (int i = m_first; i < m_last; i++)
  {
    float x = (GetFont()->GetTextWidth(m_text.substr(m_first, i - m_first)) * 
      GetFontSize() * m_scaleX) + startX;

    if (x > mousex)
    {
      pos = std::max(0, i - 1);
      // DON'T recalc m_first and m_last!
      break;
    }
  }
  return pos;
}
开发者ID:jason-amju,项目名称:amjulib,代码行数:29,代码来源:GuiTextEdit.cpp


示例7: GetSize

void   LineEdit::Layout() {
	Size sz = sb.GetReducedViewSize();
	if(nohbar || isdrag)
		sz.cy = GetSize().cy;
	sb.SetPage(sz / GetFontSize());
	SetHBar();
}
开发者ID:pedia,项目名称:raidget,代码行数:7,代码来源:LineEdit.cpp


示例8: GetTitle

////////////////////////////////////////////////////////////////////
// Public functions
//
void CDrawField::Draw( int page, CDC* dc )
/* ============================================================
	Function :		CDrawField::Draw
	Description :	Draws this object.
	Access :		Public
					
	Return :		void
	Parameters :	int page	-	Current page
					CDC* dc		-	CDC to draw to

	Usage :			Called by the generator to draw the object.

   ============================================================*/
{

	CString title = GetTitle();
	CDoubleRect rect = GetPosition();
	CUnitConversion::InchesToPixels( rect );

	CRect r( static_cast< int >( rect.left ), static_cast< int >( rect.top ), static_cast< int >( rect.right ), static_cast< int >( rect.bottom ) );
	CUnitConversion::AdjustPixelsToPaper( dc, r );

	LOGFONT	lf;
	ZeroMemory( &lf, sizeof( lf ) );

	lstrcpy( lf.lfFaceName, GetFontName() );
	lf.lfHeight = CUnitConversion::PointsToPixels( static_cast< double >( GetFontSize() ) / 10.0 );
	lf.lfItalic = static_cast< BYTE >( GetFontItalic() );
	lf.lfUnderline = static_cast< BYTE >( GetFontUnderline() );
	lf.lfStrikeOut = static_cast< BYTE >( GetFontStrikeout() );
	lf.lfCharSet = static_cast< BYTE >( GetFontCharset() );

	if( GetFontBold() )
		lf.lfWeight = FW_BOLD;
	else
		lf.lfWeight = FW_NORMAL;

	if( IsBold( title ) )
		lf.lfWeight = FW_BOLD;

	if( IsItalic( title ) )
		lf.lfItalic = TRUE;

	CFont	font;
	font.CreateFontIndirect( &lf );

	dc->SelectObject( &font );
	int color = dc->SetTextColor( GetFontColor() );
	int mode = dc->SetBkMode( TRANSPARENT );
	int justification = GetJustification();

	ReplaceFields( page, title );

	dc->DrawText( title, r, DT_NOPREFIX | DT_WORDBREAK | justification );

	dc->SetBkMode( mode );
	dc->SetTextColor( color );
	dc->SelectStockObject( ANSI_VAR_FONT );

}
开发者ID:dlsyaim,项目名称:sm-eye-app,代码行数:63,代码来源:DrawField.cpp


示例9: AddAtomLabels

  bool OBDepict::AddAtomLabels(AtomLabelType type)
  {
    d->painter->SetPenColor(OBColor("red"));
    d->painter->SetFillColor(OBColor("red"));
    d->painter->SetFontSize((int)(GetFontSize() * 0.8));// smaller text
    OBAtomIterator i;
    for (OBAtom *atom = d->mol->BeginAtom(i); atom; atom = d->mol->NextAtom(i)) {
      vector3 pos(atom->GetVector());
      std::stringstream ss;
      switch (type) {
        case AtomId:
          ss << atom->GetId();
          d->painter->DrawText(pos.x(), pos.y(), ss.str());
          break;
        case AtomSymmetryClass:
          ss << GetAtomSymClass(atom);
          d->painter->DrawText(pos.x(), pos.y(), ss.str());
          break;
        case AtomIndex:
          ss << atom->GetIdx();
          d->painter->DrawText(pos.x(), pos.y(), ss.str());
          break;

        default:
          break;
      }
    }

    return true;    
  }
开发者ID:RitaDo,项目名称:pgchem,代码行数:30,代码来源:depict.cpp


示例10: assert

void kGUIText::InsertRichInfo(int index,int num)
{
	int i;
	RICHINFO_DEF rid;

	assert(index<=m_richinfosize,"Cannot insert past end of string");

	/* if at beginning or end of string then use "current" info */
	if(index==m_richinfosize || !index)
	{
		rid.fontid=GetFontID();
		rid.fontsize=GetFontSize();
		rid.bgcolor=m_bgcolor;
		rid.fcolor=GetColor();
	}
	else
		rid=*(GetRichInfoPtr(index-1));

	m_richinfo.Alloc(m_richinfosize+num);
	m_richinfo.InsertEntry(m_richinfosize,index,num);

	for(i=0;i<num;++i)
		m_richinfo.SetEntry(index+i,rid);

	m_richinfosize+=num;
	StringChanged();
}
开发者ID:CarlHuff,项目名称:kgui,代码行数:27,代码来源:kguifont.cpp


示例11: GetFont

CFont* InformApp::GetFont(Fonts font)
{
  CFont& theFont = m_fonts[font];
  if ((HFONT)theFont == 0)
    theFont.CreatePointFont(10*GetFontSize(font),GetFontName(font));
  return &theFont;
}
开发者ID:wyrover,项目名称:Windows-Inform7,代码行数:7,代码来源:Inform.cpp


示例12: GetFontSize

void LineEdit::RefreshChars(bool (*chars)(int c))
{
	RefreshDraw rw;
	rw.ctrl = this;
	rw.fsz = GetFontSize();
	rw.chars = chars;
	Paint(rw);
}
开发者ID:pedia,项目名称:raidget,代码行数:8,代码来源:LineEdit.cpp


示例13: AddSection

void CPDF_VariableText::Initialize() {
  if (!m_bInitial) {
    CPVT_SectionInfo secinfo;
    CPVT_WordPlace place;
    place.nSecIndex = 0;
    AddSection(place, secinfo);
    CPVT_LineInfo lineinfo;
    lineinfo.fLineAscent = GetFontAscent(GetDefaultFontIndex(), GetFontSize());
    lineinfo.fLineDescent =
        GetFontDescent(GetDefaultFontIndex(), GetFontSize());
    AddLine(place, lineinfo);
    if (CSection* pSection = m_SectionArray.GetAt(0))
      pSection->ResetLinePlace();

    m_bInitial = TRUE;
  }
}
开发者ID:gradescope,项目名称:pdfium,代码行数:17,代码来源:cpdf_variabletext.cpp


示例14: GetFontSize

void CMain::Opening(){
	int oldfontsize = GetFontSize();
	
	mrt::Opening();

	SetFontSize(oldfontsize);
	SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
};
开发者ID:nunu-e64,项目名称:TENYU_RPG_CodeOnly,代码行数:8,代码来源:Main.cpp


示例15: CreateFormatterDefaultArgs

HtmlFormatterArgs *CreateFormatterArgsDoc(Doc doc, int dx, int dy, Allocator *textAllocator)
{
    HtmlFormatterArgs *args = CreateFormatterDefaultArgs(dx, dy, textAllocator);
    args->htmlStr = doc.GetHtmlData(args->htmlStrLen);
    args->SetFontName(GetFontName());
    args->fontSize = GetFontSize();
    return args;
}
开发者ID:jayceefun,项目名称:sumatrapdf,代码行数:8,代码来源:EbookController.cpp


示例16: __LOGSTR

void CMyServer::ConstructL()
    {
    __LOGSTR("Construct");
    CActiveScheduler::Add(this);
    iWs = RWsSession();
    iFs.Connect();

    iTextPlain = CPlainText::NewL();

    ReadConf();
    __LOGSTR("ReadConfComplete");
	iOldName = _L("ClipboardChanged");

    iWs.Connect(iFs);
    iTaskList = new(ELeave) TApaTaskList(iWs);

    iScreen = new(ELeave) CWsScreenDevice(iWs);
    CleanupStack::PushL(iScreen);
    iScreen->Construct();
    CleanupStack::Pop(iScreen);

    iChangeTrap = CChangeTrap::NewL();
    iChangeTrap->SetObserver(this);
    iTimer = CPTimer::NewL();
    iTimer->SetObserver(this);
    iCaller = CCaller::NewL();

    iWg = RWindowGroup(iWs);
    iWg.Construct((TUint32)&iWg,EFalse);
    iWg.SetOrdinalPosition(0,ECoeWinPriorityAlwaysAtFront);
    iWg.EnableReceiptOfFocus(EFalse);
    iScreen->CreateContext(iGc);
    iWindow = RWindow(iWs);
    iWindow.Construct(iWg,(TUint32)&iWg+1);

    iWindow.Activate();
    iWindow.SetExtent(TPoint(0,0),TSize(1,1));
    iWindow.SetRequiredDisplayMode(EColor16MA);
	iWindow.SetOrdinalPosition(5555,ECoeWinPriorityAlwaysAtFront);
    TRgb backgroundColour = KRgbBlack;
    //if(KErrNone == iWindow.SetTransparencyAlphaChannel())
   // 	{
    //	backgroundColour.SetAlpha(0);
    //	}
    iWindow.SetBackgroundColor(backgroundColour);


    GetFontSize();

    iWindow.SetSize(iSize);
    __LOGSTR2("iSize1: %d,iSize2: %d",iSize.iWidth,iSize.iHeight);
    iPos=TPoint(iConfig.iX,iConfig.iY);
	iWindow.SetVisible(EFalse);


    iWs.Flush();
    //Draw(iOldName);
    }
开发者ID:Seikareikou,项目名称:symbian,代码行数:58,代码来源:server.cpp


示例17: GetScrollPos

FX_BOOL CPWL_Edit::OnMouseWheel(short zDelta,
                                const CPDF_Point& point,
                                FX_DWORD nFlag) {
  if (HasFlag(PES_MULTILINE)) {
    CPDF_Point ptScroll = GetScrollPos();

    if (zDelta > 0) {
      ptScroll.y += GetFontSize();
    } else {
      ptScroll.y -= GetFontSize();
    }
    SetScrollPos(ptScroll);

    return TRUE;
  }

  return FALSE;
}
开发者ID:primiano,项目名称:pdfium-merge,代码行数:18,代码来源:PWL_Edit.cpp


示例18: strlen

void SQRWndOffSet::SetStep(INT32 time, FLOAT mStep)
{
	this->mStep = mStep;
	mSteptimer  = time;
	mStepResult = static_cast<FLOAT>(-this->GetWndWidth());
	mBeginTimer = static_cast<DWORD>(GetProcessTime());
	mStepOver = strlen(this->GetWndText()) * GetFontSize()/2 * GetWndZoom(); 

}
开发者ID:LaoZhongGu,项目名称:RushGame,代码行数:9,代码来源:SQRWndOffSet.cpp


示例19: GetFontSize

FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo,
                                            FX_BOOL bFactFontSize) {
  return m_bRichText && WordInfo.pWordProps
             ? (WordInfo.pWordProps->nScriptType == ScriptType::Normal ||
                        bFactFontSize
                    ? WordInfo.pWordProps->fFontSize
                    : WordInfo.pWordProps->fFontSize * VARIABLETEXT_HALF)
             : GetFontSize();
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:9,代码来源:cpdf_variabletext.cpp


示例20: Rect

Rect LineEdit::DropCaret()
{
	if(IsNull(dropcaret))
		return Rect(0, 0, 0, 0);
	Size fsz = GetFontSize();
	Point p = dropcaret - sb;
	p = Point(p.x * fsz.cx, p.y * fsz.cy);
	return RectC(p.x, p.y, 1, fsz.cy);
}
开发者ID:pedia,项目名称:raidget,代码行数:9,代码来源:LineEdit.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetForegroundWindow函数代码示例发布时间:2022-05-30
下一篇:
C++ GetFontHeight函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap