本文整理汇总了C++中GetFontSize函数的典型用法代码示例。如果您正苦于以下问题:C++ GetFontSize函数的具体用法?C++ GetFontSize怎么用?C++ GetFontSize使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetFontSize函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
}
示例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;
}
}
示例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();
}
示例4: UpdateFontSize
void UpdateFontSize()
{
int font_size = GetFontSize();
for (auto const& em : em_converters_)
em->SetFontSize(font_size);
}
示例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;
}
示例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;
}
示例7: GetSize
void LineEdit::Layout() {
Size sz = sb.GetReducedViewSize();
if(nohbar || isdrag)
sz.cy = GetSize().cy;
sb.SetPage(sz / GetFontSize());
SetHBar();
}
示例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 );
}
示例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;
}
示例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();
}
示例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;
}
示例12: GetFontSize
void LineEdit::RefreshChars(bool (*chars)(int c))
{
RefreshDraw rw;
rw.ctrl = this;
rw.fsz = GetFontSize();
rw.chars = chars;
Paint(rw);
}
示例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;
}
}
示例14: GetFontSize
void CMain::Opening(){
int oldfontsize = GetFontSize();
mrt::Opening();
SetFontSize(oldfontsize);
SetDrawBlendMode(DX_BLENDMODE_NOBLEND, 0);
};
示例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;
}