3b1b / 3b1b/manim

Unable to use custom fonts with Manim

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

描述

I tried using the font `cyklop` as a test by following the instructions here: https://github.com/3b1b/manim/issues/471.

I changed my tex_template.tex file to have the following lines:

```
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{cyklop} (This line was added by me.)
\usepackage[T1]{fontenc}
```
Running the script to generate the video now gave me the following error.

```
File "D:\Videos\manim\manimlib\mobject\svg\tex_mobject.py", line 150, in __init__
self.break_up_by_substrings()
File "D:\Videos\manim\manimlib\mobject\svg\tex_mobject.py", line 190, in break_up_by_substrings
sub_tex_mob.move_to(self.submobjects[last_submob_index], RIGHT)
IndexError: list index out of range
```

Do, I need to make any other changes?
What is the `{babel}` after `[english]` and the `{inputenc}` after `[utf8]`?

Is there any way to use Google Fonts here? I know that Google Fonts license permits me to use them anywhere. However, I am not sure about other fonts form https://tug.org/FontCatalogue/.

Thanks.

貢獻指南

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

研究方向

錯誤發生在 manimlib/mobject/svg/tex_mobject.py 中。先了解 tex_template.tex 檔案如何用來編譯 LaTeX。檢查自訂字型安裝和 LaTeX 套件的引入。執行一個簡單測試,看看字型是否可以在不使用 Manim 的情況下載入。目標是在沒有 IndexError 的情況下渲染自訂字型。

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

評估

技術堆疊
latex
領域
content, documentation
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
55/100

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

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