diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2011-04-21 06:59:53 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2011-04-21 06:59:53 +0200 |
commit | acca6bfc8c0efcbb4e877dd97fcf945194f8ba8b (patch) | |
tree | e5e0cda47edf2c5fe20d36aa24efde02c809aef1 | |
parent | 56ac30d7665e2b9dd5c238372203405518503e8d (diff) | |
download | luaotfload-acca6bfc8c0efcbb4e877dd97fcf945194f8ba8b.tar.gz |
Temporarly add this code back, I want to make a release
-rw-r--r-- | luaotfload.dtx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/luaotfload.dtx b/luaotfload.dtx index 586b8be..548251d 100644 --- a/luaotfload.dtx +++ b/luaotfload.dtx @@ -675,6 +675,32 @@ luatexbase.add_to_callback("find_vf_file", fonts.vf.find, "luaotfload.find_vf_file") % \end{macrocode} +% XXX: see https://github.com/wspr/unicode-math/issues/185 +% +% \luatex does not provide interface to accessing +% |(Script)ScriptPercentScaleDown| math constants, so we +% emulate \xetex behaviour by setting |\fontdimen10| and +% |\fontdimen11|. +% +% \begin{macrocode} +local function set_sscale_diments(fontdata) + local mc = fontdata.MathConstants + if mc then + if mc["ScriptPercentScaleDown"] then + fontdata.parameters[10] = mc.ScriptPercentScaleDown + else -- resort to plain TeX default + fontdata.parameters[10] = 70 + end + if mc["ScriptScriptPercentScaleDown"] then + fontdata.parameters[11] = mc.ScriptScriptPercentScaleDown + else -- resort to plain TeX default + fontdata.parameters[11] = 50 + end + end +end + +luatexbase.add_to_callback("luaotfload.patch_font", set_sscale_diments, "unicodemath.set_sscale_diments") +% \end{macrocode} % % \iffalse %</lua> |