本文整理汇总了C++中BFont::SetSpacing方法的典型用法代码示例。如果您正苦于以下问题:C++ BFont::SetSpacing方法的具体用法?C++ BFont::SetSpacing怎么用?C++ BFont::SetSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BFont
的用法示例。
在下文中一共展示了BFont::SetSpacing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Read
status_t
CanvasMessage::ReadFontState(BFont& font)
{
uint8 encoding, spacing;
uint16 face;
uint32 flags, familyAndStyle;
font_direction direction;
float falseBoldWidth, rotation, shear, size;
Read(direction);
Read(encoding);
Read(flags);
Read(spacing);
Read(shear);
Read(rotation);
Read(falseBoldWidth);
Read(size);
Read(face);
status_t result = Read(familyAndStyle);
if (result != B_OK)
return result;
font.SetFamilyAndStyle(familyAndStyle);
font.SetEncoding(encoding);
font.SetFlags(flags);
font.SetSpacing(spacing);
font.SetShear(shear);
font.SetRotation(rotation);
font.SetFalseBoldWidth(falseBoldWidth);
font.SetSize(size);
font.SetFace(face);
return B_OK;
}
示例2:
// GetBFont
BFont
Font::GetBFont() const
{
BFont font;
font.SetFamilyAndStyle(fFamily.String(), fStyle.String());
font.SetSize(fSize);
font.SetRotation(fRotation);
font.SetShear(fShear);
font.SetSpacing(fSpacing);
return font;
}
示例3:
/***********************************************************
* DrawString
***********************************************************/
void
HToolbarButton::DrawString(BView *view ,const char* label,bool downState,bool enabled)
{
BRect bounds = view->Bounds();
if(NORMAL_WIDTH == bounds.Width())
return;
int32 x,y;
BFont font;
font.SetFamilyAndStyle("Swis721 BT","Roman");
font.SetSize(10);
font.SetSpacing(B_BITMAP_SPACING);
font_height height;
font.GetHeight(&height);
float h = height.ascent + height.descent;
y = (int32)(bounds.bottom - h + 4);
float w = view->StringWidth(label);
if(w > bounds.Width())
x = 1;
else{
x = (int32)(bounds.Width() - w)/2;
}
if(downState)
{
x ++;
y ++;
}
view->SetLowColor(bgcolor);
/*
if(enabled && !downState)
{
view->SetHighColor(237,237,237);
view->SetDrawingMode(B_OP_COPY);
font.SetFace(B_BOLD_FACE);
view->SetFont(&font);
view->DrawString(label,BPoint(x+1,y+1));
}
*/
if(enabled)
{
if(!downState)
view->SetHighColor(Black);
else
view->SetHighColor(255,0,0);
}else
view->SetHighColor(BeDarkShadow);
font.SetFace(B_REGULAR_FACE);
view->SetFont(&font);
view->DrawString(label,BPoint(x,y));
}
示例4: BView
TrackMenu::TrackMenu(const BRect &frame, const char *name, BMessage *msg,
const int32 &resize, const int32 &flags)
: BView(frame, name, resize, flags), BInvoker(msg, NULL),
fCurrentItem(-1),
fCount(0),
fIsTracking(false)
{
SetViewColor(20, 20, 20);
fItemRect.Set(1, 1, 1 + StringWidth("00") + 3, Bounds().bottom - 1);
BFont font;
font.SetSize(11);
font.SetSpacing(B_STRING_SPACING);
SetFont(&font);
font_height fh;
GetFontHeight(&fh);
fFontHeight = fh.ascent + fh.descent + fh.leading;
}