Skip to content

Commit

Permalink
If chords are wider than lyrics, then space out lyrics to match the s…
Browse files Browse the repository at this point in the history
…ize of the chords.
  • Loading branch information
simoncozens committed Apr 2, 2015
1 parent dbaa19a commit 541a22d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/chordmode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ SILE.registerCommand("ch", function(options, content)
-- Temporary hard coded values should be configurable
local offset = SILE.toPoints("2", "ex", "h")
local chordLineHeight = SILE.toPoints("4", "mm", "h")
local origWidth = chordBox.width
chordBox.width = SILE.length.zero
chordBox.height = chordLineHeight

Expand All @@ -87,6 +88,11 @@ SILE.registerCommand("ch", function(options, content)
SILE.typesetter:pushHbox(chordBox)
end)
end)
local lyricBox = SILE.Commands["hbox"]({}, content)
if lyricBox.width < origWidth then
lyricBox.width = origWidth + SILE.toPoints("0.5em")
end

end, "Insert a a chord name above the text")

SILE.registerCommand("chordmode", function(options, content)
Expand Down

0 comments on commit 541a22d

Please sign in to comment.