summaryrefslogtreecommitdiff
path: root/otfl-fonts-ext.lua
diff options
context:
space:
mode:
authorElie Roux <elie.roux@telecom-bretagne.eu>2013-04-18 18:09:20 +0200
committerElie Roux <elie.roux@telecom-bretagne.eu>2013-04-18 18:09:20 +0200
commita9510469b60edeceedf72811e7737ea0f3c56dc5 (patch)
tree5c7a80ce3a0c2f1d22c12bff36f84355df554c46 /otfl-fonts-ext.lua
parente67643a60422ed265dc5ad8955a83140598385f1 (diff)
parentb0c22678d1f776f991ffef67694451b8bb5f9e20 (diff)
downloadluaotfload-a9510469b60edeceedf72811e7737ea0f3c56dc5.tar.gz
Merge branch 'experimental' of phi-gamma/luaotfload into phi-gamma-experimental
Conflicts: mkluatexfontdb.lua otfl-basics-gen.lua
Diffstat (limited to 'otfl-fonts-ext.lua')
-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