diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/babel-french/frenchb.lua')
-rw-r--r-- | Master/texmf-dist/tex/generic/babel-french/frenchb.lua | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua index 63c5cad1d94..d117f60a2a0 100644 --- a/Master/texmf-dist/tex/generic/babel-french/frenchb.lua +++ b/Master/texmf-dist/tex/generic/babel-french/frenchb.lua @@ -1,5 +1,5 @@ -- --- File `frenchb.lua' generated from frenchb.dtx [2014/06/21 v3.1a] +-- File `frenchb.lua' generated from frenchb.dtx [2014/09/16 v3.1b] -- -- Copyright (C) 2014 Daniel Flipo <daniel.flipo at free.fr> -- License LPPL: see frenchb.dtx. @@ -57,18 +57,22 @@ local guilst = guil10.stretch/65536/1.665 local guilsh = guil10.shrink/65536/1.11 local font_table = {} local function new_glue_scaled (fid,width,stretch,shrink) - local fp = font_table[fid] - if not fp then - font_table[fid] = font.getfont(fid).parameters - fp = font_table[fid] + if fid > 0 then + local fp = font_table[fid] + if not fp then + font_table[fid] = font.getfont(fid).parameters + fp = font_table[fid] + end + local gl = new_node(GLUE,0) + local gl_spec = new_node(GSPEC) + gl_spec.width = width * fp.space + gl_spec.stretch = stretch * fp.space_stretch + gl_spec.shrink = shrink * fp.space_shrink + gl.spec = gl_spec + return gl + else + return nil end - local gl = new_node(GLUE,0) - local gl_spec = new_node(GSPEC) - gl_spec.width = width * fp.space - gl_spec.stretch = stretch * fp.space_stretch - gl_spec.shrink = shrink * fp.space_shrink - gl.spec = gl_spec - return gl end local addDPspace = luatexbase.attributes['FB@addDPspace'] local addGUILspace = luatexbase.attributes['FB@addGUILspace'] @@ -77,9 +81,9 @@ local function french_punctuation (head) for item in node.traverse_id(GLYPH, head) do local lang = item.lang local char = item.char + local fid = item.font local SIG = has_attribute(item, addGUILspace) - if lang == FR and FB_punct_left[char] then - local fid = item.font + if lang == FR and FB_punct_left[char] and fid > 0 then local prev = item.prev local prev_id, prev_subtype, prev_char if prev then @@ -96,7 +100,7 @@ local function french_punctuation (head) glue_wd = glue_spec.width end glue = glue and glue_wd > 0 - if FB_punct_thin[char] or FB_punct_thick[char] then + if (FB_punct_thin[char] or FB_punct_thick[char]) then local SBDP = has_attribute(item, addDPspace) local fbglue if FB_punct_thick[char] then @@ -105,10 +109,10 @@ local function french_punctuation (head) fbglue = new_glue_scaled(fid,thinwd,thinst,thinsh) end local auto = - SBDP and SBDP > 0 and - ((prev_char and not FB_punct_null[prev_char]) or - (not prev_char and (prev_id ~= 0 or prev_subtype ~= 3)) - ) + SBDP and SBDP > 0 and + ((prev_char and not FB_punct_null[prev_char]) or + (not prev_char and (prev_id ~= 0 or prev_subtype ~= 3)) + ) if glue or auto then if glue then head = remove_node(head,prev,true) @@ -129,7 +133,8 @@ local function french_punctuation (head) end end end - if lang == FR and FB_punct_right[char] and SIG and SIG > 0 then + if lang == FR and FB_punct_right[char] and fid > 0 + and SIG and SIG > 0 then local next = item.next local next_id, next_subtype, next_char, kern_wd, nextnext if next then |