FontCacheCoreText.h [plain text]
#pragma once
#include "FontDescription.h"
#include <CoreText/CTFont.h>
namespace WebCore {
struct SynthesisPair {
explicit SynthesisPair(bool needsSyntheticBold, bool needsSyntheticOblique)
: needsSyntheticBold(needsSyntheticBold)
, needsSyntheticOblique(needsSyntheticOblique)
{
}
std::pair<bool, bool> boldObliquePair() const
{
return std::make_pair(needsSyntheticBold, needsSyntheticOblique);
}
bool needsSyntheticBold;
bool needsSyntheticOblique;
};
RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, const FontDescription&, const FontFeatureSettings* fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities, bool applyWeightWidthSlopeVariations = true);
SynthesisPair computeNecessarySynthesis(CTFontRef, const FontDescription&, bool isPlatformFont = false);
RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomString& family, const FontDescription&, float size, AllowUserInstalledFonts);
RetainPtr<CTFontRef> platformFontWithFamily(const AtomString& family, FontSelectionRequest, TextRenderingMode, float size);
bool requiresCustomFallbackFont(UChar32 character);
FontSelectionCapabilities capabilitiesForFontDescriptor(CTFontDescriptorRef);
void addAttributesForInstalledFonts(CFMutableDictionaryRef attributes, AllowUserInstalledFonts);
RetainPtr<CTFontRef> createFontForInstalledFonts(CTFontDescriptorRef, CGFloat size, AllowUserInstalledFonts);
RetainPtr<CTFontRef> createFontForInstalledFonts(CTFontRef, AllowUserInstalledFonts);
void addAttributesForWebFonts(CFMutableDictionaryRef attributes, AllowUserInstalledFonts);
RetainPtr<CFSetRef> installedFontMandatoryAttributes(AllowUserInstalledFonts);
}