Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The fonts in Text.font_list() cannot be loaded in Windows #3970

Open
KeJunMao opened this issue Oct 22, 2024 · 0 comments
Open

The fonts in Text.font_list() cannot be loaded in Windows #3970

KeJunMao opened this issue Oct 22, 2024 · 0 comments

Comments

@KeJunMao
Copy link

Description of bug / unexpected behavior

The fonts in Text.font_list() cannot be loaded in Windows

I tried installing the same fonts in Docker and running it, and found that they could be loaded normally.

A potentially helpful link:

https://discourse.gnome.org/t/why-does-pango-on-windows-fail-to-open-some-fonts/15967

Expected behavior

The fonts can be loaded correctly in Windows

How to reproduce the issue

Code for reproducing the problem

Test font: https://github.com/atelier-anchor/smiley-sans

from manim import *

class FontScene(Scene):
    def construct(self):
        text = Text("你好,Hello", font="Smiley Sans")
        print(text.font_list())
        self.add(text)
        self.wait()

Additional media files

Images/GIFs

Logs

Terminal output
> manim render .\test.py FontScene -v DEBUG

Manim Community v0.18.1


(process:44384): Pango-WARNING **: 16:36:38.313: couldn't load font "Smiley Sans Not-Rotated 10", falling back to "Sans Not-Rotated 10", expect ugly output.      
['Agency FB', 'Aharoni', 'Aldhabi', 'Algerian', 'Andalus', 'Angsana New', 'AngsanaUPC', 'Aparajita', 'Arabic Typesetting', 'Arial', 'Arial Nova', 'Arial Rounded MT', 'BIZ UDGothic', 'BIZ UDMincho', 'BIZ UDPGothic', 'BIZ UDPMincho', 'Bahnschrift', 'Baskerville Old Face', 'Batang', 'BatangChe', 'Bauhaus 93', 'Bell MT', 'Berlin Sans FB', 'Bernard MT', 'Blackadder ITC', 'Bodoni MT', 'Bodoni MT Poster', 'Book Antiqua', 'Bookman Old Style', 'Bradley Hand ITC', 'Britannic', 'Broadway', 'Browallia New', 'BrowalliaUPC', 'Brush Script MT', 'Calibri', 'Californian FB', 'Calisto MT', 'Cambria', 'Cambria Math', 'Candara', 'Cascadia Code', 'Cascadia Mono', 'Castellar', 'Centaur', 'Century', 'Century Gothic', 'Century Schoolbook', 'Chiller', 'Colonna MT', 'Comic Sans MS', 'Consolas', 'Constantia', 'Cooper', 'Copperplate Gothic', 'Corbel', 'Cordia New', 'CordiaUPC', 'Courier New', 'Curlz MT', 'Cursive', 'DFKai-SB', 'DaunPenh', 'David', 'DengXian', 'DilleniaUPC', 'DokChampa', 'Dotum', 'DotumChe', 'Doulos SIL', 'Dubai', 'Ebrima', 'Edwardian Script ITC', 'Elephant', 'Engravers MT', 'Eras ITC', 'Estrangelo Edessa', 'EucrosiaUPC', 'Euphemia', 'FZKai-Z03S', 'FZKai-Z03T', 'FZShuTi', 'FZYaoTi', 'FangSong', 'Fantasy', 'Felix Titling', 'Fira Code', 'Fira Code Retina', 'Footlight MT', 'Forte', 'FrankRuehl', 'Franklin Gothic', 'Franklin Gothic Book', 'FreesiaUPC', 'Freestyle Script', 'French Script MT', 'Gabriola', 'Gadugi', 'Garamond', 'Gautami', 'Georgia', 'Georgia Pro', 'Gigi', 'Gill Sans', 'Gill Sans MT', 'Gill Sans Nova', 'Gisha', 'Gloucester MT', 'Goudy Old Style', 'Goudy Stout', 'Gulim', 'GulimChe', 'Gungsuh', 'GungsuhChe', 'Haettenschweiler', 'Harlow Solid', 'Harrington', 'High Tower Text', 'Impact', 'Imprint MT Shadow', 'Informal Roman', 'Ink Free', 'IrisUPC', 'Iskoola Pota', 'JasmineUPC', 'Javanese Text', 'Jokerman', 'Juice ITC', 'KaiTi', 'Kalinga', 'Kartika', 'Khmer UI', 'KodchiangUPC', 'Kokila', 'Kristen ITC', 'Kunstler Script', 'Lao UI', 'Latha', 'Leelawadee', 'Leelawadee UI', 'Levenim MT', 'LiSu', 'LilyUPC', 'Lucida Bright', 'Lucida Calligraphy', 'Lucida Console', 'Lucida Fax', 'Lucida Handwriting', 'Lucida Sans', 'Lucida Sans Typewriter', 'Lucida Sans Unicode', 'MS Gothic', 'MS Mincho', 'MS PGothic', 'MS PMincho', 'MS Reference Sans Serif', 'MS UI Gothic', 'MV Boli', 'Magneto', 'Maiandra GD', 'Malgun Gothic', 'Mangal', 'Matura MT Script Capitals', 'Meiryo', 'Meiryo UI', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft JhengHei UI', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft Uighur', 'Microsoft YaHei', 'Microsoft YaHei UI', 'Microsoft Yi Baiti', 'MingLiU', 'MingLiU-ExtB', 'MingLiU_HKSCS', 'MingLiU_HKSCS-ExtB', 'Miriam', 'Miriam Fixed', 'Mistral', 'Modern No. 20', 'Mongolian Baiti', 'Monospace', 'Monotype Corsiva', 'MoolBoran', 'Myanmar Text', 'NSimSun', 'Narkisim', 'Neue Haas Grotesk Text Pro', 'Niagara Engraved', 'Niagara Solid', 'Nirmala UI', 'Noto Serif', 'Nyala', 'OCR A', 'Old English Text MT', 'Onyx', 'PMingLiU', 'PMingLiU-ExtB', 'Palace Script MT', 'Palatino Linotype', 'Papyrus', 'Parchment', 'Perpetua', 'Perpetua Titling MT', 'Plantagenet Cherokee', 'Playbill', 'Poor Richard', 'Pristina', 'Raavi', 'Rage', 'Ravie', 'Rockwell', 'Rockwell Nova', 'Rod', 'STCaiyun', 'STFangsong', 'STHupo', 'STKaiti', 'STLiti', 'STSong', 'STXihei', 'STXingkai', 'STXinwei', 'STZhongsong', 'Sakkal Majalla', 'Sans', 'Sans Serif Collection', 'Sans-Serif', 'Sanskrit Text', 'Script MT', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Emoji', 'Segoe UI Historic', 'Segoe UI Symbol', 'Segoe UI Variable Display', 'Segoe UI Variable Small', 'Segoe UI Variable Text', 'Serif', 'Shonar Bangla', 'Showcard Gothic', 'Shruti', 'SimHei', 'SimSun', 'SimSun-ExtB', 'SimSun-ExtG', 'Simplified Arabic', 'Simplified Arabic Fixed', 'Sitka Banner', 'Sitka Display', 'Sitka Heading', 'Sitka Small', 'Sitka Subheading', 'Sitka Text', 'Smiley Sans', 'Snap ITC', 'Stencil', 'Sylfaen', 'System-ui', 'Tahoma', 'Tempus Sans ITC', 'Times New Roman', 'Traditional Arabic', 'Trebuchet MS', 'Tunga', 'Tw Cen MT', 'UD Digi Kyokasho N-B', 'UD Digi Kyokasho N-R', 'UD Digi Kyokasho NK-B', 'UD Digi Kyokasho NK-R', 'UD Digi Kyokasho NP-B', 'UD Digi Kyokasho NP-R', 'Urdu Typesetting', 'Utsaah', 'Vani', 'Verdana', 'Verdana Pro', 'Vijaya', 'Viner Hand ITC', 'Vivaldi', 'Vladimir Script', 'Vrinda', 'Wide Latin', 'YouYuan', 'Yu Gothic', 'Yu Gothic UI', 'Yu Mincho']
[10/22/24 16:36:38] DEBUG    Animation with empty mobject                                                                                         animation.py:175
                    DEBUG    Hashing ...                                                                                                            hashing.py:352
                    DEBUG    Hashing done in 0.011536 s.                                                                                            hashing.py:364
                    DEBUG    Hash generated :  3977891868_123554531_3252413701                                                                      hashing.py:367
                    DEBUG    List of the first few animation hashes of the scene: ['3977891868_123554531_3252413701']                         cairo_renderer.py:97
                    INFO     Animation 0 : Partial movie file written in                                                                  scene_file_writer.py:527
                             'C:\Users\kejun\workspace\maorongrong\text2motion\media\videos\test\1080p60\partial_movie_files\FontScene\39 
                             77891868_123554531_3252413701.mp4'
                    INFO     Combining to Movie file.                                                                                     scene_file_writer.py:617
                    DEBUG    Partial movie files to combine (1 files):                                                                    scene_file_writer.py:561
                             ['C:\\Users\\kejun\\workspace\\maorongrong\\text2motion\\media\\videos\\test\\1080p60\\partial_movie_files\\ 
                             FontScene\\3977891868_123554531_3252413701.mp4']
                    INFO                                                                                                                  scene_file_writer.py:737
                             File ready at 'C:\Users\kejun\workspace\maorongrong\text2motion\media\videos\test\1080p60\FontScene.mp4'     

                    INFO     Rendered FontScene                                                                                                       scene.py:247
                             Played 1 animations

System specifications

System Details
  • OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
  • RAM:
  • Python version (python/py/python3 --version):
  • Installed modules (provide output from pip list):
OS: Windows 11 22631
RAM: 32G
Python 3.12.5
Package            Version
------------------ -----------
aiofiles           23.2.1
aiohappyeyeballs   2.4.2
aiohttp            3.10.8
aiosignal          1.3.1
annotated-types    0.7.0
anyio              4.6.0
attrs              24.2.0
Authlib            1.3.2
cairocffi          1.7.1
CairoSVG           2.7.1
certifi            2024.8.30
cffi               1.17.1
charset-normalizer 3.3.2
click              8.1.7
cloup              3.0.5
colorama           0.4.6
cryptography       43.0.1
cssselect2         0.7.0
decorator          5.1.1
defusedxml         0.7.1
diskcache          5.6.3
distro             1.9.0
docker             7.1.0
dynaconf           3.2.6
edge-tts           6.1.12
fastapi            0.115.0
ffmpy              0.4.0
filelock           3.16.1
FLAML              2.3.1
frozenlist         1.4.1
fsspec             2024.9.0
glcontext          3.0.0
gradio             5.0.2
gradio_client      1.4.0
greenlet           3.1.1
h11                0.14.0
httpcore           1.0.6
httpx              0.27.2
huggingface-hub    0.25.1
hupper             1.12.1
idna               3.10
isosurfaces        0.1.2
itsdangerous       2.2.0
jieba              0.42.1
Jinja2             3.1.4
jiter              0.5.0
manim              0.18.1
manim-voiceover    0.3.7
ManimPango         0.6.0
mapbox_earcut      1.0.2
markdown-it-py     3.0.0
MarkupSafe         2.1.5
mdurl              0.1.2
moderngl           5.11.1
moderngl-window    2.4.6
multidict          6.1.0
multipledispatch   1.0.0
mutagen            1.47.0
networkx           3.3
numpy              1.26.4
openai             1.51.0
orjson             3.10.7
packaging          24.1
pandas             2.2.3
pillow             10.4.0
pip                24.2
pyautogen          0.3.0
pycairo            1.27.0
pyconify           0.1.6
pycparser          2.22
pydantic           2.9.2
pydantic_core      2.23.4
pydub              0.25.1
pyglet             2.0.17
Pygments           2.18.0
pyrr               0.10.3
python-dateutil    2.9.0.post0
python-dotenv      0.21.1
python-multipart   0.0.12
python-slugify     8.0.4
pytz               2024.2
pywin32            306
PyYAML             6.0.2
regex              2024.9.11
requests           2.32.3
rich               13.9.1
ruff               0.6.8
scipy              1.14.1
screeninfo         0.8.1
semantic-version   2.10.0
setuptools         75.1.0
shellingham        1.5.4
six                1.16.0
skia-pathops       0.8.0.post1
sniffio            1.3.1
sox                1.5.0
SQLAlchemy         2.0.35
sqlmodel           0.0.22
srt                3.5.3
starlette          0.38.6
svgelements        1.9.6
termcolor          2.4.0
text-unidecode     1.3
tiktoken           0.7.0
tinycss2           1.3.0
tomlkit            0.12.0
tqdm               4.66.5
typer              0.12.5
typing_extensions  4.12.2
tzdata             2024.2
urllib3            2.2.3
uvicorn            0.31.0
watchdog           5.0.3
webencodings       0.5.1
websockets         12.0
yarl               1.13.1
LaTeX details
  • LaTeX distribution (e.g. TeX Live 2020):
  • Installed LaTeX packages:

Additional comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

1 participant