simmel / urxvt-resize-font

URxvt Perl extension for resizing the font
219 stars 37 forks source link

add support for resizing with fixed fonts #6

Closed csabahenk closed 8 years ago

csabahenk commented 8 years ago

If the configured font is one of the fixed, as special case, move through the array of fixed fonts upon scaling up/down.

simmel commented 8 years ago

Thanks for the contribution!

Can you give me an example of your configuration where you set a fixed size? So I can verify that it works on my end.

Can you please update your code to follow the coding style in the rest of the file? (E.g. the spaces around the parenthesis and number of spaces in indentation - even though I see it's not consistent everywhere either = )

csabahenk commented 8 years ago

Can you give me an example of your configuration where you set a fixed size? So I can verify that it works on my end.

Well you just have to specify some of the fixed fonts in your ~/.Xresources: URxvt.font: 6x13 or command line: urxvt --font 8x16.

Note that the default font urxvt uses is a fixed one (on my system 6x13, but might be different depending on the environment). So the purpose of my patch is to make dynamic size change work with urxvt's default typeface. However, of course you still have to explicitly set it for this feature to work, as that's a basic condition of this extension.

simmel commented 8 years ago

Sweet! Works well except there's a logic fault. It doesn't check that the loop wraps.

  1. Add print "$index\n"; after you set $index and then set URxvt.font: 4x6 (or whatever is the lowest your system has) then press make it smaller until it prints 0 then try to make the font bigger.
  2. Resize the font to the smallest posible then try to make it bigger. I suspect that this is a logic fault too.

After you've done, please squash your commits too.

Thanks a lot for this!

csabahenk commented 8 years ago

Sorry! I'm bad at Perl.

simmel commented 8 years ago

No worries, it looks as bad/good as mine now! ; )

Thanks for the patch!