本文整理汇总了C++中FontDescription::getTextEffectData方法的典型用法代码示例。如果您正苦于以下问题:C++ FontDescription::getTextEffectData方法的具体用法?C++ FontDescription::getTextEffectData怎么用?C++ FontDescription::getTextEffectData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontDescription
的用法示例。
在下文中一共展示了FontDescription::getTextEffectData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FontPlatformDataPrivate
//.........这里部分代码省略.........
bool genericFontAdded = false;
while(pfontFamily && i < familyNameArrayCapacity)
{
if(pfontFamily->family().startsWith("-webkit",true)) // A generic font family
{
genericFontAdded = true;
const char16_t* type = 0;
switch(description.genericFamily())
{
case FontDescription::SerifFamily:
type = params.mFontFamilySerif;
break;
case FontDescription::SansSerifFamily:
type = params.mFontFamilySansSerif;
break;
case FontDescription::MonospaceFamily:
type = params.mFontFamilyMonospace;
break;
case FontDescription::CursiveFamily:
type = params.mFontFamilyCursive;
break;
case FontDescription::FantasyFamily:
type = params.mFontFamilyFantasy;
break;
default:
case FontDescription::NoFamily:
case FontDescription::StandardFamily:
type = params.mFontFamilyStandard;
break;
}
if(type)
{
EA::Internal::Strcpy(textStyle.mFamilyNameArray[i],type);
++i;
}
break;
}
CopyFontFamilyName(textStyle.mFamilyNameArray[i], pfontFamily->family());
++i;
pfontFamily = pfontFamily->next();
}
// If we went through all the fonts specified but a generic font was not added, we add the standard font as a fallback.
// It is probably not a good practice to not specify a generic font family for any font but we deal with that situation here.
if( i < familyNameArrayCapacity && !genericFontAdded)
{
EA::Internal::Strcpy(textStyle.mFamilyNameArray[i],params.mFontFamilyStandard);
++i;
}
if(i < familyNameArrayCapacity)
*textStyle.mFamilyNameArray[i] = 0;
// verify that spacing can be used raw without size adjustments.
textStyle.mfLetterSpacing = static_cast<float> (letterSpacing);
textStyle.mfWordSpacing = static_cast<float> (wordSpacing);
// Size
const float fFontSize = description.computedSize();
const float fAdjustedFontSize = GetFontAdjustedSize(fFontSize);
textStyle.mfSize = fAdjustedFontSize;
// Italic
const bool bItalic = description.italic();
if(bItalic)
textStyle.mStyle = EA::WebKit::kStyleItalic;
// Weight
const WebCore::FontWeight fontWeight = description.weight();
textStyle.mfWeight = GetFontAdjustedWeight(fontWeight);
// Variant
if(description.smallCaps())
textStyle.mVariant = EA::WebKit::kVariantSmallCaps;
// Smooth
// We act like FireFox under Windows does with respect to sizes and weights.
bool smooth = IsFontSmooth(fFontSize, description.fontSmoothing());
if(smooth)
textStyle.mSmooth = EA::WebKit::kSmoothEnabled;
// Effects.
const EA::WebKit::TextEffectData& effectData = description.getTextEffectData();
textStyle.mTextEffectData = effectData;
// Now get the requested font
if(pTextSystem)
{
IFont* pFont = pTextSystem->GetFont(textStyle, length ? characters[0] : ' ');
EAW_ASSERT(pFont);
m_data->mpFont = pFont;
}
}