Last active
October 18, 2023 22:00
-
-
Save uwezi/42a6d8c1b039403d54441f51722059c8 to your computer and use it in GitHub Desktop.
[Download font II] Downloading a single font file from github. #manim #font #fontspec #latex #xetex #requests #download
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class malayalamFont(Scene): | |
| def construct(self): | |
| import requests | |
| import zipfile | |
| import re | |
| import io | |
| from pathlib import Path | |
| a=requests.get("https://github.com/notofonts/noto-fonts/raw/main/hinted/ttf/NotoSerifMalayalam/NotoSerifMalayalam-Regular.ttf") | |
| with open("./fonts/NotoSerifMalayalam-Regular.ttf", mode="wb") as file: | |
| file.write(a.content) | |
| MyTexTemplate = TexTemplate( | |
| tex_compiler="xelatex", | |
| output_format='.xdv', | |
| ) | |
| MyTexTemplate.add_to_preamble(r"\usepackage{fontspec}\setmainfont{NotoSerifMalayalam-Regular.ttf}[Path=./fonts/]") | |
| titleU = Tex( | |
| r"വൃത്തത്തിന്റെ സമവാക്ക്യങ്ങൾ", | |
| tex_template=MyTexTemplate, | |
| color = BLUE, | |
| ).scale(2) | |
| self.add(titleU) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment