这篇教程C++ GetFontSize函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetFontSize函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFontSize函数的具体用法?C++ GetFontSize怎么用?C++ GetFontSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetFontSize函数的26个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetFontSizevoid 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,
示例2: GetFontSizensFontSizeTextAttr::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,
示例3: __LOGSTRvoid 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,
示例4: UpdateFontSize void UpdateFontSize() { int font_size = GetFontSize(); for (auto const& em : em_converters_) em->SetFontSize(font_size); }
开发者ID:foer,项目名称:linuxmuster-client-unity,代码行数:7,
示例5: CreateFormatterArgsDoc// we don't use CreateFormatterArgsDoc() to not introduce dependency// on gGlobalPrefs in EngineDumpHtmlFormatterArgs *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,
示例6: GetCombinedPosint 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,
示例7: GetSizevoid LineEdit::Layout() { Size sz = sb.GetReducedViewSize(); if(nohbar || isdrag) sz.cy = GetSize().cy; sb.SetPage(sz / GetFontSize()); SetHBar();}
开发者ID:pedia,项目名称:raidget,代码行数:7,
示例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,
示例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,
示例10: assertvoid 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,
示例11: GetFontCFont* 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,
示例12: GetFontSizevoid LineEdit::RefreshChars(bool (*chars)(int c)){ RefreshDraw rw; rw.ctrl = this; rw.fsz = GetFontSize(); rw.chars = chars; Paint(rw);}
开发者ID:pedia,项目名称:raidget,代码行数:8,
示例13: AddSectionvoid 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,
示例14: GetFontSizevoid CMain::Opening(){ int oldfontsize = GetFontSize(); mrt::Opening(); SetFontSize(oldfontsize); SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);};
开发者ID:nunu-e64,项目名称:TENYU_RPG_CodeOnly,代码行数:8,
示例15: CreateFormatterDefaultArgsHtmlFormatterArgs *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,
示例16: __LOGSTRvoid 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,
示例17: GetScrollPosFX_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,
示例18: strlenvoid 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,
示例19: GetFontSizeFX_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,
示例20: RectRect 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,
示例21: GetScrollPosbool CPWL_Edit::OnMouseWheel(short zDelta, const CFX_PointF& point, uint32_t nFlag) { if (HasFlag(PES_MULTILINE)) { CFX_PointF ptScroll = GetScrollPos(); if (zDelta > 0) { ptScroll.y += GetFontSize(); } else { ptScroll.y -= GetFontSize(); } SetScrollPos(ptScroll); return true; } return false;}
开发者ID:MIPS,项目名称:external-pdfium,代码行数:18,
示例22: PRBoolnsFontSizeTextAttr::GetValueFor(nsIDOMElement *aElm, nscoord *aValue){ nsIFrame *frame = nsCoreUtils::GetFrameFor(aElm); if (!frame) return PR_FALSE; *aValue = GetFontSize(frame); return PR_TRUE;}
开发者ID:AllenDou,项目名称:firefox,代码行数:10,
示例23: PRBoolnsFontSizeTextAttr::GetValueFor(nsIContent *aContent, nscoord *aValue){ nsIFrame *frame = aContent->GetPrimaryFrame(); if (!frame) return PR_FALSE; *aValue = GetFontSize(frame); return PR_TRUE;}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:10,
示例24: msFX_FLOAT CXFA_Font::GetLetterSpacing() { CFX_WideStringC wsValue; if (!m_pNode->TryCData(XFA_ATTRIBUTE_LetterSpacing, wsValue)) return 0; CXFA_Measurement ms(wsValue); if (ms.GetUnit() == XFA_UNIT_Em) return ms.GetValue() * GetFontSize(); return ms.ToUnit(XFA_UNIT_Pt);}
开发者ID:gradescope,项目名称:pdfium,代码行数:10,
示例25: boolnsFontSizeTextAttr::GetValueFor(nsIContent *aContent, nscoord *aValue){ nsIFrame *frame = aContent->GetPrimaryFrame(); if (!frame) return false; *aValue = GetFontSize(frame); return true;}
开发者ID:AntonSilviu,项目名称:v8monkey,代码行数:10,
示例26: GetSizevoid GuiTextEdit::GetFirstLast(int line, int* first, int* last){ *first = 0; *last = m_text.size(); int caret = m_caret; if (m_drawCaret) { caret++; } Vec2f size = GetSize(); switch (m_just) { case AMJU_JUST_LEFT: while ((GetFont()->GetTextWidth(m_text.substr(*first, *last - *first)) * GetFontSize() * m_scaleX) > size.x) { if (caret > *last) { (*last)++; } else if (caret == *last) { (*first)++; } else if (caret < *first) { (*first)--; } else { (*last)--; } } if (*last > (int)m_text.size()) { *last = m_text.size(); } Assert(*last <= (int)m_text.size()); Assert(*first >= 0); Assert(m_caret >= *first); Assert(m_caret <= *last); m_first = *first; m_last = *last; return; default: Assert(0); }}
开发者ID:jason-amju,项目名称:amjulib,代码行数:54,
注:本文中的GetFontSize函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetForegroundWindow函数代码示例 C++ GetFontHeight函数代码示例 |