tomlin7 / biscuit

A lightweight, fast code editor with extensions
https://tomlin7.github.io/biscuit
MIT License
153 stars 17 forks source link

Errors when loading Biscuit #86

Closed Moosems closed 8 months ago

Moosems commented 1 year ago

When I try to load Biscuit I get the following:

System Information

tomlin7 commented 1 year 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

Moosems commented 1 year ago

I installed from requirements.txt twice before running it 😅. I tried searching for many of them individually and pip returned package not found errors.

tomlin7 commented 1 year ago

okay that sorted imports a bit too much xd image

Moosems commented 1 year ago

okay that sorted imports a bit too much xd

image

That's hilarious 🤣.

Moosems commented 11 months ago

Any progress on Mac support?

tomlin7 commented 11 months ago

@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

Moosems commented 11 months ago

What is tkextrafont doing exactly?

Moosems commented 11 months ago

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.

Moosems commented 11 months ago

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.

Moosems commented 11 months ago
    # 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")
tomlin7 commented 11 months ago

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

Moosems commented 11 months ago

I'd just ditch it :).

tomlin7 commented 11 months ago

@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'
Moosems commented 11 months ago

Oof 😕. That's not great.

Moosems commented 11 months ago

You can't change directory permissions from os calls?

rdbende commented 11 months ago

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.

tomlin7 commented 11 months ago

@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.

Moosems commented 11 months ago

I think that's the best way to be honest 😕.

rdbende commented 11 months ago

Windows doesn't have a per-user fonts directory? That's pretty lame tbh.

rdbende commented 11 months ago

Actually, I think tukaan has some repo somewhere to build tkextrafont for macOS.

rdbende commented 11 months ago

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.

tomlin7 commented 11 months ago

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,

image

and these are stored at

image

but, manually copying the ttf files to that directory won't do though, will have to go through the installation processes.

rdbende commented 11 months ago

Sad

tigran2008 commented 10 months ago

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.

Moosems commented 10 months ago

That's the idea of tkextrafont @tigran2008 but it's unmaintained.

tomlin7 commented 8 months ago

closing as #164 mentions this problem