3b1b / 3b1b/manim

Text object bug with size=0.5

未關閉
#1,224 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
93.9k
分支
7.7k
平均合併
2 天 13 小時
30 天內合併 PR
4

描述

I used latest Manim from master branch on Windows 10. [Both fonts](https://fonts.google.com/?query=open+sans).
[Demo.zip](https://github.com/3b1b/manim/files/5210715/Demo.zip)
`size=1`:
![image](https://user-images.githubusercontent.com/35609308/92955446-8e610100-f47e-11ea-8b7f-ec03663e4298.png)

`size=0.5`:
![image](https://user-images.githubusercontent.com/35609308/92955289-50fc7380-f47e-11ea-833e-e9658d2bf271.png)
```
strs = ['OpenSansCondensed-Bold.ttf',
'OpenSansCondensed-Light.ttf',
'OpenSansCondensed-LightItalic.ttf',
'OpenSans-Bold.ttf',
'OpenSans-BoldItalic.ttf',
'OpenSans-ExtraBold.ttf',
'OpenSans-ExtraBoldItalic.ttf',
'OpenSans-Italic.ttf',
'OpenSans-Light.ttf',
'OpenSans-LightItalic.ttf',
'OpenSans-Regular.ttf',
'OpenSans-SemiBold.ttf',
'OpenSans-SemiBoldItalic.ttf']

fonts = {strs[0]: 'Open Sans Condensed Bold',
strs[1]: 'Open Sans Condensed Light',
strs[2]: 'Open Sans Condensed Light Italic',
strs[3]: 'Open Sans Bold',
strs[4]: 'Open Sans Bold Italic',
strs[5]: 'Open Sans ExtraBold',
strs[6]: 'Open Sans ExtraBold Italic',
strs[7]: 'Open Sans Italic',
strs[8]: 'Open Sans Light',
strs[9]: 'Open Sans Light Italic',
strs[10]: 'Open Sans Regular',
strs[11]: 'Open Sans SemiBold',
strs[12]: 'Open Sans SemiBold Italic'}

class Demo(Scene):
def construct(self):
for size in [2, 1, .7, .5]:
for i in range(len(strs)):
text = Text(strs[i], font=fonts[strs[i]], stroke_width=0, size=size)
text.move_to([text.length_over_dim(0) / 2 - 5, .6 * (6 - i), 0])
self.add(text)
self.wait(.1)
self.remove(*self.mobjects)
```

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

該 issue 顯示在 Open Sans 字體下 size=0.5 時的文字渲染 bug。查看 manim 中的 Text 類別,可能位於 manim/mobject/svg/text_mobject.py 或類似檔案。調查字體大小縮放如何影響 glyph 的定位。執行提供的腳本以重現該問題,然後檢查文字定位邏輯和小尺寸下的 font metrics 處理。

由索引模型根據 Issue 內容生成。

評估

領域
computer-graphics
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。