本文整理汇总了C++中FontStyle::HasTuned方法的典型用法代码示例。如果您正苦于以下问题:C++ FontStyle::HasTuned方法的具体用法?C++ FontStyle::HasTuned怎么用?C++ FontStyle::HasTuned使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontStyle
的用法示例。
在下文中一共展示了FontStyle::HasTuned方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SaveList
/*!
\brief This saves all family names and styles to the file specified in
ServerConfig.h as SERVER_FONT_LIST as a flattened BMessage.
This operation is not done very often because the access to disk adds a significant
performance hit.
The format for storage consists of two things: an array of strings with the name 'family'
and a number of small string arrays which have the name of the font family. These are
the style lists.
Additionally, any fonts which have bitmap strikes contained in them or any fonts which
are fixed-width are named in the arrays 'tuned' and 'fixed'.
*/
void FontServer::SaveList(void)
{
int32 famcount=0, stycount=0,i=0,j=0;
FontFamily *fam;
FontStyle *sty;
BMessage fontmsg, familymsg('FONT');
BString famname, styname, extraname;
bool fixed,tuned;
famcount=families->CountItems();
for(i=0; i<famcount; i++)
{
fam=(FontFamily*)families->ItemAt(i);
fixed=false;
tuned=false;
if(!fam)
continue;
famname=fam->Name();
// Add the family to the message
familymsg.AddString("name",famname);
stycount=fam->CountStyles();
for(j=0;j<stycount;j++)
{
styname.SetTo(fam->GetStyle(j));
if(styname.CountChars()>0)
{
// Add to list
familymsg.AddString("styles", styname);
// Check to see if it has prerendered strikes (has "tuned" fonts)
sty=fam->GetStyle(styname.String());
if(!sty)
continue;
if(sty->HasTuned() && sty->IsScalable())
tuned=true;
// Check to see if it is fixed-width
if(sty->IsFixedWidth())
fixed=true;
}
}
if(tuned)
familymsg.AddBool("tuned",true);
if(fixed)
familymsg.AddBool("fixed",true);
fontmsg.AddMessage("family",&familymsg);
familymsg.MakeEmpty();
}
BFile file(SERVER_FONT_LIST,B_READ_WRITE | B_CREATE_FILE | B_ERASE_FILE);
if(file.InitCheck()==B_OK)
fontmsg.Flatten(&file);
}