diff options
author | Karl Berry <karl@freefriends.org> | 2010-07-11 22:45:47 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-07-11 22:45:47 +0000 |
commit | 06225999a570c8450530342ebf5f7e72a2e25846 (patch) | |
tree | 85b43561c8a6af45c02be769c441d17e27b1f71e /Master/texmf-dist/tex/latex/fontspec/fontspec.lua | |
parent | 6167f82118ec565f0cc686d68fc7bece5e8dbb9b (diff) |
fontspec 2.0a (11jul10)
git-svn-id: svn://tug.org/texlive/trunk@19384 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 | 39 |
1 files changed, 4 insertions, 35 deletions
diff --git a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua index b777424cfeb..8303421e1c0 100644 --- a/Master/texmf-dist/tex/latex/fontspec/fontspec.lua +++ b/Master/texmf-dist/tex/latex/fontspec/fontspec.lua @@ -15,6 +15,7 @@ -- + fontspec = { } fontspec.module = { @@ -100,22 +101,11 @@ local function check_feature(id, feature, language, script) end -local function font_id(str) - local id - if tex.luatexversion >= 47 then - id = font.id(str) - else - id = token.create(str)[2] - end - return id -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 + if check_script(font.id(fnt), script) then tempswatrue() else tempswafalse() @@ -123,7 +113,7 @@ function fontspec.check_ot_script(fnt, script) end function fontspec.check_ot_lang(fnt, lang, script) - if check_language(font_id(fnt), lang, script) then + if check_language(font.id(fnt), lang, script) then tempswatrue() else tempswafalse() @@ -137,34 +127,13 @@ function fontspec.check_ot_feat(fnt, feat, lang, script) return end end - if check_feature(font_id(fnt), feat, lang, script) then + if check_feature(font.id(fnt), feat, lang, script) then tempswatrue() else tempswafalse() end end -function fontspec.charglyph(char) - if char then - local id, c - if utf.len(char) > 1 then - c = utf.byte(utf.char(char:gsub('"', '0x'))) - else - c = utf.byte(char) - end - - id = font.current() - - if font.fonts[id]["characters"][c] then - return font.fonts[id]["characters"][c].index - else - return 0 - end - else - return 0 - end -end - -- -- Copyright 2004--2010 Will Robertson <wspr81@gmail.com> -- Copyright 2009--2010 Khaled Hosny <khaledhosny@eglug.org> |