]> granicus.if.org Git - libass/commit
directwrite: fix font collections dw-collections
authorGrigori Goronzy <greg@chown.ath.cx>
Thu, 1 Jun 2017 09:25:09 +0000 (11:25 +0200)
committerGrigori Goronzy <greg@chown.ath.cx>
Thu, 1 Jun 2017 10:13:52 +0000 (12:13 +0200)
commitac052de8f7b6b6976ab89601388a1bd4d421e58b
treeb9cc2fb26548365f8c9fb4610a6e917f6a6ec434
parent4cf8d6bb3e6b75f8215b69f697b6b5c05b1c1dd2
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.
libass/ass_directwrite.c
libass/ass_fontselect.c
libass/ass_fontselect.h
libass/dwrite_c.h