summaryrefslogtreecommitdiff
path: root/tex/context/base/font-ext.lua
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2011-02-25 23:40:24 +0200
committerMarius <mariausol@gmail.com>2011-02-25 23:40:24 +0200
commit2a9554684f61df8db63dec6d4e874f49b25a212b (patch)
treefcfd079187ab1f1969351bcafffdfed837b43b33 /tex/context/base/font-ext.lua
parent3880c6aa8cef3b379b06777c09f9ce3e7e61f493 (diff)
downloadcontext-2a9554684f61df8db63dec6d4e874f49b25a212b.tar.gz
beta 2011.02.25 22:03
Diffstat (limited to 'tex/context/base/font-ext.lua')
-rw-r--r--tex/context/base/font-ext.lua102
1 files changed, 53 insertions, 49 deletions
diff --git a/tex/context/base/font-ext.lua b/tex/context/base/font-ext.lua
index eb1e9f447..16a0008cc 100644
--- a/tex/context/base/font-ext.lua
+++ b/tex/context/base/font-ext.lua
@@ -49,19 +49,21 @@ local otf = fonts.otf
<p>This feature will remove inter-digit kerns.</p>
--ldx]]--
-table.insert(triggers,"equaldigits")
-
-function initializers.common.equaldigits(tfmdata,value)
- if value then
- local chr = tfmdata.characters
- for i = utfbyte('0'), utfbyte('9') do
- local c = chr[i]
- if c then
- c.kerns = nil
- end
- end
- end
-end
+-- old code, no kerns set at this point, so this has to be done afterwards
+--
+-- table.insert(triggers,"equaldigits")
+--
+-- function initializers.common.equaldigits(tfmdata,value)
+-- if value then
+-- local chr = tfmdata.characters
+-- for i = utfbyte('0'), utfbyte('9') do
+-- local c = chr[i]
+-- if c then
+-- c.kerns = nil
+-- end
+-- end
+-- end
+-- end
--[[ldx--
<p>This feature will give all glyphs an equal height and/or depth. Valid
@@ -69,42 +71,44 @@ values are <type>none</type>, <type>height</type>, <type>depth</type> and
<type>both</type>.</p>
--ldx]]--
-table.insert(triggers,"lineheight")
-
-function initializers.common.lineheight(tfmdata,value)
- if value and type(value) == "string" then
- if value == "none" then
- for _,v in next, tfmdata.characters do
- v.height, v.depth = 0, 0
- end
- else
- local ascender, descender = tfmdata.ascender, tfmdata.descender
- if ascender and descender then
- local ht, dp = ascender or 0, descender or 0
- if value == "height" then
- dp = 0
- elseif value == "depth" then
- ht = 0
- end
- if ht > 0 then
- if dp > 0 then
- for _,v in next, tfmdata.characters do
- v.height, v.depth = ht, dp
- end
- else
- for _,v in next, tfmdata.characters do
- v.height = ht
- end
- end
- elseif dp > 0 then
- for _,v in next, tfmdata.characters do
- v.depth = dp
- end
- end
- end
- end
- end
-end
+-- old code, no dimensions set at this point, so this has to be done afterwards
+--
+-- table.insert(triggers,"lineheight")
+--
+-- function initializers.common.lineheight(tfmdata,value)
+-- if value and type(value) == "string" then
+-- if value == "none" then
+-- for _,v in next, tfmdata.characters do
+-- v.height, v.depth = 0, 0
+-- end
+-- else
+-- local ascender, descender = tfmdata.ascender, tfmdata.descender
+-- if ascender and descender then
+-- local ht, dp = ascender or 0, descender or 0
+-- if value == "height" then
+-- dp = 0
+-- elseif value == "depth" then
+-- ht = 0
+-- end
+-- if ht > 0 then
+-- if dp > 0 then
+-- for _,v in next, tfmdata.characters do
+-- v.height, v.depth = ht, dp
+-- end
+-- else
+-- for _,v in next, tfmdata.characters do
+-- v.height = ht
+-- end
+-- end
+-- elseif dp > 0 then
+-- for _,v in next, tfmdata.characters do
+-- v.depth = dp
+-- end
+-- end
+-- end
+-- end
+-- end
+-- end
-- -- -- -- -- --
-- shared