diff options
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> |