diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2017-06-01 11:25:09 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2017-06-01 12:13:52 +0200 |
commit | ac052de8f7b6b6976ab89601388a1bd4d421e58b (patch) | |
tree | b9cc2fb26548365f8c9fb4610a6e917f6a6ec434 /libass/dwrite_c.h | |
parent | 4cf8d6bb3e6b75f8215b69f697b6b5c05b1c1dd2 (diff) | |
download | libass-ac052de8f7b6b6976ab89601388a1bd4d421e58b.tar.bz2 libass-ac052de8f7b6b6976ab89601388a1bd4d421e58b.tar.xz |
directwrite: fix font collections
DirectWrite's FontFileStream does not actually use the data of a specific
font in a collection, which was an expectation of the existing code. It
simply returns a stream to the underlying file, collection or not. So we
need to get the index of the font. This needs to be done lazily as this
information is only available in a FontFace, which is expensive to
initialize.
Add a new optional font provider function for lazy initialization of the
index and use it. This is similar to the check_postscript callback.
Fixes libass#275.
v2: fix type of returned value.
Diffstat (limited to 'libass/dwrite_c.h')
-rw-r--r-- | libass/dwrite_c.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libass/dwrite_c.h b/libass/dwrite_c.h index 93c78a7..c902525 100644 --- a/libass/dwrite_c.h +++ b/libass/dwrite_c.h @@ -335,6 +335,8 @@ DECLARE_INTERFACE_(IDWriteFontFace,IUnknown) UINT32 *numberOfFiles, IDWriteFontFile **fontFiles) PURE; + STDMETHOD_(UINT32, GetIndex)(THIS) PURE; + /* rest dropped */ END_INTERFACE }; @@ -342,6 +344,7 @@ DECLARE_INTERFACE_(IDWriteFontFace,IUnknown) #define IDWriteFontFace_Release(This) (This)->lpVtbl->Release(This) #define IDWriteFontFace_GetType(This) (This)->lpVtbl->GetType(This) #define IDWriteFontFace_GetFiles(This,fontFiles,b) (This)->lpVtbl->GetFiles(This,fontFiles,b) +#define IDWriteFontFace_GetIndex(This) (This)->lpVtbl->GetIndex(This) #endif /*COBJMACROS*/ #undef INTERFACE |