Closed CSRaghunandan closed 6 years ago
Can you please try with the latest version (https://github.com/alexmurray/flycheck-posframe/commit/50ddda67f74a04c78642c756baf47edd0488035b) - I just made a change which allows the face to be customised and removes the previously hardcoded face settings.
@alexmurray It's still displaying with a different font
Ok how are you configuring your normal font for emacs? Can you please provide some instructions on how to reproduce?
This is my font configuration. I always run emacs in daemon-mode and connect using emacsclient.
;; set PragmataPro font only if it available
(defun rag-set-face (frame)
"Configure faces on frame creation"
(select-frame frame)
(if (display-graphic-p)
(progn
(when (member "PragmataPro" (font-family-list))
(progn
(require 'setup-pragmatapro)
(set-frame-font "PragmataPro-13"))))))
(add-hook 'after-make-frame-functions 'rag-set-face)
;; set frame font when running emacs normally
(when (member "PragmataPro" (font-family-list))
(progn
(require 'setup-pragmatapro)
(set-frame-font "PragmataPro-13")))
Instead of using set-frame-font you could use:
(set-face-attribute 'default nil :font "PragmataPro" :height 13)
Since flycheck-posframe-face
inherits from the default
face.
Or you could just customize flycheck-posframe-face
?
See https://www.emacswiki.org/emacs/SetFonts#toc2 for more details
(set-face-attribute 'default nil :font "PragmataPro" :height 13)
When I put this in my init file, emacs won't load the font any font all when I'm running as emacsclient. Not sure whats going on. I get a completely blank emacs.
I guess i'll just set the flycheck-posframe-face
manually. What is a sane default value for this variable?
You could try setting it in a after-make-frame-functions
and server-visit-hook
- this is how I do it to work with emacsclient: https://github.com/alexmurray/dot_emacs.d/blob/master/init.el#L232
Agh found out why I was having issues. I guess 13 is too less of a value for font height in (set-face-attribute 'default nil :font "PragmataPro" :height 13)
I set it to 125 and now it's working fine. Though for some reason emacs is now not maximizing window size automatically when run as emacsclient. Not sure whats going on there
Any idea what is the equivalent font height I should set for a font size of 13?
Ahh my bad - 130 or something close to that should be the equivalent as far as I know.
But now flycheck-posframe
is using the same font as my frame 👍
Awesome - can you please comment with what the solution was in the end so other can benefit if they have a similar problem - and feel free to close the issue then too.
Had to replace (set-frame-font "PragmataPro-13")
with (set-face-attribute 'default nil :font "PragmataPro" :height 125)
, but that caused emacs to not start in fullscreen anymore. Had to add a call to toggle-frame-maximized
after that. Not sure if that's an idiomatic way of handling things. I also have (add-to-list 'default-frame-alist '(fullscreen . maximized))
. But looks like that's not effecting emacsclient.
Commit in my .emacs.d
But I'm curious. Why does (set-frame-font "PragmataPro-13")
not have effect for flycheck-posframe
?
We specify the face to inherit from default - I can only assume set-frame-font does not change the default face but something else...
By looking at the documentation, adding this to my init file fixed the issue: (set-frame-font "PragmataPro-13" nil t)
need to set the 3rd parameter to set-frame-font
:
If FRAMES is non-nil, it should be a list of frames to act upon,
or t meaning all existing graphical frames.```
Screenshot for reference:
The childframe uses a different font than the one I'm using for emacs. Is this a design choice ?