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

pixi global - support fonts #2423

Open
wolfv opened this issue Nov 6, 2024 · 0 comments
Open

pixi global - support fonts #2423

wolfv opened this issue Nov 6, 2024 · 0 comments
Labels
area:global Related to pixi global ✨ enhancement Feature request

Comments

@wolfv
Copy link
Member

wolfv commented Nov 6, 2024

Problem description

It would be interesting if pixi global would also support font packages.

On macOS I think we could (sym-)link the font to ~/Library/Fonts.

On Linux, there is a similar directory under ~/.local/share/fonts (need to call fc-cache clean or something afterwards).

On Windows, a snippet like this might work:

        fonts_dir = os.path.join(os.environ["WINDIR"], "Fonts")
        font_reg_path = os.path.join(os.environ["WINDIR"], r"Fonts\{}".format(font_name))

        # Copy font to Windows Fonts folder
        shutil.copy2(font_path, font_reg_path)

        # Register font in system
        import winreg
        with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"Software\Microsoft\Windows NT\CurrentVersion\Fonts", 0, winreg.KEY_SET_VALUE) as key:
            winreg.SetValueEx(key, font_name, 0, winreg.REG_SZ, font_name)

@Hofer-Julian Hofer-Julian added area:global Related to pixi global ✨ enhancement Feature request labels Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:global Related to pixi global ✨ enhancement Feature request
Projects
None yet
Development

No branches or pull requests

2 participants