Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active October 18, 2023 22:00
Show Gist options
  • Save uwezi/42a6d8c1b039403d54441f51722059c8 to your computer and use it in GitHub Desktop.
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
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