Improve and future-proof OTF fonts support in w32uniscribe.c
commitae7cfd0baf24fda984ff4c0631bcaa477ea11b7f
authorEli Zaretskii <eliz@gnu.org>
Wed, 19 Aug 2015 15:04:22 +0000 (19 18:04 +0300)
committerEli Zaretskii <eliz@gnu.org>
Wed, 19 Aug 2015 15:04:22 +0000 (19 18:04 +0300)
tree9a3dae67498d68e75afbc92b6c7e2586b8ead738
parent7eed7399358faecd719febae4dc720ef2be41155
Improve and future-proof OTF fonts support in w32uniscribe.c

* src/w32uniscribe.c (uniscribe_otf_capability): Add commentary
about the expected results and why the new Uniscribe APIs are not
used in this function.
(ScriptGetFontScriptTags_Proc, ScriptGetFontLanguageTags_Proc)
(ScriptGetFontFeatureTags_Proc): New function typedefs.
(uniscribe_new_apis): New static variable.
(uniscribe_check_features): New function, implements OTF features
verification while correctly accounting for features in the list
after the nil member, if any.
(uniscribe_check_otf_1): New function, retrieves the features
supported by the font for the requested script and language using
the Uniscribe APIs available from Windows Vista onwards.
(uniscribe_check_otf): If the new Uniscribe APIs are available,
use them in preference to reading the font data directly.  Call
uniscribe_check_features to verify that the requested features are
supported, replacing the original incomplete code.
(syms_of_w32uniscribe): Initialize function pointers for the new
Uniscribe APIs.  (Bug#21260)
(otf_features): Scan the script, langsys, and feature arrays back
to front, so that the result we return has them in alphabetical
order, like ftfont.c does.
* src/w32fns.c (syms_of_w32fns) <w32-disable-new-uniscribe-apis>:
New variable for debugging w32uniscribe.c code.
src/w32fns.c
src/w32uniscribe.c