James Cash
James Cash
> What does (frame-monitor-attributes) returns ? ```elisp ((name . "DP-1") (geometry 0 0 3840 2160) (workarea 0 0 3840 2160) (mm-size 610 350) (frames #) (source . "Gdk")) ``` >...
Hm, `"medium"` seems to make the text too big:  I did note that setting the font-size to be `"1em"` appears to be the correct size, albeit misaligned vertically: 
> Do you know which svg library your emacs is using? Looks like librsvg2 2.48.9 (I've built it myself from git). > I'm not sure how Emacs or librsvg computes...
Ah, I see that it injects CSS into the SVG that sets a default font-size and font-family from the face used to display the image. Unsure then why it's different...
Another interesting data point; I tried setting the font size in `pt` (instead of unsuffixed which will be pixels) and now it renders differently in Firefox and Emacs: Firefox: ...
I do see calls to `rsvg_handle_set_dpi_x_y` which I assume are to address DPI issues, but maybe the text drawing does something different with those...
I see there was an issue in Emacs' svg rendering on high-dpi screens, but it was apparently resolved: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45124
I have something working by taking a somewhat different approach -- calculating the font size in ems instead of pixels. Setting the text-y still needs some fiddling though...does this work...
I confess myself very confused. I would love to see what this looks like on other OSes & DPIs; right now, I'm just not sure where to look.
> Can you check the code below on your side When I up the font-size to 20 (where my font is actually set to 9) it looks perfect. > can...