Closed swasher closed 1 year ago
I checked the behavior in Microsoft Word.
The font_size
and font_color
seem to match the list-item.
I've applied a fix for OrderedList
. I am still going to have to revise UnorderedList
(to make the bullet characters match) and RomanNumeralList
RomanNumeralOrderedList
has also been modified:
Can't reproduce it. Reduce program to minimal code, result:
#!chapter_003/src/snippet_001.py
from borb.pdf import OrderedList
from borb.pdf import SingleColumnLayout
from borb.pdf import PageLayout
from borb.pdf import Paragraph
from borb.pdf import Document
from borb.pdf import Page
from borb.pdf import PDF
from borb.pdf import X11Color
from decimal import Decimal
colors = ['Blue','Red','Cyan','Orange','Violet','Pink']
def main():
# create Document
doc: Document = Document()
# create Page
page: Page = Page()
# add Page to Document
doc.add_page(page)
# set a PageLayout
layout: PageLayout = SingleColumnLayout(page)
# add OrderedList of 3 Paragraph objects
fruits = OrderedList()
fs = Decimal(4)
for item in colors:
fruits.add(Paragraph(item, font_size=fs, font_color=X11Color(item)))
fs += 3
layout.add(fruits)
# store
with open("output.pdf", "wb") as out_file_handle:
PDF.dumps(out_file_handle, doc)
if __name__ == "__main__":
main()
I haven't done a release yet. So it's quite natural you can't reproduce it yet. You'll need to wait for me to actually make a release.
I am now running the tests.
If they succeed I will build a temporary release (which I will attach to this issue) so you can continue using borb
.
I will also attach the test results so you can be assured this bugfix did not damage any other functionality.
Describe the bug Digits in Ordered list not scaled with
font_size
, i.e. rendering with default 12 font size.Code Sample
Expected behaviour Digits in OrderedList must have same font properties (font, size, color etc) as a inline text.
Screenshots
Desktop