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

Add font embedding on Linux #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading