Linux Format

Better-looking documents

Nick Peers reveals how to add, remove, hide, convert and even redesign the fonts on your system so you can have beautiful documents.

- Nick Peers remembers a time when he used to avidly collect fonts. These days, he prefers the ‘less is more’ mantra – besides, they’re available online.

Nick Peers reveals how to add, remove, hide, convert and even redesign the fonts on your PC, so you can design better-looking documents.

The humble font may not be a thing to get most people’s hearts racing, but it’s neverthele­ss a vital part of your Linux installati­on. It’s not simply a case of having the right fonts to ensure what you create on your PC can be read on other computers, whether they’re running another flavour of Linux, MACOS or Windows. No, fonts play a critical role in your everyday computing too. You’re staring at the screen for hours, switching between desktop windows, your web browser, console window and a multitude of apps. Fonts play a central role in all of this, and how they appear on screen (a process known as font rendering) can be pivotal in how tired your eyes get.

Let’s open with a quick primer. Fonts are more accurately described as typefaces, which means a particular design of type. Well-known examples include Arial, Times New Roman and Liberation. These come in different variations (also referred to as styles or faces):

bold, italic and so on. Fonts can be packaged two ways: a single file containing multiple variations, or individual files for specific variations, with the files referred to collective­ly as a ‘font family’.

Typefaces can be organised into one or more groupings according to their general appearance. The most common group pairings are serif and sans serif. Serif refers to small lines or strokes found at the end of a longer stroke in a letter, characteri­stic of serif fonts like Times New Roman. Sans-serif fonts like Arial lack these flourishes. Serif fonts are also occasional­ly referred to as Roman, while sans-serif fonts are known as Gothic.

Another common group pairing is proportion­al and monospace. Proportion­al fonts have different widths for each character, and are generally considered easier to read, while monospace (or fixed-width) ensure each character has a single, standard width – better suited for code or within a Terminal.

A further complicati­on: fonts don’t all conform to a single format. Whether they’re composed of bitmaps or vectors (known as ‘outline’), several competing standards exist. Thankfully Ubuntu supports the major standards: Truetype and its successor Opentype, plus Adobe Type 1 (Postscript) and its successors. Even then these can be packaged with different file extensions; for example, TTF and OTF for Truetype/ Opentype formats.

Fonts and Ubuntu

Ubuntu 18.04 comes with over 100 fonts installed, many of them provided by other pre-installed apps, most notably Libreoffic­e. Indeed, the quickest and easiest way to quickly see what fonts are provided is to open

Libreoffic­e Writer and browse the font menu. There are several ways to add fonts to Ubuntu. The most basic option is to download a font file, then double-click it to open it in the built-in Fonts viewer tool. From here you can preview the font, view its licence (click Info) and add it by clicking Install. Once the button changes to a greyed-out ‘Installed’, it’s in place.

The Fonts tool is limited in several respects: you can only install one font at a time for starters. We’ll move on to a superior alternativ­e in a second, but first, a quick diversion. When you installed that font, the Fonts tool basically copied it to another location on your hard drive: open Files, click Home and then click the hamburger icon to tick ‘Show Hidden Files’. Now browse to .local/share/fonts where you’ll find a subfolder (or series of sub-folders) inside which is your

font. Uninstall the font simply by removing it from this folder. You can also drag multiple font files into this folder to install them all in one go.

By default, fonts you install are only available to your own user profile. In the event you want to install a system-wide font, you’d need to copy it to another location that requires administra­tor access. If you’ve not already done so, open Terminal and run the following commands:

$ sudo apt install nautilus-admin

$ sudo nautilus -q

Ignore the error messages, close Terminal and open

Files. Click Other Location, followed by your main Linux partition, then right-click the /usr folder and choose ‘Open as administra­tor’. You can now browse to the /usr/share/fonts folder where you’ll find all the fonts that were pre-installed with Ubuntu, buried inside various sub-folders according to their format. Just copy your fonts here to make them available to all users.

Better font management

If you’re looking for a more powerful, user-friendly way to view and manage your fonts – including being able to temporaril­y install fonts or hide them from view – then you need Font Manager. Search the Ubuntu Software store for ‘font-manager’ or type sudo apt-get install font-manager into a Terminal window.

The annotation (see bottom left) reveals the various ways in which you can view and preview your font collection. When Manage (the default view) is selected, you’ll see + and - buttons at the top of the screen. These enable you to quickly add and remove fonts singly or in batches. Note you can only remove user-installed fonts in this way – the necessary system fonts are off-limits, for obvious reasons.

A more elegant way of dealing with unwanted fonts is to disable them – and that’s easy too. You’ll see that each font listed in the right-hand pane is accompanie­d by a tick. Remove the tick and the font is disabled, disappeari­ng from your system while still being easily retrievabl­e. Use the Disabled filter on the left to quickly list all hidden fonts for easy review and re-enabling.

Font Manager has other tricks up its sleeve: for one, the ability to specify one or more folders on your hard drive as a location for fonts. Let’s say you juggle various jobs where you need fonts specific for that project. Simply collect them in one folder, then click the preference­s button and select Sources in the left-hand menu. Click + and add the folder in question. The fonts inside the folder are instantly available to use; simply select the folder and click - (the minus button) to remove it and the fonts will disappear too. There appears to be a handy switch for enabling and disabling these folders without having to remove them, but it had no effect on our Ubuntu 18.04 installati­on.

Font Manager also enables you to create your own custom filtered views using the Collection­s tab: perfect if you have fonts for different purposes – say, running a website on the one hand, and producing documents for sharing on other platforms on the other.

Improve font rendering

The way fonts are displayed on screen varies from one platform to another. There’s a detailed overview of this at https://pandasauce.org/post/linux-fonts – but long story short, the way outline (or vector) fonts are converted into pixels for display on your monitor has divided opinion for decades. Because displays have much lower resolution­s than printers

(96 dpi compared to something like 1,600 dpi), fonts can often appear pixelated or jagged. Various techniques – collective­ly known as font smoothing – have been developed to mitigate these effects.

Linux has traditiona­lly had a bad press compared to Windows and MACOS when it comes to font rendering. Most distros use a version of Freetype (www.freetype. org) – for example, Ubuntu 18.04 uses Freetype 2.8.1.

Freetype offers several font-smoothing techniques, all

accessible in Font Manager. Click the Preference­s button and you’ll find all the controls you need under Rendering and Display.

The Antialias option is a straight on/off switch, while flicking the Hinting switch on reveals two additional options: an Autohinter option and four levels of hinting, from none to full. The ‘Use Embedded Bitmaps’ switch may help with some fonts if they contain embedded bitmaps that are optimised for displaying at certain sizes on screen.

The Display section enables you to set a target dpi (the default option is usually the best), while ‘Scale factor’ helps display fonts at a reasonable size on highdefini­tion screens such as 4K displays. You’ll also find a LCD Filter setting, which – combined with the Subpixel Geometry options below it – works in a similar way to Windows’ Cleartype technology.

The simplest thing to do is experiment: some effects will be more noticeable than others. The effects of your changes should be instantane­ous, but you may need to close and reopen some applicatio­ns to see how things have changed.

The Gnome Tweaks tool – available through the

Software Centre – offers a similar set of rendering tools to those found in Font Manager in its Fonts section. It also provides four drop-down menus that enable you to change the default fonts used for window titles, user interface dialogue boxes, documents and monospace fonts on supported applicatio­ns such as Firefox.

Sadly, the changes have no effect on system tools or the main Gnome interface. If you want to change these fonts, you’ll have to dig deeper: check out the step-bystep guide opposite for full details. When it comes to choosing a font, replace FONT_NAME with the font family as listed in Font Manager’s main pane. If the font family name is more than one word, enclose it in quotation marks: “Liberation Serif” for example. Leave Sans-serif (or Serif or Monospace depending on your choice of original font) in place as a fallback in case something happens to your chosen font.

Convert and edit fonts

Looking for a way to convert a font between different formats? Or are you a designer looking to take a font and change its look and feel? In either event, open

Software Centre to install Fontforge (https:// fontforge.github.io). It’ll open to display two windows: an About screen (close it) and an Open Font dialogue box. Don’t open any fonts currently installed on your PC, and make sure you work on a backup copy just in case you mess up the original.

The program will open two more windows: one lists all the individual characters (glyphs) that make up that font, the other will list warnings to do with that font. Most of these are minor errors or advisories that you can usually ignore; if you’re concerned about a particular font’s stability, you can also perform a validation check by selecting ‘Element > Validation > Validate’. Advanced users will also find a ‘Find Problems’ option here, which leads to a multi-tabbed dialogue where you can opt to search for all manner of fonty issues.

Fontforge can also convert fonts between standards via the ‘File > Generate Fonts…’ dialogue. All the major types are supported, including variations for different platforms. Experiment with converting to either Truetype or Opentype if you’re struggling to get a font to work.

Fontforge’s main purpose, however, is to help designers edit existing fonts and create new typefaces from scratch. To see this in action, simply double-click one of the characters in the main Fontforge window. This will open the Character View window, which is a set

of drawing tools for editing. Go back to the main window and double-click another character, and it’ll open in its own tab within the Character View window.

The Metrics menu is where you can go to adjust the spacing and kerning (the spacing between individual characters in a proportion­al font) of a typeface’s characters. Choose ‘Metrics > New Metrics Window’ to adjust the kerning for an individual character. A related – and equally useful – tool is ‘Metrics > Kern Pair Closeup’, which enables you to adjust the specific kerning between two characters in the set. By default, your selected character is selected as the first of the pair, but you can change this by typing a new character into the main box. Use the drop-down menu to select other characters to pair with it, then experiment with the Kern Offset figure.

If you want to change a font’s metadata – the tags used to describe it – choose ‘Elements > Font Info’.

Fontforge is a powerful tool that you can easily feel overwhelme­d by, but it’s blessed with comprehens­ive documentat­ion. Head to http://designwith­fontforge.com/ en-us where you’ll find a downloadab­le book (in EPUB, MOBI or PDF format) that can also be read online as you work.

 ??  ??
 ??  ?? Font Manager makes it easy to disable font families by hiding them – simply untick the font to do so. Tick it to restore it instantly.
Font Manager makes it easy to disable font families by hiding them – simply untick the font to do so. Tick it to restore it instantly.
 ??  ?? Ubuntu comes with a basic built-in font viewing tool that can also preview and install new fonts, but not much else.
Ubuntu comes with a basic built-in font viewing tool that can also preview and install new fonts, but not much else.
 ??  ?? If you’re unhappy with the way fonts are displaying on your monitor, try tweaking the Freetype settings.
If you’re unhappy with the way fonts are displaying on your monitor, try tweaking the Freetype settings.
 ??  ?? The Gnome Tweak Tool has options for changing the fonts used in applicatio­n elements such as title bars.
The Gnome Tweak Tool has options for changing the fonts used in applicatio­n elements such as title bars.
 ??  ?? Fontforge is a ludicrousl­y powerful tool that allows you redesign the characters that make up a font.
Fontforge is a ludicrousl­y powerful tool that allows you redesign the characters that make up a font.

Newspapers in English

Newspapers from Australia