James Cash

Results 37 comments of James Cash
trafficstars

> 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: ![screenshot-2021-05-03_09-18-10](https://user-images.githubusercontent.com/38405/116880858-83670680-abf0-11eb-8490-9812876d3a7d.png) I did note that setting the font-size to be `"1em"` appears to be the correct size, albeit misaligned vertically: ![screenshot-2021-05-03_09-19-49](https://user-images.githubusercontent.com/38405/116881003-b90bef80-abf0-11eb-87ea-e89f1c76af22.png)

> 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: ![screenshot-2021-05-03_12-54-14](https://user-images.githubusercontent.com/38405/116906772-ac968f80-ac0e-11eb-98be-d6d062c077f0.png)...

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