! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Ctrl +/- to zoom
Status:
RESOLVED: FIXED
Severity:
enhancement
Product:
Xfce4-terminal
Component:
General

Comments

Description Mike Massonnet editbugs 2009-07-23 15:08:29 CEST
I had like to propose this feature request, a keyboard shortcut (Ctrl-+/-) that will resize the font size. I have used it in gnome-terminal and konsole so far, and I find that very nice.
Comment 1 Nick Schermer editbugs 2009-10-11 09:50:55 CEST
Been playing with this a bit, but konsole never changes the window size (but adjusting the grid of the vte widget) while gnome terminal resizes the window.

I think I prefer the konsole way, but that involves a bit more calculation to avoid weird resizes.
Comment 2 Cyril Brulebois 2010-02-28 07:55:31 CET
That would be a very nice improvement indeed. A very common usecase is switching font size when trying to show something on ones tiny laptop's screen to someone not really used to such a tiny screen. Having to go through preferences, font size, etc. isn't really nice. ;)

As for the final implementation, I guess one could live with a gnome-terminal-like behaviour until a konsole-like one is available; that would be a major improvement over having no such feature at all. (And there are already some bugs about resizing issues, like #4331 or #4728 anyway.)
Comment 3 Rostislav Lisovy 2010-03-05 20:56:57 CET
Created attachment 2873 
Some code for temporary change of font size
Comment 4 Rostislav Lisovy 2010-03-05 21:03:01 CET
I have tried to write some code, but I am not sure if I am thinking in right way.

Some known issues:
* I wasn't able to set key binding for <control>plus; after pressing Ctrl+"+" Terminal terminates with message
GLib-GObject-WARNING **: IA__g_object_notify: object class `TerminalWidget' has no property named `font-scale'
 
* I am calling 
g_object_get(G_OBJECT (screen->preferences), "font-name", &font_name, NULL); 
for determining actual font size -- but will it always return correct string (e.g. "Some Font 12")? 

* With multiple tabs it sometimes works correctly, sometimes the whole window changes its size.
Comment 5 Asier Llano 2010-04-01 00:25:28 CEST
Hi,

I continued the work by Rostislav Lisovy.

I tried to improve the provided patch a little bit:
 * It uses the pango functions to specify the size of the font.
 * Use "<Ctrl>plus" and "<Ctrl>minus" as the default shourtcuts for
    the zoom.
 * Include the "Normal size" functionality in order to return
   to the size of the preferences.
 * Make the hot updating of the font preference and zoom cohexist.
 * Included consistent gtk icons.

Still remaining issues:
 * With multiple tabs it sometimes works correctly, sometimes the
   whole window changes its size.
  (Maybe this home something in common with the resizing issues
   or maybe not).

I include the patch.

Kind regards,
Asier
Comment 6 Asier Llano 2010-04-01 00:34:32 CEST
Created attachment 2912 
Support for this feature
Comment 7 Mike Massonnet editbugs 2010-04-01 06:27:07 CEST
Regarding the resizing issue, I had wish it was simply treated as a separate bug, cause it seems to be currently attached to the font changing e.g. go into the preferences and switch the font, it will also resize the window. I had say that the behaviour from Konsole is the best fit (the window size never changes). And that's just my 2 cents.
Comment 8 Nick Schermer editbugs 2010-04-27 18:04:50 CEST
The window resizing is bad, so this patch is still not suitable for master.
Comment 9 Nick Schermer editbugs 2010-11-13 18:32:25 CET
*** Bug 6823 has been marked as a duplicate of this bug. ***
Comment 10 Alexander Butenko 2011-06-12 06:35:52 CEST
Asier patch is awesome. I was trying to investigate the case of window resizing, but i seems that problem is in several places.
1st is in terminal-window.c:
-  g_signal_connect_swapped (G_OBJECT (window->preferences), "notify::font-name",
-                            G_CALLBACK (terminal_window_set_size), window);

Removed this callback fixing resizing issue if only 1 tab is openned.

I was unable to find 2nd issue. Probably somebody else will investigate deeper.
Comment 11 Mike Massonnet editbugs 2011-11-13 15:58:37 CET
*** Bug 7975 has been marked as a duplicate of this bug. ***
Comment 12 Mike Massonnet editbugs 2011-11-13 16:01:16 CET
*** Bug 7976 has been marked as a duplicate of this bug. ***
Comment 13 Julian Gilbey 2011-11-24 21:32:08 CET
It would be really nice if this option only affected the font size in the one window under consideration rather than in every xfce4-terminal window, as changing the options does.

Also, for my 2 cents, I actually like the automatic changing of the window size, a-la GNOME, as this allows something like emacs or the like to continue to show the identical content, only larger.

Thanks for the work on this!
Comment 14 Ray 2012-12-26 22:59:06 CET
(In reply to comment #13)
> It would be really nice if this option only affected the font size in the
> one window under consideration rather than in every xfce4-terminal window,
> as changing the options does.
> 
> Also, for my 2 cents, I actually like the automatic changing of the window
> size, a-la GNOME, as this allows something like emacs or the like to
> continue to show the identical content, only larger.
> 
> Thanks for the work on this!

I second this opinion 100%

+Window resizes relative to font size
+Manual resizing is per tab/window and independent of global prefs.

Looking forward to trying A. Liano's patch to see if it fits the bill.
Comment 15 Yves-Alexis Perez editbugs 2013-02-01 07:33:26 CET
Created attachment 4895 
support font zooming

Hi,

a Debian user provided this other patch to enable this feature (and it adds a --font and --zoom command line arguments).
Comment 16 Alexander Butenko 2016-07-23 13:17:00 CEST
last patch works just brilliant. I think will be nice to merge. :)
Comment 17 Igor editbugs 2016-07-24 20:12:25 CEST
Thanks, I will review the patch.
Comment 18 Alexander Butenko 2016-07-24 22:57:41 CEST
Created attachment 6749 
patch against master

To make it easier attaching a patch against the latest master.

Thank you for you work Igor! Really nice to see app moving forward.
Comment 20 Joel Brobecker 2016-07-29 15:35:18 CEST
I just wanted to say Thank You for having implemented this feature. I really look forward to using it.
Comment 21 Igor editbugs 2016-07-29 15:38:15 CEST
Joel, thanks for keeping interest in xfce4-terminal!
Comment 22 Kalin KOZHUHAROV 2016-09-22 06:04:52 CEST
Thank you for having implemented that, I wanted it for years, just found the bug and installed (still marked unstable in Gentoo) x11-terms/xfce4-terminal-0.6.92

So far it works great!

Is there a way to extend that functionality and attach the zoom-{in,out} functionality to Ctrl+{button4,button5} so it works similar to a browser?
I don't often use the mouse on a terminal, but showing a terminal on a projector screen for some demo often requires it, so it will be helpful.

Not sure about the policies on this Bugzilla, please let me know if I rather need to submit a new issue.
Comment 23 Igor editbugs 2016-09-22 06:21:52 CEST
(In reply to Kalin KOZHUHAROV from comment #22)
> Thank you for having implemented that, I wanted it for years, just found the
> bug and installed (still marked unstable in Gentoo)
> x11-terms/xfce4-terminal-0.6.92
> 
> So far it works great!
> 
> Is there a way to extend that functionality and attach the zoom-{in,out}
> functionality to Ctrl+{button4,button5} so it works similar to a browser?
> I don't often use the mouse on a terminal, but showing a terminal on a
> projector screen for some demo often requires it, so it will be helpful.
> 
> Not sure about the policies on this Bugzilla, please let me know if I rather
> need to submit a new issue.

Thanks for nice words!

Yes, please submit a new one for your request.

Bug #5605

Reported by:
Mike Massonnet
Reported on: 2009-07-23
Last modified on: 2016-09-22
Duplicates (3):
  • 6823 support keyboard shortcuts to change font size
  • 7975 Terminal should allow to alter font size for just one terminal
  • 7976 Terminal should allow definition of keyboard shortcuts to alter font size

People

CC List:
17 users

Version

Version:
unspecified

Attachments

Some code for temporary change of font size (6.66 KB, patch)
2010-03-05 20:56 CET , Rostislav Lisovy
no flags
Support for this feature (10.50 KB, patch)
2010-04-01 00:34 CEST , Asier Llano
no flags
support font zooming (23.50 KB, patch)
2013-02-01 07:33 CET , Yves-Alexis Perez
no flags
patch against master (18.83 KB, patch)
2016-07-24 22:57 CEST , Alexander Butenko
no flags

Additional information