FontCustomPlatformData.h [plain text]
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
#include "FontPlatformData.h"
#include "TextFlags.h"
#include <CoreFoundation/CFBase.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/RetainPtr.h>
typedef struct CGFont* CGFontRef;
typedef const struct __CTFontDescriptor* CTFontDescriptorRef;
namespace WebCore {
class FontDescription;
struct FontSelectionSpecifiedCapabilities;
class SharedBuffer;
template <typename T> class FontTaggedSettings;
typedef FontTaggedSettings<int> FontFeatureSettings;
struct FontCustomPlatformData {
WTF_MAKE_NONCOPYABLE(FontCustomPlatformData); WTF_MAKE_FAST_ALLOCATED;
public:
explicit FontCustomPlatformData(CTFontDescriptorRef fontDescriptor, FontPlatformData::CreationData&& creationData)
: fontDescriptor(fontDescriptor)
, creationData(WTFMove(creationData))
{
}
WEBCORE_EXPORT ~FontCustomPlatformData();
FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, FontSelectionSpecifiedCapabilities fontFaceCapabilities);
static bool supportsFormat(const String&);
RetainPtr<CTFontDescriptorRef> fontDescriptor;
FontPlatformData::CreationData creationData;
};
WEBCORE_EXPORT std::unique_ptr<FontCustomPlatformData> createFontCustomPlatformData(SharedBuffer&, const String&);
}
#endif