|
|
|||
Changing font size in xterm
Several years ago, on what used to be my workstation, I wrote a small script to create some xterms with a different and larger font size then the default. Yes, older age comes with diminishing eyesight for me
This proved to be handy when creating complex regular expressions for grep or friends. Being too lazy to go to the garage through the cold, to unpack that box, connect a keyboard and monitor to it, I decided to google for 'xterm font size unix'. The most helpful was http://invisible-island.net/xterm/xt....html#how_do_i Quote:
The xterm man page is quite long but this site also has a nice version of the xterm man page : http://invisible-island.net/xterm/manpage/xterm.html The MENU section : http://invisible-island.net/xterm/manpage/xterm.html If you use 'less' as pager for the man pages ..... Code:
$ grep PAGER .profile export PAGER=/usr/bin/less Code:
MENUS Xterm has four menus, named mainMenu, vtMenu, fontMenu, and tekMenu. Each menu pops up under the correct combina- tions of key and button presses. Each menu is divided into sections, separated by a horizontal line. Some menu entries correspond to modes that can be altered. A check mark appears next to a mode that is currently active. Selecting one of these modes toggles its state. Other menu entries are commands; selecting one of these performs the indicated function. All of the menu entries correspond to X actions. In the list below, the menu label is shown followed by the action's name in parenthesis.
So to change the the font size: press the CONTROL key with one hand, and click the right mouse button. A menu appears, with the following font alternatives: Code:
Default (fontdefault) Set the font to the default, i.e., that given by the *VT100.font resource. Unreadable (font1) Set the font to that given by the *VT100.font1 resource. Tiny (font2) Set the font to that given by the *VT100.font2 resource. Small (font3) Set the font to that given by the *VT100.font3 resource. Medium (font4) Set the font to that given by the *VT100.font4 resource. Large (font5) Set the font to that given by the *VT100.font5 resource. Huge (font6) Set the font to that given by the *VT100.font6 resource.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump Last edited by J65nko; 21st December 2011 at 06:55 AM. Reason: fixing some VBulletin codes |
|
||||
Finally had a chance to play with this a bit and collect some basic information about changing the fonts used by xterm, such as using larger ones. This will be useful if you want xterm to come up a certain way every time it's run, without using key combinations (you may have no Numeric Keypad) or tedious command line arguments.
There are two approaches to this, depending on whether or not your xterm binary was compiled with FreeType support. To check for this support you can do (substitute the path to your xterm) % ldd /usr/X11R7/bin/xterm | grep freetype If this shows anything, you can use either the FreeType or regular method; otherwise you have to use the regular method. FreeType method A number of prerequisites need to be in place, including: (a) xterm supports FreeType (see above), (b) the renderFont resource is true; it is by default, but to be sure you can add this to ~/.Xresources Code:
XTerm.VT100.renderFont: true Code:
XTerm.VT100.faceName: terminus (d) on the VT Fonts menu (Ctrl-Button3) be sure the "TrueType Fonts" entry is selected. In addition to the font, the desired size can be specified. The default for the normal font is 14pt but can be changed with the faceSize option. Also, there are six alternative font sizes. These will be the ones referred to in the VT Font menu as "Unreadable", ..., "Huge". They can all be set in this way: Code:
! Face size for normal: XTerm.VT100.faceSize: 14 ! Face sizes for alternates: ! Unreadable: XTerm.VT100.faceSize1: 12 ! Tiny: XTerm.VT100.faceSize2: 14 ! Small: XTerm.VT100.faceSize3: 20 ! Medium: XTerm.VT100.faceSize4: 24 ! Large: XTerm.VT100.faceSize5: 28 ! Huge: XTerm.VT100.faceSize6: 32 Regular method This will be used if xterm doesn't support FreeType or if faceName is unset. First, to change the default font, put something like this in your ~/.Xresources Code:
! Default: XTerm.VT100.font: -*-terminus-*-*-*-14-*-*-*-*-*-*-* In addition, there are six alternate fonts, that can be specified like this: Code:
XTerm.VT100.font1: -*-terminus-*-*-*-12-*-*-*-*-*-*-* XTerm.VT100.font2: -*-terminus-*-*-*-14-*-*-*-*-*-*-* XTerm.VT100.font3: -*-terminus-*-*-*-20-*-*-*-*-*-*-* XTerm.VT100.font4: -*-terminus-*-*-*-24-*-*-*-*-*-*-* XTerm.VT100.font5: -*-terminus-*-*-*-28-*-*-*-*-*-*-* XTerm.VT100.font6: -*-terminus-*-*-*-32-*-*-*-*-*-*-* There's quite a bit more about fonts in xterm(1) which I haven't tried to understand but the above is enough to get started. I hope it is mostly correct but I haven't tested every detail. Additions and corrections are welcome. Last edited by IdOp; 3rd January 2012 at 12:37 AM. |
|
|||
Under the category of regular method, I had luck with the following resource too. The terminus font is neat, but if you want to make only a minimal change to xterm's default look the resource below is the equivalent to picking Huge from the vt100 font menu.
Code:
xterm*vt100.initialFont: 6 |
|
||||
Thanks thirdm, that is a perfect minimalist solution to do what I was originally after, as it doesn't require installing an alternate font.
I think the reason I got detoured with terminus is that, I needed a solution on the Laptop, and that's been more of a sandbox to experiment and change things more than I usually do. Once I had something that worked and looked good, I stopped reading the man page for other parameters. |
Tags |
font size, x window, xterm |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to change the font size? atop xterm, aterm, etc | jb_daefo | General software and network | 12 | 13th July 2010 10:42 AM |
font-misc-ethiopic & font-misc-meltho | Beastie | General software and network | 0 | 27th February 2009 11:21 AM |
CLI font size | idefix | FreeBSD General | 3 | 7th February 2009 11:19 AM |
changing Firefox's font(s)? | spiderpig | General software and network | 4 | 5th June 2008 03:09 PM |
Wrong screen resolution, font size etc. | PatrickBaer | FreeBSD General | 10 | 14th May 2008 10:00 AM |