How to choose a font with Text object?
- 主要語言
- Python
- 星號
- 93.9k
- 分支
- 7.7k
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 4
描述
This code does not change the font and letter become distorted (click on the image to enlarge and look at letters: `B, D, f, g, P, U...`):
```
script = '''
AaBbCcDdEeFfGg
HhIiJjKkLlMmNn
OoPpQqRrSsTtUu
VvWwXxYyZz
'''
class WriteText(Scene):
def construct(self):
text = Text(script, font='/usr/share/fonts/truetype/open-sans/OpenSans-Regular.ttf')
self.play(Write(text))
self.wait(.1)
```
`!python3 -m manim example_scenes.py WriteText -r 480,854`

If I change this line the result is kind of similar to the target, but I can't choose `regular` and letters are distorted (look at the small `g` it has a stair on the top):
`text = Text(script, font="Open Sans")`

貢獻指南
這個儲存庫沒有索引到貢獻指南
研究方向
查看 manim 原始碼中的 Text 類別,可能在 manimlib/mobject/svg/text_mobject.py 或類似位置。調查字體路徑是如何處理和渲染的。執行提供的腳本以重現失真,然後檢查字體載入和文字渲染邏輯。檢查是否有現有文字渲染測試以了解預期行為。
由索引模型根據 Issue 內容生成。
評估
- 領域
- computer-graphics
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 45/100