Python打印表格数据与Google字体不兼容



我正在使用Tabulate包以表格格式打印数据。输出被发送到网页。使用默认字体时,一切正常。然而,在更改字体系列(例如谷歌字体或草书字体(时,它们将停止对齐。有什么可能的解决方案吗?

输出默认字体:

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%

使用谷歌字体输出(看起来无法真正显示,因为SO字体是默认字体(:

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%

提前感谢!

为了保持的良好空间大小,您需要一个单空间字体

最新更新