diff options
author | Karl Berry <karl@freefriends.org> | 2010-11-07 23:46:37 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-11-07 23:46:37 +0000 |
commit | 9e8226cf8fa5064b6ad05024b81992bab84a2b20 (patch) | |
tree | 434c70827da491ac26b4f13cee656d1659ee9ecd /Master/texmf-dist/tex/latex/fontspec/fontspec.lua | |
parent | 22a34b48cbe27e4f449105b3efe4815e96b48868 (diff) |
fontspec 2.1d (7nov10)
git-svn-id: svn://tug.org/texlive/trunk@20356 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/fontspec/fontspec.lua')
-rw-r--r-- | Master/texmf-dist/tex/latex/fontspec/fontspec.lua | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index 34904eb5030..040e5dcb8a4 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -16,7 +16,6 @@ fontspec = { } - fontspec.module = { name = "fontspec", version = 2.0, @@ -26,19 +25,11 @@ fontspec.module = { copyright = "Khaled Hosny", license = "LPPL" } - luatexbase.provides_module(fontspec.module) - - -utf = unicode.utf8 - function fontspec.log (...) luatexbase.module_log (fontspec.module.name, string.format(...)) end function fontspec.warning(...) luatexbase.module_warning(fontspec.module.name, string.format(...)) end function fontspec.error (...) luatexbase.module_error (fontspec.module.name, string.format(...)) end - function fontspec.sprint (...) tex.sprint(luatexbase.catcodetables['latex-package'], ...) end - - local function check_script(id, script) local s = string.lower(script) if id and id > 0 then @@ -57,7 +48,6 @@ local function check_script(id, script) end end end - local function check_language(id, language, script) local s = string.lower(script) local l = string.lower(language) @@ -77,7 +67,6 @@ local function check_language(id, language, script) end end end - local function check_feature(id, feature, language, script) local s = string.lower(script) local l = string.lower(language) @@ -98,11 +87,8 @@ local function check_feature(id, feature, language, script) end end end - - local function tempswatrue() fontspec.sprint([[\@tempswatrue]]) end local function tempswafalse() fontspec.sprint([[\@tempswafalse]]) end - function fontspec.check_ot_script(fnt, script) if check_script(font.id(fnt), script) then tempswatrue() @@ -110,7 +96,6 @@ function fontspec.check_ot_script(fnt, script) tempswafalse() end end - function fontspec.check_ot_lang(fnt, lang, script) if check_language(font.id(fnt), lang, script) then tempswatrue() @@ -118,7 +103,6 @@ function fontspec.check_ot_lang(fnt, lang, script) tempswafalse() end end - function fontspec.check_ot_feat(fnt, feat, lang, script) for _, f in ipairs { "+trep", "+tlig", "+anum" } do if feat == f then @@ -132,7 +116,20 @@ function fontspec.check_ot_feat(fnt, feat, lang, script) tempswafalse() end end - +function fontspec.mathfontdimen(fnt, str) + local mathdimens = fonts.ids[font.id(fnt)].MathConstants + if mathdimens then + local m = mathdimens[str] + if m then + fontspec.sprint(mathdimens[str]) + fontspec.sprint("sp") + else + fontspec.sprint("0pt") + end + else + fontspec.sprint("0pt") + end +end -- -- Copyright 2004--2010 Will Robertson <wspr81@gmail.com> -- Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> |