Line data Source code
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_NativeFontResourceFontconfig_h
8 : #define mozilla_gfx_NativeFontResourceFontconfig_h
9 :
10 : #include "2D.h"
11 :
12 : #include <cairo-ft.h>
13 : #include "mozilla/UniquePtr.h"
14 :
15 : namespace mozilla {
16 : namespace gfx {
17 :
18 : class NativeFontResourceFontconfig final : public NativeFontResource
19 : {
20 : public:
21 0 : MOZ_DECLARE_REFCOUNTED_VIRTUAL_TYPENAME(NativeFontResourceFontconfig)
22 :
23 : static already_AddRefed<NativeFontResourceFontconfig>
24 : Create(uint8_t *aFontData, uint32_t aDataLength, FT_Library aFTLibrary = nullptr);
25 :
26 : already_AddRefed<UnscaledFont>
27 : CreateUnscaledFont(uint32_t aIndex,
28 : const uint8_t* aInstanceData, uint32_t aInstanceDataLength) final;
29 :
30 : ~NativeFontResourceFontconfig();
31 :
32 : private:
33 : NativeFontResourceFontconfig(UniquePtr<uint8_t[]>&& aFontData, FT_Face aFace);
34 :
35 : UniquePtr<uint8_t[]> mFontData;
36 : FT_Face mFace;
37 : };
38 :
39 : } // gfx
40 : } // mozilla
41 :
42 : #endif // mozilla_gfx_NativeFontResourceFontconfig_h
|