Kiwano Engine v1.3.x
FontLoader.h
1// Copyright (c) 2016-2018 Kiwano - Nomango
2//
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"), to deal
5// in the Software without restriction, including without limitation the rights
6// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7// copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9//
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12//
13// THE SOFTWARE IS PROVIDED "AS IS", WITH_Out_ WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// _Out_ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21#pragma once
22#include <kiwano/core/BinaryData.h>
23#include <kiwano/render/DirectX/helper.h>
24
25namespace kiwano
26{
27namespace graphics
28{
29namespace directx
30{
31
32// Loaders for font files
33
34interface DWRITE_DECLARE_INTERFACE("7EC7A55A-1964-4098-83E0-EFA7C12C6EF7") IFontFileCollectionLoader
35 : public IDWriteFontCollectionLoader
36{
37public:
38 static HRESULT Create(_Out_ IFontFileCollectionLoader * *ppCollectionLoader);
39
40 STDMETHOD(AddFilePaths)
41 (const Vector<String>& filePaths, _Out_ LPVOID* pCollectionKey, _Out_ uint32_t* pCollectionKeySize) PURE;
42};
43
44interface DWRITE_DECLARE_INTERFACE("0A1A3F2A-85F2-41BB-80FD-EC01271740C4") IFontFileEnumerator
45 : public IDWriteFontFileEnumerator
46{
47public:
48 static HRESULT Create(_Out_ IFontFileEnumerator * *ppEnumerator, IDWriteFactory * pFactory);
49
50 STDMETHOD(SetFilePaths)(const Vector<String>& filePaths) PURE;
51};
52
53// Loaders for font resources
54
55interface DWRITE_DECLARE_INTERFACE("08D21408-6FC1-4E36-A4EB-4DA16BE3399E") IFontResourceLoader
56 : public IDWriteFontFileLoader
57{
58public:
59 static HRESULT Create(_Out_ IFontResourceLoader * *ppResLoader);
60};
61
62interface DWRITE_DECLARE_INTERFACE("F2C411F0-2FB0-4D0E-8C73-D2B8F30137A4") IFontResourceCollectionLoader
63 : public IDWriteFontCollectionLoader
64{
65public:
66 static HRESULT Create(_Out_ IFontResourceCollectionLoader * *ppCollectionLoader, IFontResourceLoader * pResLoader);
67
68 STDMETHOD(AddResources)
69 (const Vector<BinaryData>& data, _Out_ LPVOID* pCollectionKey, _Out_ uint32_t* pCollectionKeySize) PURE;
70};
71
72interface DWRITE_DECLARE_INTERFACE("0AD0EC74-7503-46E8-8899-520175ECCB4A") IFontResourceEnumerator
73 : public IDWriteFontFileEnumerator
74{
75public:
76 static HRESULT Create(_Out_ IFontResourceEnumerator * *ppEnumerator, IDWriteFactory * pFactory,
77 IFontResourceLoader * pResLoader);
78
79 STDMETHOD(SetResources)(const Vector<BinaryData>& data) PURE;
80};
81
82interface DWRITE_DECLARE_INTERFACE("A6267450-27F3-4948-995F-FF8345A72F88") IFontResourceStream
83 : public IDWriteFontFileStream
84{
85public:
86 static HRESULT Create(_Out_ IFontResourceStream * *ppStream, const BinaryData& data);
87};
88
89} // namespace directx
90} // namespace graphics
91} // namespace kiwano