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 information about changing the font. #37

Open
eihli opened this issue Apr 20, 2024 · 2 comments
Open

Add information about changing the font. #37

eihli opened this issue Apr 20, 2024 · 2 comments

Comments

@eihli
Copy link

eihli commented Apr 20, 2024

Was looking for this because the right arrow isn't displaying for me.

image

I'll mention that in Discord and see if it's worth tracking as a bug or if it's something unique to my system.

Regardless, this seems like something that would be good to have in documentation somewhere.

Found this in Discord.

(let ((font-regular #P"/home/andy/.guix-profile/share/fonts/truetype/MononokiNerdFont-Regular.ttf")
      (font-bold #P"/home/andy/.guix-profile/share/fonts/truetype/MononokiNerdFont-Bold.ttf"))
  (when (and (uiop:file-exists-p font-regular)
             (uiop:file-exists-p font-bold))
    (lem-sdl2/display:change-font (lem-sdl2/display:current-display)
                                  (lem-sdl2/font:make-font-config
                                   :latin-normal-file font-regular
                                   :latin-bold-file font-bold
                                   :cjk-normal-file font-regular
                                   :cjk-bold-file font-bold))))
@vindarel
Copy link
Collaborator

Hey does this snippet fix it?

@eihli
Copy link
Author

eihli commented Apr 30, 2024

No. It doesn't fix the issue. But I thought it was useful info anyways.

Regarding the issue: here's some more info (a copy/paste from Discord).

I installed from source. I see where Lem stores/retrieves its font files and those all look normal. The folder icon works. And I doubt it's relevant but the arrow doesn't render in a standard old buffer either.

Even stranger, when I search for 25b8 in my fonts, I know that it exists.

➜ fonts git:(main) ✗ fc-list ':charset=25b8' | grep Noto
/usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf: Noto Sans Mono:style=Regular
/usr/share/fonts/truetype/noto/NotoSansSymbols2-Regular.ttf: Noto Sans Symbols2:style=Regular
/usr/share/fonts/truetype/noto/NotoSansMono-Bold.ttf: Noto Sans Mono:style=Bold

But when I set that font using the code below, I still see the "unrenderable" icon. (I expected I needed to set the emoji font but I tried both just in case.) (Also, I'm connecting to a Slynk server in Lem and I see the font change when I evaluate this code in Emacs, so I know that the code works.)

(lem-sdl2/display:change-font (lem-sdl2/display:current-display)
                              (lem-sdl2/font:make-font-config
                               :size 15
                               :latin-normal-file #P"/usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf"
                               :emoji-file #P"/usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf"))

This next context may be more noise than signal but I'll throw it out there anyway: I think I ran into an issue once where I had a glyph for a font but it wouldn't render if my font was above a certain size (this was in a terminal). I think it was related to a HiDPI monitor because when I had that issue I was using the same config on two different laptops and it was only broken on the HiDPI one. I tried increasing/decreasing the font size in Lem and that didn't fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants