Open jenspets opened 1 year ago
Thank you for reporting the possible bug. Font setting is not easy task for covering all Emacs user so I think it is good to introduce a flag to apply JP font or not. Honestly speaking, this package is designed basically for me as Japanese user... but anyway I'll resolve this issue.
Thanks for your quick reply, and thanks for making such a good package.
I can see that fonts are challenging to work with, especially with all variations and preferences that exist. Any change can break someone's workflow.
Hi. I've just applied a tiny modification to the code which will firstly apply JP font configuration and secondly apply ASCII font so that JP font configuration will not overwrite that of ASCII font. Could you try the updated moom-font.el
version 1.4.1. The change may resolve the issue but I'm not sure.
Hi, I tried the newest version, and the font is correct when rescaling using moom-toggle-frame-maximized, but I found two other peculiarities:
But thanks for fixing the font selection issue for unicode characters at least.
For the first item , the following code will resolve your issue when using mouse wheel. But for the second one, it is little bit hard to guess the way to workaround because it is unclear for me what is happen in booting sequence with/without Emacs, it depends on when (moom-mode 1)
is executed or other functions in hooks regarding org and moom...
(defun my-mouse-wheel-text-scale (event)
"Adjust font size of the default face according to EVENT.
`moon-font-increase' or `moom-font-decrease' is used."
(interactive (list last-input-event))
(let ((selected-window (selected-window))
(scroll-window (mouse-wheel--get-scroll-window event))
(button (mwheel-event-button event)))
(select-window scroll-window 'mark-for-redisplay)
(unwind-protect
(cond ((memq button (list mouse-wheel-down-event
mouse-wheel-down-alternate-event))
(moom-font-increase 1))
((memq button (list mouse-wheel-up-event
mouse-wheel-up-alternate-event))
(moom-font-decrease 1)))
(select-window selected-window))))
(advice-add 'mouse-wheel-text-scale :override #'my-mouse-wheel-text-scale)
When resizing the font, unicode letters like æ, ø, and å is changed into the moom-font--ja font instead of moom-font--ascii. This means that unicode characters in most European languages will be displayed in the wrong font and size after scaling.
This can be repeated when using org-tree-slide with moom, and after moom-toggle-frame-maximized, the font and size of these letters are wrong, as can be seen with M-x moom-font-print-name-at-point