jrfonseca/xdot.py

Fonts don't scale on macOS

thekswenson opened this issue · 5 comments

I installed all dependencies using homebrew and pip.
Opening sample.py on macOS shows a graph with a font that has not been scaled properly:

Screen Shot 2020-06-25 at 14 21 05

I can print out the supported fonts with:

                font_map = PangoCairo.font_map_get_default()
                print([f.get_name() for f in font_map.list_families()])

There is no font name "Times-Roman" which seems to be the one hardcoded in the Pen class. There does exist "Times" and "Times New Roman".

Strangely, if I change the font to something that is known, like "Comic Sans MS", I still have the scaling issue:

Screen Shot 2020-06-25 at 15 47 50

I've reported a bug here at the pango project.

This is a bug in pangocairo.
See this issue: https://gitlab.gnome.org/GNOME/pango/-/issues/488

@thekswenson thank you very much for reporting the issue and narrowing it down! Cheers.