diff options
Diffstat (limited to 'Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua')
-rw-r--r-- | Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua index da9cdcc9981..c1b8236cb58 100644 --- a/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua +++ b/Master/texmf-dist/tex/luatex/luaotfload/luaotfload-auxiliary.lua @@ -6,8 +6,8 @@ local ProvidesLuaModule = { name = "luaotfload-auxiliary", - version = "2.97", --TAGVERSION - date = "2019-05-18", --TAGDATE + version = "2.98", --TAGVERSION + date = "2019-07-04", --TAGDATE description = "luaotfload submodule / auxiliary functions", license = "GPL v2.0" } @@ -287,6 +287,21 @@ luaotfload_callbacks [#luaotfload_callbacks + 1] = { "patch_font", set_capheight, "set_capheight", } +-- Of course there are also fonts with no sensible x-height, so let's add a +-- fallback there: +local function set_xheight(tfmdata) + local parameters = tfmdata.parameters + if not parameters then return end + if not (parameters.x_height or parameters[5] or 0) == 0 then return end + if tfmdata.characters and tfmdata.characters[120] then + parameters.x_height = tfmdata.characters[120].height + else + parameters.x_height = (parameters.ascender or 0)/2 + end +end +luaotfload_callbacks [#luaotfload_callbacks + 1] = { + "patch_font", set_xheight, "set_xheight", +} ----------------------------------------------------------------------- --- glyphs and characters ----------------------------------------------------------------------- |