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/. */
7 #ifndef mozilla_gfx_NativeFontResourceGDI_h
8 #define mozilla_gfx_NativeFontResourceGDI_h
13 #include "mozilla/AlreadyAddRefed.h"
14 #include "mozilla/Vector.h"
19 class NativeFontResourceGDI final
: public NativeFontResource
{
21 MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(NativeFontResourceGDI
, override
)
24 * Creates a NativeFontResourceGDI if data is valid. Note aFontData will be
25 * copied if required and so can be released after calling.
27 * @param aFontData the SFNT data.
28 * @param aDataLength length of data.
29 * @return Referenced NativeFontResourceGDI or nullptr if invalid.
31 static already_AddRefed
<NativeFontResourceGDI
> Create(uint8_t* aFontData
,
32 uint32_t aDataLength
);
34 virtual ~NativeFontResourceGDI();
36 already_AddRefed
<UnscaledFont
> CreateUnscaledFont(
37 uint32_t aIndex
, const uint8_t* aInstanceData
,
38 uint32_t aInstanceDataLength
) final
;
41 explicit NativeFontResourceGDI(HANDLE aFontResourceHandle
, size_t aDataLength
)
42 : NativeFontResource(aDataLength
),
43 mFontResourceHandle(aFontResourceHandle
) {}
45 HANDLE mFontResourceHandle
;
49 } // namespace mozilla
51 #endif // mozilla_gfx_NativeFontResourceGDI_h