feat: use Worte/Weise labels and render metadata at page bottom (Closes #5)
Add metadata_labels ("abbreviated"/"german") and metadata_position
("top"/"bottom") options to LayoutConfig. German labels use "Worte:" and
"Weise:" instead of "T:" and "M:", with "Worte und Weise:" when lyricist
and composer are the same person. Metadata at bottom position renders
after notes with word-wrapping. MeasurementEngine accounts for two-line
metadata in German label mode.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -15,9 +15,16 @@ class MeasurementEngine(
|
||||
// Title height
|
||||
heightMm += fontMetrics.measureLineHeight(config.fonts.title, config.fonts.title.size) * 1.5f
|
||||
|
||||
// Metadata line (composer/lyricist)
|
||||
// Metadata lines (composer/lyricist) - may be 1 or 2 lines depending on label style
|
||||
if (song.composer != null || song.lyricist != null) {
|
||||
heightMm += fontMetrics.measureLineHeight(config.fonts.metadata, config.fonts.metadata.size) * 1.8f
|
||||
val metaLineHeight = fontMetrics.measureLineHeight(config.fonts.metadata, config.fonts.metadata.size) * 1.8f
|
||||
val useGerman = config.layout.metadataLabels == "german"
|
||||
if (useGerman && song.lyricist != null && song.composer != null && song.lyricist != song.composer) {
|
||||
// Two separate lines: "Worte: ..." and "Weise: ..."
|
||||
heightMm += metaLineHeight * 2
|
||||
} else {
|
||||
heightMm += metaLineHeight
|
||||
}
|
||||
}
|
||||
|
||||
// Key/capo line
|
||||
|
||||
Reference in New Issue
Block a user