本文整理汇总了C++中FontDescription::genericFamily方法的典型用法代码示例。如果您正苦于以下问题:C++ FontDescription::genericFamily方法的具体用法?C++ FontDescription::genericFamily怎么用?C++ FontDescription::genericFamily使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FontDescription
的用法示例。
在下文中一共展示了FontDescription::genericFamily方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: familyNameFromSettings
static AtomicString familyNameFromSettings(const GenericFontFamilySettings& settings, const FontDescription& fontDescription, const AtomicString& genericFamilyName)
{
UScriptCode script = fontDescription.script();
#if OS(ANDROID)
if (fontDescription.genericFamily() == FontDescription::StandardFamily)
return FontCache::getGenericFamilyNameForScript(FontFamilyNames::webkit_standard, script);
if (genericFamilyName.startsWith("-webkit-"))
return FontCache::getGenericFamilyNameForScript(genericFamilyName, script);
#else
if (fontDescription.genericFamily() == FontDescription::StandardFamily)
return settings.standard(script);
if (genericFamilyName == FontFamilyNames::webkit_serif)
return settings.serif(script);
if (genericFamilyName == FontFamilyNames::webkit_sans_serif)
return settings.sansSerif(script);
if (genericFamilyName == FontFamilyNames::webkit_cursive)
return settings.cursive(script);
if (genericFamilyName == FontFamilyNames::webkit_fantasy)
return settings.fantasy(script);
if (genericFamilyName == FontFamilyNames::webkit_monospace)
return settings.fixed(script);
if (genericFamilyName == FontFamilyNames::webkit_pictograph)
return settings.pictograph(script);
if (genericFamilyName == FontFamilyNames::webkit_standard)
return settings.standard(script);
#endif
return emptyAtom;
}
示例2: FontHolder
FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicString& family)
{
// NB: The Windows wxFont constructor has two forms, one taking a wxSize (with pixels)
// and one taking an int (points). When points are used, Windows calculates
// a pixel size using an algorithm which causes the size to be way off. However,
// this is a moot issue on Linux and Mac as they only accept the point argument. So,
// we use the pixel size constructor on Windows, but we use point size on Linux and Mac.
#if __WXMSW__
m_font = new FontHolder(new wxFont( wxSize(0, -desc.computedPixelSize()),
fontFamilyToWxFontFamily(desc.genericFamily()),
italicToWxFontStyle(desc.italic()),
fontWeightToWxFontWeight(desc.weight()),
false,
family.string()
)
);
#else
m_font = new FontHolder(new wxFont( desc.computedPixelSize(),
fontFamilyToWxFontFamily(desc.genericFamily()),
italicToWxFontStyle(desc.italic()),
fontWeightToWxFontWeight(desc.weight()),
false,
family.string()
)
);
#endif
m_fontState = VALID;
}
示例3: checkForGenericFamilyChange
void FontBuilder::checkForGenericFamilyChange(const FontDescription& oldDescription, FontDescription& newDescription)
{
if (newDescription.isAbsoluteSize())
return;
if (newDescription.isMonospace() == oldDescription.isMonospace())
return;
// For now, lump all families but monospace together.
if (newDescription.genericFamily() != FontDescription::MonospaceFamily
&& oldDescription.genericFamily() != FontDescription::MonospaceFamily)
return;
// We know the parent is monospace or the child is monospace, and that font
// size was unspecified. We want to scale our font size as appropriate.
// If the font uses a keyword size, then we refetch from the table rather than
// multiplying by our scale factor.
float size;
if (newDescription.keywordSize()) {
size = FontSize::fontSizeForKeyword(&m_document, newDescription.keywordSize(), newDescription.isMonospace());
} else {
Settings* settings = m_document.settings();
float fixedScaleFactor = (settings && settings->defaultFixedFontSize() && settings->defaultFontSize())
? static_cast<float>(settings->defaultFixedFontSize()) / settings->defaultFontSize()
: 1;
size = oldDescription.isMonospace() ?
newDescription.specifiedSize() / fixedScaleFactor :
newDescription.specifiedSize() * fixedScaleFactor;
}
newDescription.setSpecifiedSize(size);
}
示例4: setFontFamilyInherit
void FontBuilder::setFontFamilyInherit(const FontDescription& parentFontDescription)
{
FontDescriptionChangeScope scope(this);
scope.fontDescription().setGenericFamily(parentFontDescription.genericFamily());
scope.fontDescription().setFamily(parentFontDescription.family());
}
示例5: adoptRef
FontPlatformData::FontPlatformData(const FontDescription& desc, const AtomicString& family)
{
// NB: The Windows wxFont constructor has two forms, one taking a wxSize (with pixels)
// and one taking an int (points). When points are used, Windows calculates
// a pixel size using an algorithm which causes the size to be way off. However,
// this is a moot issue on Linux and Mac as they only accept the point argument. So,
// we use the pixel size constructor on Windows, but we use point size on Linux and Mac.
#if __WXMSW__
m_font = adoptRef(new FontHolder(new wxFont( wxSize(0, -desc.computedPixelSize()),
fontFamilyToWxFontFamily(desc.genericFamily()),
italicToWxFontStyle(desc.italic()),
fontWeightToWxFontWeight(desc.weight()),
false,
family.string()
)
));
#else
m_font = adoptRef(new FontHolder(new wxFont( desc.computedPixelSize(),
fontFamilyToWxFontFamily(desc.genericFamily()),
italicToWxFontStyle(desc.italic()),
fontWeightToWxFontWeight(desc.weight()),
false,
family.string()
)
));
#endif
#if OS(DARWIN)
#if !wxOSX_USE_CORE_TEXT
#if wxCHECK_VERSION(2,9,0)
m_atsuFontID = m_font->font()->OSXGetATSUFontID();
#else
m_atsuFontID = m_font->font()->MacGetATSUFontID();
#endif
#endif
m_nsFont = 0;
cacheNSFont();
#endif
m_size = desc.computedPixelSize();
m_fontState = VALID;
m_size = desc.computedPixelSize();
}
示例6:
WebFontDescription::WebFontDescription(const FontDescription& desc)
{
family = desc.family().family();
genericFamily = static_cast<GenericFamily>(desc.genericFamily());
size = desc.specifiedSize();
italic = desc.style() == FontStyleItalic;
smallCaps = desc.variant() == FontVariantSmallCaps;
weight = static_cast<Weight>(desc.weight());
smoothing = static_cast<Smoothing>(desc.fontSmoothing());
letterSpacing = desc.letterSpacing();
wordSpacing = desc.wordSpacing();
}
示例7: setFontFamilyInitial
void FontBuilder::setFontFamilyInitial(float effectiveZoom)
{
FontDescriptionChangeScope scope(this);
FontDescription initialDesc = FontDescription();
// We need to adjust the size to account for the generic family change from monospace to non-monospace.
if (scope.fontDescription().keywordSize() && scope.fontDescription().useFixedDefaultSize())
setSize(scope.fontDescription(), effectiveZoom, FontSize::fontSizeForKeyword(m_document, CSSValueXxSmall + scope.fontDescription().keywordSize() - 1, false));
scope.fontDescription().setGenericFamily(initialDesc.genericFamily());
if (!initialDesc.firstFamily().familyIsEmpty())
scope.fontDescription().setFamily(initialDesc.firstFamily());
}
示例8: fontDataForGenericFamily
PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
{
if (m_fontFaces.isEmpty()) {
if (familyName.startsWith("-webkit-"))
return fontDataForGenericFamily(m_document, fontDescription, familyName);
if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
return fontDataForGenericFamily(m_document, fontDescription, "-webkit-standard");
return 0;
}
CSSSegmentedFontFace* face = getFontFace(fontDescription, familyName);
// If no face was found, then return 0 and let the OS come up with its best match for the name.
if (!face) {
// If we were handed a generic family, but there was no match, go ahead and return the correct font based off our
// settings.
if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
return fontDataForGenericFamily(m_document, fontDescription, "-webkit-standard");
return fontDataForGenericFamily(m_document, fontDescription, familyName);
}
// We have a face. Ask it for a font data. If it cannot produce one, it will fail, and the OS will take over.
return face->getFontData(fontDescription);
}
示例9: resolvesFamilyFor
bool CSSFontSelector::resolvesFamilyFor(const FontDescription& description) const
{
for (unsigned i = 0; i < description.familyCount(); ++i) {
const AtomicString& familyName = description.familyAt(i);
if (description.genericFamily() == FontDescription::StandardFamily && !description.isSpecifiedFont())
return true;
if (familyName.isEmpty())
continue;
if (m_fontFaces.contains(familyName))
return true;
DEFINE_STATIC_LOCAL(String, webkitPrefix, ("-webkit-"));
if (familyName.startsWith(webkitPrefix))
return true;
}
return false;
}
示例10: switch
PassRefPtr<SimpleFontData> FontCache::getLastResortFallbackFont(const FontDescription& description, ShouldRetain)
{
DEFINE_STATIC_LOCAL(const AtomicString, sansStr, ("Sans"));
DEFINE_STATIC_LOCAL(const AtomicString, serifStr, ("Serif"));
DEFINE_STATIC_LOCAL(const AtomicString, monospaceStr, ("Monospace"));
FontPlatformData* fontPlatformData = 0;
switch (description.genericFamily()) {
case FontDescription::SerifFamily:
fontPlatformData = getCachedFontPlatformData(description, serifStr);
break;
case FontDescription::MonospaceFamily:
fontPlatformData = getCachedFontPlatformData(description, monospaceStr);
break;
case FontDescription::SansSerifFamily:
default:
fontPlatformData = getCachedFontPlatformData(description, sansStr);
break;
}
if (!fontPlatformData) {
DEFINE_STATIC_LOCAL(const AtomicString, arialStr, ("Arial"));
fontPlatformData = getCachedFontPlatformData(description, arialStr);
}
示例11: getFamilyNameStringFromFontDescriptionAndFamily
static String getFamilyNameStringFromFontDescriptionAndFamily(const FontDescription& fontDescription, const AtomicString& family)
{
// If we're creating a fallback font (e.g. "-webkit-monospace"), convert the name into
// the fallback name (like "monospace") that fontconfig understands.
if (family.length() && !family.startsWith("-webkit-"))
return family.string();
switch (fontDescription.genericFamily()) {
case FontDescription::StandardFamily:
case FontDescription::SerifFamily:
return "serif";
case FontDescription::SansSerifFamily:
return "sans-serif";
case FontDescription::MonospaceFamily:
return "monospace";
case FontDescription::CursiveFamily:
return "cursive";
case FontDescription::FantasyFamily:
return "fantasy";
case FontDescription::NoFamily:
default:
return "";
}
}
示例12: FontPlatformDataPrivate
FontPlatformData::FontPlatformData(const FontDescription& description, const AtomicString& familyName, const UChar* characters, int length, int wordSpacing, int letterSpacing)
: m_data(new FontPlatformDataPrivate())
{
using namespace EA::WebKit;
EA::WebKit::TextStyle textStyle; // We rather use the textStyle so we can pass in the spacing and the fx info directly.
InitTextStyle(textStyle);
// Note by Arpit Baldeva:
// The way WebCore expects us to handle creation of FontPlatformData is to take the familyName
// in FontCacheEA.cpp and return a valid pointer only if that particular font can be created.
// In CSS, one can specify multiple font families in order of preference. If you return NULL,
// WebCore sends the next highest priority font. Note that it also converts generic font family
// name (such as serif) to the one you specify as your default in the Settings (For example,
// Times New Roman for us). So the system is supposed to be pretty simple.
// The problem we have is that EAText wants to builds a priority array in one shot. Also, if you
// request a font and it is not found, it may return one of the fallback fonts even though you may
// have something down the priority order available in EAText.
// So what we do here is build up that array.
//-- Build FamilyName array ---
ITextSystem* pTextSystem = GetTextSystem();
const uint32_t familyNameArrayCapacity = pTextSystem->GetFamilyNameArrayCapacity();
uint32_t i = 0;
EAW_ASSERT_MSG(!familyName.isEmpty(), "Family name can never be empty");
CopyFontFamilyName(textStyle.mFamilyNameArray[i],familyName);
const FontFamily* pfontFamily = &(description.family());
pfontFamily = pfontFamily->next();
++i;
const EA::WebKit::Parameters& params = EA::WebKit::GetParameters();
// Here, we iterate through the list and copy the fonts to the destination array in the order of priority.
// If we come across a generic font, we read it from the Params based on the generic family set in the description.
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);
//.........这里部分代码省略.........
示例13: FcConfigGetCurrent
FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& familyName)
: m_pattern(0)
, m_fallbacks(0)
, m_size(fontDescription.computedSize())
, m_syntheticBold(false)
, m_syntheticOblique(false)
, m_scaledFont(0)
, m_face(0)
{
FontPlatformData::init();
CString familyNameString = familyName.string().utf8();
const char* fcfamily = familyNameString.data();
int fcslant = FC_SLANT_ROMAN;
// FIXME: Map all FontWeight values to fontconfig weights.
int fcweight = FC_WEIGHT_NORMAL;
float fcsize = fontDescription.computedSize();
if (fontDescription.italic())
fcslant = FC_SLANT_ITALIC;
if (fontDescription.weight() >= FontWeight600)
fcweight = FC_WEIGHT_BOLD;
FcConfig *config = FcConfigGetCurrent();
//printf("family = %s\n", fcfamily);
int type = fontDescription.genericFamily();
FcPattern* pattern = FcPatternCreate();
if (!FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
goto freePattern;
switch (type) {
case FontDescription::SerifFamily:
fcfamily = "serif";
break;
case FontDescription::SansSerifFamily:
fcfamily = "sans-serif";
break;
case FontDescription::MonospaceFamily:
fcfamily = "monospace";
break;
case FontDescription::NoFamily:
case FontDescription::StandardFamily:
default:
fcfamily = "sans-serif";
}
if (!FcPatternAddString(pattern, FC_FAMILY, reinterpret_cast<const FcChar8*>(fcfamily)))
goto freePattern;
if (!FcPatternAddInteger(pattern, FC_SLANT, fcslant))
goto freePattern;
if (!FcPatternAddInteger(pattern, FC_WEIGHT, fcweight))
goto freePattern;
if (!FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fcsize))
goto freePattern;
FcConfigSubstitute(config, pattern, FcMatchPattern);
FcDefaultSubstitute(pattern);
FcResult fcresult;
m_pattern = FcFontMatch(config, pattern, &fcresult);
FcPatternReference(m_pattern);
// FIXME: should we set some default font?
if (!m_pattern)
goto freePattern;
FcChar8 *fc_filename;
char *filename;
int id;
id = 0;
if (FcPatternGetString(m_pattern, FC_FILE, 0, &fc_filename) != FcResultMatch) {
LOG(FontEngine, "cannot retrieve font\n");
goto freePattern;
}
filename = (char *) fc_filename; //use C cast as FcChar is a fontconfig type
//printf("filename = %s\n", filename);
if (FcPatternGetInteger(m_pattern, FC_INDEX, 0, &id) != FcResultMatch) {
LOG(FontEngine, "cannot retrieve font index\n");
goto freePattern;
}
if (FT_Error error = FT_New_Face(m_library, filename, id, &m_face)) {
//if (FT_Error error = FT_New_Face(m_library, too, id, &m_face)) {
LOG(FontEngine, "fail to open fonti %s with index %d (error = 0x%x)\n", filename, id, error);
m_face = 0;
goto freePattern;
}
FT_Set_Pixel_Sizes(m_face, 0, static_cast<uint> (fontDescription.computedSize()));
//DBGML(MODULE_FONTS, LEVEL_INFO, "open font %s with size %d\n", filename, static_cast<uint> (fontDescription.specifiedSize()));
freePattern:
FcPatternDestroy(pattern);
FcConfigDestroy(config);
//.........这里部分代码省略.........
示例14: getFontDataForCharacters
// Given the desired base font, this will create a SimpleFontData for a specific
// font that can be used to render the given range of characters.
const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
{
// FIXME: Consider passing fontDescription.dominantScript()
// to GetFallbackFamily here.
FontDescription fontDescription = font.fontDescription();
UChar32 c;
UScriptCode script;
const wchar_t* family = getFallbackFamily(characters, length,
fontDescription.genericFamily(), &c, &script);
FontPlatformData* data = 0;
if (family)
data = getCachedFontPlatformData(font.fontDescription(), AtomicString(family, wcslen(family)), false);
// Last resort font list : PanUnicode. CJK fonts have a pretty
// large repertoire. Eventually, we need to scan all the fonts
// on the system to have a Firefox-like coverage.
// Make sure that all of them are lowercased.
const static wchar_t* const cjkFonts[] = {
L"arial unicode ms",
L"ms pgothic",
L"simsun",
L"gulim",
L"pmingliu",
L"wenquanyi zen hei", // partial CJK Ext. A coverage but more
// widely known to Chinese users.
L"ar pl shanheisun uni",
L"ar pl zenkai uni",
L"han nom a", // Complete CJK Ext. A coverage
L"code2000", // Complete CJK Ext. A coverage
// CJK Ext. B fonts are not listed here because it's of no use
// with our current non-BMP character handling because we use
// Uniscribe for it and that code path does not go through here.
};
const static wchar_t* const commonFonts[] = {
L"tahoma",
L"arial unicode ms",
L"lucida sans unicode",
L"microsoft sans serif",
L"palatino linotype",
// Six fonts below (and code2000 at the end) are not from MS, but
// once installed, cover a very wide range of characters.
L"dejavu serif",
L"dejavu sasns",
L"freeserif",
L"freesans",
L"gentium",
L"gentiumalt",
L"ms pgothic",
L"simsun",
L"gulim",
L"pmingliu",
L"code2000",
};
const wchar_t* const* panUniFonts = 0;
int numFonts = 0;
if (script == USCRIPT_HAN) {
panUniFonts = cjkFonts;
numFonts = WTF_ARRAY_LENGTH(cjkFonts);
} else {
panUniFonts = commonFonts;
numFonts = WTF_ARRAY_LENGTH(commonFonts);
}
// Font returned from GetFallbackFamily may not cover |characters|
// because it's based on script to font mapping. This problem is
// critical enough for non-Latin scripts (especially Han) to
// warrant an additional (real coverage) check with fontCotainsCharacter.
int i;
for (i = 0; (!data || !fontContainsCharacter(data, family, c)) && i < numFonts; ++i) {
family = panUniFonts[i];
data = getCachedFontPlatformData(font.fontDescription(), AtomicString(family, wcslen(family)));
}
// When i-th font (0-base) in |panUniFonts| contains a character and
// we get out of the loop, |i| will be |i + 1|. That is, if only the
// last font in the array covers the character, |i| will be numFonts.
// So, we have to use '<=" rather than '<' to see if we found a font
// covering the character.
if (i <= numFonts)
return getCachedFontData(data, DoNotRetain);
return 0;
}
示例15: fontDataForGenericFamily
PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDescription, const AtomicString& familyName)
{
if (m_fontFaces.isEmpty()) {
if (familyName.startsWith("-webkit-"))
return fontDataForGenericFamily(m_document, fontDescription, familyName);
if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
return fontDataForGenericFamily(m_document, fontDescription, "-webkit-standard");
return 0;
}
String family = familyName.string();
Vector<RefPtr<CSSFontFace> >* familyFontFaces = m_fontFaces.get(family);
// If no face was found, then return 0 and let the OS come up with its best match for the name.
if (!familyFontFaces || familyFontFaces->isEmpty()) {
// If we were handed a generic family, but there was no match, go ahead and return the correct font based off our
// settings.
if (fontDescription.genericFamily() == FontDescription::StandardFamily && !fontDescription.isSpecifiedFont())
return fontDataForGenericFamily(m_document, fontDescription, "-webkit-standard");
return fontDataForGenericFamily(m_document, fontDescription, familyName);
}
OwnPtr<HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > >& segmentedFontFaceCache = m_fonts.add(family, nullptr).iterator->value;
if (!segmentedFontFaceCache)
segmentedFontFaceCache = adoptPtr(new HashMap<unsigned, RefPtr<CSSSegmentedFontFace> >);
FontTraitsMask traitsMask = fontDescription.traitsMask();
RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traitsMask, 0).iterator->value;
if (!face) {
face = CSSSegmentedFontFace::create(this);
// Collect all matching faces and sort them in order of preference.
Vector<CSSFontFace*, 32> candidateFontFaces;
for (int i = familyFontFaces->size() - 1; i >= 0; --i) {
CSSFontFace* candidate = familyFontFaces->at(i).get();
unsigned candidateTraitsMask = candidate->traitsMask();
if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & FontStyleNormalMask))
continue;
if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
continue;
#if ENABLE(SVG_FONTS)
// For SVG Fonts that specify that they only support the "normal" variant, we will assume they are incapable
// of small-caps synthesis and just ignore the font face as a candidate.
if (candidate->hasSVGFontFaceSource() && (traitsMask & FontVariantSmallCapsMask) && !(candidateTraitsMask & FontVariantSmallCapsMask))
continue;
#endif
candidateFontFaces.append(candidate);
}
if (Vector<RefPtr<CSSFontFace> >* familyLocallyInstalledFontFaces = m_locallyInstalledFontFaces.get(family)) {
unsigned numLocallyInstalledFontFaces = familyLocallyInstalledFontFaces->size();
for (unsigned i = 0; i < numLocallyInstalledFontFaces; ++i) {
CSSFontFace* candidate = familyLocallyInstalledFontFaces->at(i).get();
unsigned candidateTraitsMask = candidate->traitsMask();
if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & FontStyleNormalMask))
continue;
if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
continue;
candidateFontFaces.append(candidate);
}
}
desiredTraitsMaskForComparison = traitsMask;
stable_sort(candidateFontFaces.begin(), candidateFontFaces.end(), compareFontFaces);
unsigned numCandidates = candidateFontFaces.size();
for (unsigned i = 0; i < numCandidates; ++i)
face->appendFontFace(candidateFontFaces[i]);
}
// We have a face. Ask it for a font data. If it cannot produce one, it will fail, and the OS will take over.
return face->getFontData(fontDescription);
}