And furigana seems to work, haven't tested flags however
Originally committed to SVN as r1183.
This commit is contained in:
parent
6b55bf750c
commit
e2f62caf7b
1 changed files with 7 additions and 1 deletions
|
@ -385,14 +385,17 @@ function karaskel.do_furigana_layout(meta, styles, line)
|
||||||
-- Furigana-less syllables always generate a new layout group
|
-- Furigana-less syllables always generate a new layout group
|
||||||
-- So do furigana-endowed syllables that are marked as split
|
-- So do furigana-endowed syllables that are marked as split
|
||||||
-- But if current lg has no width (usually only first) don't create a new
|
-- But if current lg has no width (usually only first) don't create a new
|
||||||
if (syl.furi.n == 0 or syl.furi[1].issplit) and lg.basewidth > 0 then
|
if (syl.furi.n == 0 or syl.furi[1].issplit or not last_had_furi) and lg.basewidth > 0 then
|
||||||
|
aegisub.debug.out(5, "Inserting layout group, basewidth=%d, furiwidth=%d\n", lg.basewidth, lg.furiwidth)
|
||||||
table.insert(lgroups, lg)
|
table.insert(lgroups, lg)
|
||||||
lg = { basewidth=0, furiwidth=0, syls={}, furi={}, spillback=false }
|
lg = { basewidth=0, furiwidth=0, syls={}, furi={}, spillback=false }
|
||||||
|
last_had_furi = false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Add this syllable to lg
|
-- Add this syllable to lg
|
||||||
lg.basewidth = lg.basewidth + syl.prespacewidth + syl.width + syl.postspacewidth
|
lg.basewidth = lg.basewidth + syl.prespacewidth + syl.width + syl.postspacewidth
|
||||||
table.insert(lg.syls, syl)
|
table.insert(lg.syls, syl)
|
||||||
|
aegisub.debug.out("\tAdding syllable to layout group: %s (width=%d)\n", syl.text_stripped, syl.width)
|
||||||
|
|
||||||
-- Add this syllable's furi to lg
|
-- Add this syllable's furi to lg
|
||||||
for f = 1, syl.furi.n do
|
for f = 1, syl.furi.n do
|
||||||
|
@ -400,9 +403,12 @@ function karaskel.do_furigana_layout(meta, styles, line)
|
||||||
lg.furiwidth = lg.furiwidth + furi.width
|
lg.furiwidth = lg.furiwidth + furi.width
|
||||||
lg.spillback = lg.spillback or furi.spillback
|
lg.spillback = lg.spillback or furi.spillback
|
||||||
table.insert(lg.furi, furi)
|
table.insert(lg.furi, furi)
|
||||||
|
aegisub.debug.out("\tAdding furigana to layout group: %s (width=%d)\n", furi.text, furi.width)
|
||||||
|
last_had_furi = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- Insert last lg
|
-- Insert last lg
|
||||||
|
aegisub.debug.out(5, "Inserting layout group, basewidth=%d, furiwidth=%d\n", lg.basewidth, lg.furiwidth)
|
||||||
table.insert(lgroups, lg)
|
table.insert(lgroups, lg)
|
||||||
-- And end-sentinel
|
-- And end-sentinel
|
||||||
table.insert(lgroups, lgsentinel)
|
table.insert(lgroups, lgsentinel)
|
||||||
|
|
Loading…
Reference in a new issue