justinbarclay / elegant-agenda-mode

My only agenda is to be more elegant.
GNU Affero General Public License v3.0
55 stars 3 forks source link

Global font scaling factor? #4

Open uliw opened 2 years ago

uliw commented 2 years ago

Hi there,

like the looks, alas, the font scaling is way to big on my screen. Is there are way to add a global scaling factor to the package (i.e. so that it does not affect the font size in the rest of emacs?).

justinbarclay commented 2 years ago

Hi Uliw,

The changes elegant-agenda mode make are local only to the current buffer where elegant-agenda mode is enabled. It should not, and does not on my computer, affect other buffers.

Do you happen to have it enabled for more than org-agenda-mode?

uliw commented 2 years ago

Apologies, that was sloppy phrasing. When I use elegant-agenda-mode in the agenda buffer, the fonts in the agenda buffer are way too big (probably by last least a factor 2) - and only in the agenda buffer btw. I tinkered a bit with the code and added a scaling factor variable, and also one for line-spacing. But those changes caused org-super-agenda mode to crash. Not being a lisp coder, I gave up on it.

justinbarclay commented 2 years ago

Thanks for the response.

That should definitely not be the case. For org-agenda (and super-agenda) do you customize the font or font size for those buffers?

The maximum font-scaling should be 1.5x for the title and everything else was like 1.1x, all based off the default font height for the frame (Emacs windows).

This seems like there is a bug somewhere rather than a true font scaling issue. I am not opposed to adding a global scaling factor either, but I am curious where the issue is coming from.

Can you verify for me that this issue still exists for you if you load your agenda file with only

Can you run the following snipper after replacing </path/to/elegant-agenda-mode> with the path to elegant-agenda-mode.

emacs -Q --eval "(progn   (add-to-list 'load-path \"</path/to/elegant-agenda-mode>\") (require 'elegant-agenda-mode) (add-hook 'org-agenda-mode-hook 'elegant-agenda-mode))"

Then try to open your agenda file and see if the font size disparity still exists?

uliw commented 2 years ago

ok, doing the above results in a more reasonable display. I've attached 3 screenshots. The first is my default display, the second is what I get with the above command, and the third is what I get when I load elegant agenda in my startup file. I do now realize that this may happen because I modify some font properties. I specifically set the following, in order to make things more readable on a HiDPI screen

 (set-face-attribute 'default nil :font "DejaVu Sans Mono" :height 130)

do you see a way to resolve this?

Screenshot_20220509_165951 Screenshot_20220509_165738 Screenshot_20220509_170014

justinbarclay commented 2 years ago

I think I understand now. Do you have Yanone Kafeesatz installed as a font? The default sizes are all based off of that and ensuring that font looks good. https://fonts.google.com/specimen/Yanone+Kaffeesatz

I think if one changes the font to something else then sizing really does become an issue. And if you aren't using Yanone Kafeesatz things may not look as good. For reference Yanone:

image

Segoe UI:

image

So I think giving a scaling factor is the only real solution. I'll see if I can get this working where you had issues.

Or you could install Yanone Kafeesatz and I could ignore this issue entirely 😅

uliw commented 2 years ago

Ah ok. I installed the font, and it does improve the look, not a fan of the font though. If you happen to make the package less font dependent, I am happy to act as guinea pig ;-)

justinbarclay commented 2 years ago

I quickly hacked this together here. Warning: Tag alignment can get pretty messed up though and I don't have a good or quick fix for that :/ https://github.com/justinbarclay/elegant-agenda-mode/tree/scaling

justinbarclay commented 2 years ago

not a fan of the font though.

Yeah that is the problem with this package. All the choices the original author made were to make it look amazing using Yanone Kafeesatz. I also think that's why this package shines, it was optimized for one font.

I am not much of a designer and I personally like his choices, so there isn't much I feel comfortable changing or customizing to make it look spectacular on a wide range of fonts. However, I am happy trying to support simple customizations as long as users realize they are a "use at your own risk sort of thing" :)

uliw commented 2 years ago

ok, so the line spacing looks much better, but setting (setq elegant-agenda-font-scaling-factor 0.8) (or any other value) has no effect