summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <megas.kapaneus@gmail.com>2013-04-09 13:01:27 +0200
committerPhilipp Gesang <megas.kapaneus@gmail.com>2013-04-09 13:01:27 +0200
commitb3fe27445a0608084f3a87f1ac9d60a08615aab8 (patch)
treed33af3eb6ca72640e370e4d0a2c73118bfa11047
parent65481c5210c2bb8137ed8fddbbcc42dcb3a002bc (diff)
downloadluaotfload-b3fe27445a0608084f3a87f1ac9d60a08615aab8.tar.gz
update fonts-ext
-rw-r--r--otfl-fonts-ext.lua16
1 files changed, 6 insertions, 10 deletions
diff --git a/otfl-fonts-ext.lua b/otfl-fonts-ext.lua
index d8884cc..b60d045 100644
--- a/otfl-fonts-ext.lua
+++ b/otfl-fonts-ext.lua
@@ -18,18 +18,14 @@ local otffeatures = fonts.constructors.newfeatures("otf")
local function initializeitlc(tfmdata,value)
if value then
- -- the magic 40 and it formula come from Dohyun Kim
- local parameters = tfmdata.parameters
+ -- the magic 40 and it formula come from Dohyun Kim but we might need another guess
+ local parameters = tfmdata.parameters
local italicangle = parameters.italicangle
if italicangle and italicangle ~= 0 then
- local uwidth = (parameters.uwidth or 40)/2
- for unicode, d in next, tfmdata.descriptions do
- local it = d.boundingbox[3] - d.width + uwidth
- if it ~= 0 then
- d.italic = it
- end
- end
- tfmdata.properties.hasitalics = true
+ local properties = tfmdata.properties
+ local factor = tonumber(value) or 1
+ properties.hasitalics = true
+ properties.autoitalicamount = factor * (parameters.uwidth or 40)/2
end
end
end