1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #ifndef MOZILLA_GFX_UNSCALEDFONTGDI_H_ 8 #define MOZILLA_GFX_UNSCALEDFONTGDI_H_ 9 10 #include "2D.h" 11 #include <windows.h> 12 13 namespace mozilla { 14 namespace gfx { 15 16 class UnscaledFontGDI final : public UnscaledFont { 17 public: MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(UnscaledFontGDI,override)18 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(UnscaledFontGDI, override) 19 explicit UnscaledFontGDI(const LOGFONT& aLogFont) : mLogFont(aLogFont) {} 20 GetType()21 FontType GetType() const override { return FontType::GDI; } 22 GetLogFont()23 const LOGFONT& GetLogFont() const { return mLogFont; } 24 25 bool GetFontFileData(FontFileDataOutput aDataCallback, void* aBaton) override; 26 27 bool GetFontDescriptor(FontDescriptorOutput aCb, void* aBaton) override; 28 29 bool GetFontInstanceData(FontInstanceDataOutput aCb, void* aBaton) override; 30 31 static already_AddRefed<UnscaledFont> CreateFromFontDescriptor( 32 const uint8_t* aData, uint32_t aDataLength, uint32_t aIndex); 33 34 already_AddRefed<ScaledFont> CreateScaledFont( 35 Float aGlyphSize, const uint8_t* aInstanceData, 36 uint32_t aInstanceDataLength, const FontVariation* aVariations, 37 uint32_t aNumVariations) override; 38 39 private: 40 LOGFONT mLogFont; 41 }; 42 43 } // namespace gfx 44 } // namespace mozilla 45 46 #endif /* MOZILLA_GFX_UNSCALEDFONTGDI_H_ */ 47