我在pubspec.yaml
中的导入已经足够标准了,我确实知道pubspec忽略了权重。
fonts:
- family: Museo_Slab
fonts:
- asset: assets/fonts/Museo_Slab/Museo_Slab_100.otf
weight: 100
- asset: assets/fonts/Museo_Slab/Museo_Slab_300.otf
weight: 300
- asset: assets/fonts/Museo_Slab/Museo_Slab_500.otf
weight: 500
- asset: assets/fonts/Museo_Slab/Museo_Slab_700.otf
weight: 700
- asset: assets/fonts/Museo_Slab/Museo_Slab_900.otf
weight: 900
FontBook中的字体元数据显示100、300等的确切数字。渲染时:
Text(
'Museo Slab 700',
maxLines: 2,
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontFamily: 'Museo_Slab',
fontWeight: FontWeight.w700,
fontSize: 20,
color: Colors.black),
),
Flutter只拾取了前两个权重,并像这样渲染。
Not great screenshot
本来应该是这样的
Sanity screenshot
我已经检查了字体元数据,并尝试卸载和重新安装字体,但我仍然没有看到正确的权重。
1条答案
按热度按时间fhg3lkii1#
我也面临着同样的问题。我能找到的唯一解决办法是单独定义家庭: