FontCustomPlatformData.h [plain text]
#ifndef FontCustomPlatformData_h
#define FontCustomPlatformData_h
#include "TextFlags.h"
#include <windows.h>
#include <wtf/Forward.h>
#include <wtf/Noncopyable.h>
#include <wtf/text/WTFString.h>
#if USE(CORE_TEXT)
#include <pal/spi/win/CoreTextSPIWin.h>
#endif
typedef struct CGFont* CGFontRef;
namespace WebCore {
class FontDescription;
class FontPlatformData;
class SharedBuffer;
struct FontSelectionSpecifiedCapabilities;
struct FontVariantSettings;
template <typename T> class FontTaggedSettings;
typedef FontTaggedSettings<int> FontFeatureSettings;
struct FontCustomPlatformData {
WTF_MAKE_FAST_ALLOCATED;
WTF_MAKE_NONCOPYABLE(FontCustomPlatformData);
public:
FontCustomPlatformData(HANDLE fontReference, const String& name)
: fontReference(fontReference)
, name(name)
{
}
~FontCustomPlatformData();
FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, FontSelectionSpecifiedCapabilities);
static bool supportsFormat(const String&);
HANDLE fontReference;
String name;
#if USE(CORE_TEXT)
RetainPtr<CTFontDescriptorRef> fontDescriptor;
#endif
};
std::unique_ptr<FontCustomPlatformData> createFontCustomPlatformData(SharedBuffer&, const String&);
}
#endif