Home > OS >  Python printing tabular data breaks with Google fonts
Python printing tabular data breaks with Google fonts

Time:12-02

I'm using the Tabulate package to print data in table format. The output is sent to a webpage. While using the default font everything is working fine. However upon changing font family (Outfit from Google fonts or cursive e.g), they stop being aligned. Are there any possible solutions?

Output with default font:

Strength: 16             Dmg: 50         Armor: 3.8      ShadowRes: 3.5%
Agility: 34              Spell: 183      FireRes: 5.1%   NatureRes: 6.1%
Intellect: 61            Critical: 3.4%  FrostRes: 6.3%  ArcaneRes: 3.8%

Output with Google font (looks like this can't really show it because SO font is the default):

Strength: 25               Dmg: 45         Armor: 3.1      ShadowRes: 3.2%
Agility: 20              Spell: 132    FireRes: 3.3%   NatureRes: 3.6%
Intellect: 44             Critical: 2.0%  FrostRes: 3.6%  ArcaneRes: 3.8%

Thanks in advance!

CodePudding user response:

you need a monospace font in order to keep the good size of space

  • Related