reddit / emacs

How do you resize the tool tip text size ?

olymk2 · 2022-10-19 08:12
I have some code that resizes the fonts in emacs which i use when switching from a hi dpi screen to a low dpi screen how ever this does not resize the contextual help. you can see below that the auto complete on `sql/` is tiny compared with the rest of the text, what functions do I need to adjust this text ? ​ https://preview.redd.it/f3c8jrfd0qu91.png?width=510&format=png&auto=webp&s=ba2e6f19ca8bbcd8a00558f0bc99f34c7f16c63e
00-11 · 2022-10-19 17:48
Here's what I do, FWIW: (x-show-tip (propertize your-text-for-tooltip 'face '(:foreground "red" :height 100)) nil nil 5)
sebhoagie · 2022-10-20 21:52
I have similar code to adjust frame fonts, and this is how I solved it for eldoc-box: (defun hoagie-adjust-font-size (frame) "Inspired by https://emacs.stackexchange.com/a/44930/17066. FRAME is ignored." ;; 2021-05-22: now I use the pgtk branch everywhere, and the monitor name has ;; a meaningul value in all cases, so: (let* ((monitor-name (alist-get 'name (frame-monitor-attributes))) (monitor-font '(("S240HL" . 143) ;; 24" ("2757" . 128) ;; 27" ("LG HDR 4K" . 188))) ;; 27" office - was 181 (size (alist-get monitor-name monitor-font 180 ;; default size, "big just in case" nil 'equal))) ;; override for "laptop screen only" (when (eq (length (display-monitor-attributes-list)) 1) (setf size 143)) (set-face-attribute 'default (selected-frame) :height size) (set-face-font 'eldoc-box-body (frame-parameter nil 'font)))) (add-hook 'window-size-change-functions #'hoagie-adjust-font-size)) So, you need to know the face name, to apply a similar setup.