Back to Silas S. Brown's home page | X11 configuration

X11 hardware magnification

These notes are old: most newer GNU/Linux boxes can't do this anymore, and will need a high-DPI setup instead, unless you want to try the "last-resort" approach mentioned below.

(The last computer I had that used X11 hardware magnification was disposed of in 2015 due to space constraints after marriage; our newer equipment was smaller, quieter and less power-hungry, so the old "rattle-bang box" was by then just a standby, except when I needed to use its parallel port for the old laser printer which was degrading beyond modern repair; both pieces of equipment had each given 15+ years' service to multiple owners but it no longer made sense to keep them going.)

This page is meant for people with low vision who need to zoom in X11.  If your X server is not configurable and/or you're using it remotely then see my last-resort X11 magnification page instead of this one, or if you're on a Mac then see Mac magnification setup.

If you're using X11 and you don't know about Control-Alt-keypad + try it now.  It should zoom in (multiple zooms may be available) and you can zoom out again with - instead of +.

If it doesn't work, or if the screen is uncomfortable to look at, the picture is not centred on the screen, or you cannot zoom far enough, then you might need to re-configure your X server (more on this below).  You may be able to manage without zoom by setting even larger fonts, but I recommend configuring the X server if you're setting up a machine for long-term use, otherwise you could have problems when things don't fit on the screen or cannot be enlarged.

Warning: Fully-sighted observers may get dizzy if you scroll around quickly, since they often use visual information for balance and they are not in control of the mouse.  Try to avoid or warn about rapid movement when others are watching.

Backdrop: The default checkered X backdrop can be annoying especially when you scroll it.  There are various ways of changing it, one of which is the command xsetroot -solid darkblue (type it at a prompt or put it in a startup file).  On some systems you can set the backdrop to any image using chameleon or a similar program.  Most ``desktop environments'' do this anyway.

Re-configuring the X server

For maximum benefit, the X server needs to be configured not only to allow low resolutions (so that Control-Alt-keypad + works) but also to display them in the best way that is allowed by your monitor, video card and signal cable.  This will reduce eye strain.  Configuring X requires root access to the machine and is difficult; the exact settings will depend on your particular brand of monitor and video card and getting it wrong could cause damage.

The following advice should work with modern, reasonably large monitors.  If you have a very old monitor then don't try it unless you really know what you're doing.  At any rate it's at your own risk; usual disclaimers apply.  Check that you understand all of these instructions before you begin.

Note: Some motherboards with onboard video do not support the following at all, and their built-in lower resolutions can cause eyestrain on modern displays (unless you can find an LCD monitor whose native resolution is an exact multiple of the supported resolution). If you cannot configure the X server appropriately then see my last-resort X11 magnification page instead.

  1. Use to work out some modelines:
    • For resolutions, try 1152x864, 1024x768, 800x600, 640x480 and 320x240 (calculate a separate modeline for each).  The highest resolution gives good desktop area; you can then zoom in to the lower resolutions.  You probably don't want to make the highest resolution's first number any larger than 1.6 or 1.8 times that of the resolution you usually work in, otherwise you may ``get lost'' since even a full-screen window can disappear too easily.
    • For LCD and other flat-screen monitors:
      • You should check the manufacturers' preferred refresh rate (probably 60 Hz) and preferred resolution.
      • Sadly, if you set a lower resolution, some flat screens will anti-alias the picture in a bad way that causes eyestrain.
      • However, taking the preferred resolution and halving both numbers gives some magnification and usually results in no compromise on crispness.
      • And many flat screens can be brought closer to the eye than is practical with CRTs (although a few models do cause eyestrain at close range so choose carefully).
      • But some of the newer "16x9" widescreen LCDs won't work well with xtimings' calculations and you'll need to tweak the sync pulses manually. For example, when connecting an old video card to an energy-saving Philips 192EL2, the only low-res modeline I found that worked anywhere near OK is Modeline "680x384" 42.75 680 720 792 896 384 392 396 404 doublescan (here is the calculation script)
      • And some newer graphics hardware, such as the Broadcom VideoCore IV in the Raspberry Pi, performs its own anti-aliasing on the HDMI/DVI output (especially in a vertical direction) whenever the resolution is less than the monitor's even by an integer factor (and irrespective of the doublescan setting); I don't yet have a way around this.
    • For CRT monitors (and for TFTs that are more flexible, e.g. on some laptops):
      • You might like to work out and include your ``optimal'' resolution(s).  To do this, you need to know the best size in points (36, 48 or whatever) for text you read at the distance of the screen.
        1. First you need to know your normal distance to the screen.  You can move the screen nearer, but the limits will vary with the type of mounting and the size of your keyboard, desk, chair, etc; you need to be aware of this variation if you use different computers.  Also, if you have variable sight, remember to allow yourself room to get even nearer when your sight is worse (and without hurting your posture too much), which is usually easier than temporary size changes.
        2. Divide the screen's distance by your normal reading distance for printed text (both measured from your eyes to the text itself, ignoring any magnifying device in between), and multiply by the size in points of the printed text you prefer to read.
        3. If you normally use a magnifier for printed text but cannot use it for the screen, multiply your answer by the scale factor of this magnifier.
        4. If you have a full-screen magnifier (fresnel lens) permanently mounted to the screen, then divide your answer by the scale factor of this magnifier.
        5. Do not try to work out your size by setting the ``point size'' on the screen of a wordprocessor or similar, because that might not be calibrated correctly.
        Let F be the pixel size of the bitmap fonts you have (the configuration files on this site use 20-pixel bitmap fonts, so that number is 20), D be your monitor size in inches (measure across the diagonal if you don't know), P be your on-screen pont size, and H and V be the horizontal and vertical parts of your monitor's aspect ratio (this is normally 4 and 3, but it can be 8 and 5 on some wide-screen laptops). Take the square of (F*D*72/P), divide it by (H*H + V*V), take the square root, take the nearest whole number, and use a resolution of H times that number by V times that number.
      • For CRT monitors, refresh rates should be between 85 Hz and 100 Hz; higher rates are more risky and lower rates can tire the eyes.  Start with 85 Hz and change it if the monitor starts making an unbearable high-pitched noise (you won't know this until you've finished setting up, so you might have to come back later and adjust things).  For 320x240 you might have to drop the refresh rate to around 75 Hz.
      • For CRTs, enable doublescan for all resolutions up to 800x600 (disable it again if xtimings warns about too high a frequency).  High-resolution CRT monitors can show gaps between scan lines at lower resolutions, and this can tire your eyes even if you don't notice them, but doublescan can reduce the problem.  At 320x240 it might not solve the problem completely but you probably still need it to get the timings within range.
  2. Edit your XF86Config or xorg.conf file (you'll almost certainly need root privileges for this).  It's probably in /etc/X11 or a similar directory (try locate XF86Config and locate xorg.conf).  If you have a file called XF86Config-4, edit that instead.  Make sure you take a backup of the old file in case something goes wrong.
    • Some newer Linux distributions don't use xorg.conf at all. You might be able to generate one by doing Xorg :1 -configure (the :1 is necessary if you're already running an X server on :0) and save it to /etc/X11/xorg.conf; if that doesn't work then you could try starting with an empty file and creating just the Monitor, Screen and ServerLayout sections as specified below (each needs an Identifier, and you might want to include things like Option "DPMS" "true" and Option "Backingstore" "true" in the Screen section).
  3. Create a section like this, changing it to suit the settings for your monitor:
    Section "Monitor"
       Identifier "whatever you want to call it"
       HorizSync 27-110
       VertRefresh 50-160
       # insert modelines here
    With some newer X servers you also need to add Option "NoDDC" to this section for the modelines to take effect.
  4. Find Section "Screen" and change the setting of Monitor to match the "whatever you want to call it" identifier you used above.  If there is more than one Section "Screen" in the file then you need to see which one is referred to in the Section "ServerLayout" (hopefully there'll only be one of those), or if in doubt do this for each Section "Screen" that you find in the file (as long as your X server will only drive one monitor).
  5. You might also need to ensure that the names of your modes (e.g. "1024x768") are listed on all Modes lines within the section.  If there aren't any, create one like this:
    SubSection "Display"
    Modes "your mode 1" "your mode 2" ...
    I find it's useful to delete any frequency annotations (i.e. the @85Hz etc) from the Monitor section to reduce confusion.
  6. You may also need to add a Virtual directive to the above subsection(s) and specify the width and height of the highest resolution you want, e.g. Virtual 960 600, to stop the driver from adding higher ones.
  7. Save the configuration file and re-start your X server.  Check that you can zoom through all the different zoom levels with Control-Alt-keypad +.  Check especially that you are happy with the zoom level that you'll use most often.  If your monitor has a menu system that tells you the refresh rate, check that this is what you wanted (85 Hz or 99 Hz or whatever) and check that the monitor is behaving normally.
  8. If the mouse pointer in doublescan modes looks squashed and/or in the wrong place, you may have to upgrade your X server to a later version, or change the graphics card, or do without doublescan.
  9. If you can switch between modes OK but the lower-resolution modes do not let you scroll around the larger desktop with the mouse (i.e. you are "locked in" to the smaller desktop size), then this might be caused by the "configurator" on the display manager GDM; try disabling it by setting Configurator=/bin/true in /etc/gdm/gdm.conf or /etc/gdm/custom.conf, or by using startx instead of GDM.
    • On some setups (e.g. Raspberry Pi) neither mode-switching nor scrolling works; you might have to fall back to a high-resolution non-scrollable desktop with larger fonts, or if you are on reasonably-capable hardware you could try setting one low-resolution mode and obtaining a larger virtual desktop by following the instructions on last-resort X11 magnification (the x11vnc method) but omit the scaling options because your hardware is doing the scaling.  (As you are omitting these, you can cut out x11vnc altogether and just connect the vncviewer directly to the vncserver on :2.  If nobody else can access your system then you might want to use TightVNC Server and do echo|tightvncpasswd -f>.vnc/passwd for an empty VNC password, although the prompt may still be displayed. Alternatively some clients can be set to read the password file directly by putting -passwd .vnc/passwd on the command line.)
More things to check (especially for old CRTs): If you will be using your monitor for long periods then it's best to get the image as stable as possible.  You can check the following things after you have done the above setup.
All material © Silas S. Brown unless otherwise stated.