lem-project / lem-project.github.io

Webpage for the Lem project
https://lem-project.github.io/
3 stars 12 forks source link

Add information about changing the font. #37

Open eihli opened 3 months ago

eihli commented 3 months ago

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 commented 3 months ago

Hey does this snippet fix it?

eihli commented 2 months ago

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.