Kiwano Engine v1.3.x
FontCollectionLoader.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{
31interface DWRITE_DECLARE_INTERFACE("7EC7A55A-1964-4098-83E0-EFA7C12C6EF7") IFontCollectionLoader
32 : public IDWriteFontCollectionLoader
33{
34public:
35 static HRESULT Create(_Out_ IFontCollectionLoader * *ppCollectionLoader);
36
37 STDMETHOD(AddFilePaths)
38 (const Vector<String>& filePaths, _Out_ LPVOID* pCollectionKey, _Out_ uint32_t* pCollectionKeySize) PURE;
39};
40
41interface DWRITE_DECLARE_INTERFACE("0A1A3F2A-85F2-41BB-80FD-EC01271740C4") IFontFileEnumerator
42 : public IDWriteFontFileEnumerator
43{
44public:
45 static HRESULT Create(_Out_ IFontFileEnumerator * *ppEnumerator, IDWriteFactory * pFactory);
46
47 STDMETHOD(SetFilePaths)(const Vector<String>& filePaths) PURE;
48};
49
50interface DWRITE_DECLARE_INTERFACE("F2C411F0-2FB0-4D0E-8C73-D2B8F30137A4") IResourceFontCollectionLoader
51 : public IDWriteFontCollectionLoader
52{
53public:
54 static HRESULT Create(_Out_ IResourceFontCollectionLoader * *ppCollectionLoader,
55 IDWriteFontFileLoader * pFileLoader);
56
57 STDMETHOD(AddResources)
58 (const Vector<BinaryData>& data, _Out_ LPVOID* pCollectionKey, _Out_ uint32_t* pCollectionKeySize) PURE;
59};
60
61interface DWRITE_DECLARE_INTERFACE("08D21408-6FC1-4E36-A4EB-4DA16BE3399E") IResourceFontFileLoader
62 : public IDWriteFontFileLoader
63{
64public:
65 static HRESULT Create(_Out_ IResourceFontFileLoader * *ppFileLoader);
66};
67
68interface DWRITE_DECLARE_INTERFACE("0AD0EC74-7503-46E8-8899-520175ECCB4A") IResourceFontFileEnumerator
69 : public IDWriteFontFileEnumerator
70{
71public:
72 static HRESULT Create(_Out_ IResourceFontFileEnumerator * *ppEnumerator, IDWriteFactory * pFactory,
73 IDWriteFontFileLoader * pFileLoader);
74
75 STDMETHOD(SetResources)(const Vector<BinaryData>& data) PURE;
76};
77
78interface DWRITE_DECLARE_INTERFACE("A6267450-27F3-4948-995F-FF8345A72F88") IResourceFontFileStream
79 : public IDWriteFontFileStream
80{
81public:
82 static HRESULT Create(_Out_ IResourceFontFileStream * *ppStream, const BinaryData& data);
83};
84
85} // namespace directx
86} // namespace graphics
87} // namespace kiwano