@@ -4,6 +4,7 @@ import copy
|
||||
import dataclasses
|
||||
import io
|
||||
import json
|
||||
import math
|
||||
import pathlib
|
||||
import tempfile
|
||||
import unittest
|
||||
@@ -63,6 +64,18 @@ class PrintableParts(unittest.TestCase):
|
||||
broken = dataclasses.replace(page, primitives=tuple(p for p in page.primitives if p.role != 'tie'))
|
||||
with self.assertRaisesRegex(ValueError, 'tie was omitted'):
|
||||
generator.engraving.audit.audit_layout(source, dataclasses.replace(layout, pages=(broken,)), self.fonts, systems_per_page=None)
|
||||
def test_tight_page_uses_the_actual_footer_outline(self):
|
||||
source = tests.solo_fixtures.song(count=32, chords=('C7',))
|
||||
original = generator.printing.layout_part(source, self.fonts)
|
||||
style = generator.printing.STYLE
|
||||
# Two systems just fit the old nominal 20-unit footer reservation. The
|
||||
# page-number outline needs more space than that arithmetic assumes.
|
||||
height = math.ceil(original.pages[0].systems[1].box.bottom + style.margin_y + 20 + style.page_clearance)
|
||||
with unittest.mock.patch('generator.printing.STYLE', dataclasses.replace(style, height=height)):
|
||||
layout = generator.printing.layout_part(source, self.fonts)
|
||||
for page in layout.pages:
|
||||
footer = next(p for p in page.primitives if p.role == 'page_number')
|
||||
self.assertGreaterEqual(footer.box.top - page.systems[-1].box.bottom, style.page_clearance - .01)
|
||||
def test_guitar_tab_pickups_and_final_three_bar_hold_are_included(self):
|
||||
source = tests.test_musicxml.xml_score(tests.test_musicxml.xml_note(duration=1, kind='quarter'), implicit=True)
|
||||
source = source.replace('</measure></part>', '</measure><measure number="2"><harmony><root><root-step>C</root-step></root><kind>major</kind></harmony>' + tests.test_musicxml.xml_note() + '</measure></part>')
|
||||
|
||||
Reference in New Issue
Block a user