本文整理汇总了C++中FontStyle::Release方法的典型用法代码示例。如果您正苦于以下问题:C++ FontStyle::Release方法的具体用法?C++ FontStyle::Release怎么用?C++ FontStyle::Release使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontStyle
的用法示例。
在下文中一共展示了FontStyle::Release方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*!
\brief Sets the ServerFont instance to whatever font is specified
This method will lock the font manager.
\param familyID ID number of the family to set
\param styleID ID number of the style to set
\return B_OK if successful, B_ERROR if not
*/
status_t
ServerFont::SetFamilyAndStyle(uint16 familyID, uint16 styleID)
{
FontStyle* style = NULL;
if (gFontManager->Lock()) {
style = gFontManager->GetStyle(familyID, styleID);
if (style != NULL)
style->Acquire();
gFontManager->Unlock();
}
if (style == NULL)
return B_ERROR;
SetStyle(style);
style->Release();
return B_OK;
}
示例2: FamilyID
status_t
ServerFont::SetFace(uint16 face)
{
// TODO: This needs further investigation. The face variable is actually
// flags, but some of them are not enforcable at the same time. Also don't
// confuse the Be API "face" with the Freetype face, which is just an
// index in case a single font file exports multiple font faces. The
// FontStyle class takes care of mapping the font style name to the Be
// API face flags in FontStyle::_TranslateStyleToFace().
FontStyle* style = NULL;
uint16 familyID = FamilyID();
if (gFontManager->Lock()) {
int32 count = gFontManager->CountStyles(familyID);
for (int32 i = 0; i < count; i++) {
style = gFontManager->GetStyleByIndex(familyID, i);
if (style == NULL)
break;
if (style->Face() == face) {
style->Acquire();
break;
} else
style = NULL;
}
gFontManager->Unlock();
}
if (!style)
return B_ERROR;
SetStyle(style);
style->Release();
return B_OK;
}