当前位置: 首页>>代码示例>>C++>>正文


C++ FontStyle::Face方法代码示例

本文整理汇总了C++中FontStyle::Face方法的典型用法代码示例。如果您正苦于以下问题:C++ FontStyle::Face方法的具体用法?C++ FontStyle::Face怎么用?C++ FontStyle::Face使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FontStyle的用法示例。


在下文中一共展示了FontStyle::Face方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Shear

/*!
	\brief Constructor
	\param style Style object to which the ServerFont belongs
	\param size Character size in points
	\param rotation Rotation in degrees
	\param shear Shear (slant) in degrees. 45 <= shear <= 135
	\param flags Style flags as defined in <Font.h>
	\param spacing String spacing flag as defined in <Font.h>
*/
ServerFont::ServerFont(FontStyle& style, float size, float rotation,
		float shear, float falseBoldWidth, uint16 flags, uint8 spacing)
	:
	fStyle(&style),
	fSize(size),
	fRotation(rotation),
	fShear(shear),
	fFalseBoldWidth(falseBoldWidth),
	fBounds(0, 0, 0, 0),
	fFlags(flags),
	fSpacing(spacing),
	fDirection(style.Direction()),
	fFace(style.Face()),
	fEncoding(B_UNICODE_UTF8)
{
	fStyle->Acquire();
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例2:

FontStyle*
FontFamily::GetStyleMatchingFace(uint16 face) const
{
    // TODO: support other faces (strike through, underlined, outlines...)
    face &= B_BOLD_FACE | B_ITALIC_FACE | B_REGULAR_FACE | B_CONDENSED_FACE
            | B_LIGHT_FACE | B_HEAVY_FACE;

    int32 count = fStyles.CountItems();
    for (int32 i = 0; i < count; i++) {
        FontStyle* style = fStyles.ItemAt(i);

        if (style->Face() == face)
            return style;
    }

    return NULL;
}
开发者ID:mmanley,项目名称:Antares,代码行数:17,代码来源:FontFamily.cpp

示例3: 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;
}
开发者ID:,项目名称:,代码行数:36,代码来源:


注:本文中的FontStyle::Face方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。