Skip to content

Commit

Permalink
Add font embedding on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Arias800 authored Jun 12, 2024
1 parent 09eda16 commit 9e61a91
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion devine/core/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,16 @@ def get_system_fonts() -> dict[str, Path]:
for n in range(0, total_fonts)
for name, filename, _ in [winreg.EnumValue(key, n)]
}
elif sys.platform == "linux":
import subprocess
return {
# fc-list should be installed by default on every system.
name.strip() if ":" not in name else name.split(":")[0].strip() : Path(path)
for font in subprocess.getstatusoutput("fc-list")[1].split("\n")
for path, name in [font.split(":", 1)]
}
else:
# TODO: Get System Fonts for Linux and mac OS
# TODO: Get System Fonts for mac OS
return {}


Expand Down

0 comments on commit 9e61a91

Please sign in to comment.