From 40e5474605a264df191cc78459df32c840fe83d0 Mon Sep 17 00:00:00 2001
From: Khaled Hosny <khaledhosny@eglug.org>
Date: Tue, 29 Dec 2009 18:50:02 +0200
Subject: Add support for font slanting/extending

---
 luaotfload.dtx | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 51 insertions(+), 5 deletions(-)

(limited to 'luaotfload.dtx')

diff --git a/luaotfload.dtx b/luaotfload.dtx
index 57c2821..93f3fb1 100644
--- a/luaotfload.dtx
+++ b/luaotfload.dtx
@@ -34,7 +34,7 @@
 \input docstrip.tex
 \Msg{************************************************************************}
 \Msg{* Installation}
-\Msg{* Package: luaotfload 2009/12/01 v1.06 ConTeXt font loading system}
+\Msg{* Package: luaotfload 2009/12/29 v1.07 ConTeXt font loading system}
 \Msg{************************************************************************}
 
 \keepsilent
@@ -100,7 +100,7 @@ and the derived files
 %<*driver>
 \NeedsTeXFormat{LaTeX2e}
 \ProvidesFile{luaotfload.drv}%
-  [2009/12/01 v1.06 ConTeXt font loading system]%
+  [2009/12/29 v1.07 ConTeXt font loading system]%
 \documentclass{ltxdoc}
 \usepackage{metalogo}
 \usepackage[colorlinks=true]{hyperref}
@@ -133,7 +133,7 @@ and the derived files
 % \GetFileInfo{luaotfload.drv}
 %
 % \title{The \textsf{luaotfload} package}
-% \date{2009/12/01 v1.06}
+% \date{2009/12/29 v1.07}
 % \author{Elie Roux \\ \texttt{elie.roux@telecom-bretagne.eu}}
 %
 % \maketitle
@@ -299,7 +299,7 @@ luaotfload          = { }
 luaotfload.module = {
     name          = "luaotfload",
     version       = 1.06,
-    date          = "2009/12/01",
+    date          = "2009/12/29",
     description   = "ConTeXt font loading system.",
     author        = "Elie Roux & Hans Hagen",
     copyright     = "Elie Roux",
@@ -533,6 +533,52 @@ luaotfload.loadmodule('font-xtx.lua')
 luaotfload.loadmodule('font-map.lua')
 luaotfload.loadmodule('font-dum.lua')
 
+%    \end{macrocode}
+%
+%    Support for font slanting and extending.
+%
+%    \begin{macrocode}
+
+fonts.triggers            = fonts.triggers            or { }
+fonts.initializers        = fonts.initializers        or { }
+fonts.initializers.common = fonts.initializers.common or { }
+
+local initializers = fonts.initializers
+
+table.insert(fonts.triggers,"slant")
+
+function fonts.initializers.common.slant(tfmdata,value)
+    value = tonumber(value)
+    if not value then
+        value =  0
+    elseif value >  1 then
+        value =  1
+    elseif value < -1 then
+        value = -1
+    end
+    tfmdata.slant_factor = value
+end
+
+initializers.base.otf.slant = initializers.common.slant
+initializers.node.otf.slant = initializers.common.slant
+
+table.insert(fonts.triggers,"extend")
+
+function initializers.common.extend(tfmdata,value)
+    value = tonumber(value)
+    if not value then
+        value =  0
+    elseif value >  10 then
+        value =  10
+    elseif value < -10 then
+        value = -10
+    end
+    tfmdata.extend_factor = value
+end
+
+initializers.base.otf.extend = initializers.common.extend
+initializers.node.otf.extend = initializers.common.extend
+
 %    \end{macrocode}
 %
 %    This is a small patch that prevents errors in some \LaTeX\ files.
@@ -598,7 +644,7 @@ end
 \else
   \NeedsTeXFormat{LaTeX2e}
   \ProvidesPackage{luaotfload}%
-    [2009/12/01 v1.06 ConTeXt font loading system]
+    [2009/12/29 v1.07 ConTeXt font loading system]
   \RequirePackage{luatextra}
 \fi
 
-- 
cgit v1.2.3

