Closed Moosems closed 8 months ago
Aha! mac OS support, that I have no idea of since I'm on windows xd I would love to get some instructions from you on fixing this up, if possible ❤ so far I have been maintaining the windows support, and @cid0rz looks out for linux compatibility.
also the ModuleNotFoundErrors seems like they are not installed at all, or maybe the case is that those libs are not supported in mac, though I highly doubt that's the case. the filetype, gitpython modules should be cross platform supported.
can you try reinstalling all the requirements pip install -r requirements.txt
or using poetry if you don't want your packages bloated xd simply poetry install
I installed from requirements.txt twice before running it 😅. I tried searching for many of them individually and pip returned package not found errors.
okay that sorted imports a bit too much xd
okay that sorted imports a bit too much xd
That's hilarious 🤣.
Any progress on Mac support?
@Moosems there are issues with mostly the tkextrafont library used, also see #164
I will try to exclude the lib and run builds. I'm pretty new to macOS so let me know if I'm doing anything wrong: https://github.com/billyeatcookies/Biscuit/blob/main/.github/workflows/artifact-macos.yml
also see the last run: https://github.com/billyeatcookies/Biscuit/actions/runs/6613125175/job/17960344209
What is tkextrafont doing exactly?
The workflow looks about right though. Set an end variable for older Mac versions so those can get supported otherwise only the action version and up will run properly.
I found a workaround to install fonts on the users system instead of having to rely on font libraries to import them into the tcl runtime in a personal project of mine.
# Install the Fira Code font
font: TTFont = TTFont(static_folder / "FiraCode-VariableFont_wght.ttf")
# Font directories:
# MacOS: "/Library/Fonts/",
# Windows: "C:\Windows\Fonts",
# Linux: "~/.fonts"
if SYSTEM == "Darwin":
font_dir = Path("/Library/Fonts")
elif SYSTEM == "Windows":
font_dir = Path("C:/Windows/Fonts")
else:
font_dir = Path("~/.fonts").expanduser()
font_dir.mkdir(parents=True, exist_ok=True)
font.save(font_dir / "FiraCode-VariableFont_wght.ttf")
What is tkextrafont doing exactly?
The main use right now is handling icon-fonts, which I couldn't seem to find another workaround so far. @rdbende has recommended going through the tukaan font library, which seems to do this job pretty well, but I have been trying to fix issues with this problematic library so far
I'd just ditch it :).
@Moosems I tried this method but it seems i can never bypass the protection windows have
File "D:\test.py", line 14, in <module>
font.save(font_dir / "test.ttf")
with open(file, "wb") as file:
^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: 'C:\\Windows\\Fonts\\test.ttf'
Oof 😕. That's not great.
You can't change directory permissions from os calls?
You can't change directory permissions from os calls?
If you don't have the permission to access it, you probably can't modify its permission either.
@Moosems yep rdbende's right, I will have to launch the program in administrator mode in order to do this. Maybe I can make this possible by building an installer program that requires administrator permissions, and during the installation of app, I can also install the fonts. I dont't see another way to bypass windows protection other than this.
I think that's the best way to be honest 😕.
Windows doesn't have a per-user fonts directory? That's pretty lame tbh.
Actually, I think tukaan has some repo somewhere to build tkextrafont
for macOS.
Yeah, https://github.com/tukaan/Serif (though I made some improvements to it, and also renamed it to libserif
)
It doesn't have build actions, but it's pretty simple: you just need to run the Makefile, and get upload the action deployments. If you want automatic Linux builds as well, you will need to run sudo apt install tcl-dev tk-dev
first.
Windows doesn't have a per-user fonts directory? That's pretty lame tbh.
@rdbende actually fonts can be installed for user only in windows,
and these are stored at
but, manually copying the ttf files to that directory won't do though, will have to go through the installation processes.
Sad
I think the viable solution here, if possible of course, would be making a Tcl package which lets one use fonts in Tk without actually installing them on the system, and then creating a Python wrapper for that package. Something similar to this (Eliav2/tkinterdnd2)
I don't know Tcl, though, so unfortunately I cannot give a helping hand.
That's the idea of tkextrafont @tigran2008 but it's unmaintained.
closing as #164 mentions this problem
When I try to load Biscuit I get the following:
System Information