ocodo-svg-modelines icon indicating copy to clipboard operation
ocodo-svg-modelines copied to clipboard

HiDPI support?

Open mdboom opened this issue 9 years ago • 9 comments

This package doesn't seem to pick up the Xft.dpi setting on Linux, so I end up with a much smaller font than expected in the modeline.

Any chance of fixing that?

modeline-screenshot

mdboom avatar May 14 '15 13:05 mdboom

Please Note that sabof/svg-mode-lines-themes is doing the lower level stuff.

But I think Librsvg seems to be responsible for this particular problem.

jasonm23 avatar May 14 '15 14:05 jasonm23

I'll leave this issue open fir discussion.

@sabof, any ideas on this?

jasonm23 avatar May 14 '15 14:05 jasonm23

Can you make the font size customizable in the meantime? I've been using a modified version of one of your earlier snippets with larger font size but can't switch to this package because of this issue.

ozanmakes avatar May 15 '15 05:05 ozanmakes

I should also mention that the fatter initial versions work way better in a HiDPI setting.

Screenshot

ozanmakes avatar May 15 '15 05:05 ozanmakes

Font size is customisable.

You will need to override any style you find in the themes, and have them eval after the theme has been initially loaded.

jasonm23 avatar May 15 '15 05:05 jasonm23

I'll keep this in mind, although I don't see any immediate solutions.

sabof avatar May 17 '15 03:05 sabof

@osener an example style override:

Add to your .emacs or .emacs.d/init.el

(defun ocodo-mesh-aqua-buffer-name-style (widget)
  (list :font-weight "normal"
        :font-size "8pt" ;; Change font size to whatever you'd like.
        :font-family "sans-serif"
        :fill (if (smt/window-active-p) "#FFFFFF" "#666666")))

Note that you can use conditional settings, as is being done here with :fill when the window is active.

You could determine the HiDPI'ness of your display and use that condition to set different font-sizes.

The main problem with support is that different enviroments will determine HiDPI in different ways, and I don't know what they all are. If you can post an example of detection for your environment, and any reference resources, that would be helpful.

jasonm23 avatar May 17 '15 03:05 jasonm23

Thanks for the tips, guys. The manual theme override is working for me, so it's a good solution for now.

I did find a detection that works for me (Gtk on Linux X11). I just found it through apropos I don't know how generally implemented it is across platforms, so this is by no means an expert suggestion.

(defun dpi () (/ (display-pixel-width) (/ (display-mm-width) 25.4)))

mdboom avatar May 18 '15 14:05 mdboom

Interesting, my OSX display is reported as 93.97~dpi

jasonm23 avatar May 18 '15 17:05 jasonm23