diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-10-05 17:04:18 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-10-05 17:04:18 +0200 |
commit | 6359695c65028baeb2296bd4b2e0c41a34dd8f0e (patch) | |
tree | 95fe600e7e858e0fc10cf4028bb6a8c7906ef41e /tex/context/fonts | |
parent | 318b6f5f9f606d1fa45c1f23564478475fa1fc4c (diff) | |
download | context-6359695c65028baeb2296bd4b2e0c41a34dd8f0e.tar.gz |
2017-10-05 16:30:00
Diffstat (limited to 'tex/context/fonts')
-rw-r--r-- | tex/context/fonts/mkiv/stix-two-math.lfg | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tex/context/fonts/mkiv/stix-two-math.lfg b/tex/context/fonts/mkiv/stix-two-math.lfg index ded97f92e..7652796a9 100644 --- a/tex/context/fonts/mkiv/stix-two-math.lfg +++ b/tex/context/fonts/mkiv/stix-two-math.lfg @@ -1,3 +1,32 @@ +-- Bah, I really hate these patches especially because one needs to make +-- sure that they are still valid when the font gets updated. So, let's +-- do it runtime (not in the cached copy) and issue a warning every run. +-- As we cannot rely on version numbers (if we have more patches) we +-- check for values instead. +-- +-- This font also has inconsistent italics in smalelr sizes which we can +-- fix in a more general way but I'm not sure if we want that. + +local function fix_italic(target,original,name,value,factor) + local m = target.parameters.mathsize + local u = original.resources.unicodes[name] + if m and u then + local c = target.characters[u] + if c then + local i = c.italic + if i then + local d = original.descriptions[u] + if d and d.math.italic == value then + if m then + logs.report("patching font","fixing italic correction of %U at math size %i by %0.3f",u,m,factor) + c.italic = factor * i + end + end + end + end + end +end + return { name = "stix-two-math", version = "1.00", @@ -21,6 +50,13 @@ return { -- todo = { feature = 'ss14', value = 1, comment = "" }, circled = { feature = 'ss16', value = 1, comment = "Mathematical Alternative Circled Operators" }, }, + tweaks = { + aftercopying = { + function(target,original) + fix_italic(target,original,"uni222B.updsp",80,3) + end, + }, + }, }, } |