Potlatch 2/FAQ

From OpenStreetMap Wiki
Jump to navigation Jump to search

Broken "tofu" characters (□□□) displayed at small sizes under Linux

Phenomenon: All texts (including English) are broken where a smaller size font is used in the interface, e.g. for options menu; they are rendered as "tofu" characters ("□□□") which are completely unreadable.

Reason:

  • It's not caused by any Flash bug, or by any system's fontconfig settings, or incorrect font rendering.
  • It's because your system installation does not have the "Arial" font, which is unfortunately hard-coded and required at a fixed size by Potlatch2. As a web application, the only font it can safely use is "sans-serif". On MacOS, this problem is avoided because the OS provides a suitable fallback from missing "Arial" font to "Helvetica" (both fonts have similar metrics).

Solution:

  • Copy the missing Arial font from an existing Windows partition (from `C:\Windows\Fonts\Arial.ttf`) into the folder used by Linux. You can either install it using KDE/GNOME/Other DE's font utility, or place it under `/usr/share/fonts/truetype/` (modifying the content of this folder normally require performing it with superuser privilege).
    You may also use the software package tool for your Linux distribution and with it select the optional package to install the redistributable Microsoft core fonts for the web:
    • You can do it also by running `sudo apt-get install ttf-mscorefonts-installer`.
    • You'll get a prompt to accept the Microsoft's "End-User Licence Agreement" (EULA) before proceeeding with the installation.
    • This will then install a few common fonts used on Windows but with more basic coverage than versions provided with Windows, including: Andale Mono, Arial Black, Arial (Bold, Italic, Bold Italic), Comic Sans MS (Bold), Courier New (Bold, Italic, Bold Italic), Georgia (Bold, Italic, Bold Italic), Impact, Times New Roman (Bold, Italic, Bold Italic), Trebuchet (Bold, Italic, Bold Italic), Verdana (Bold, Italic, Bold Italic), Webdings. These fonts were produced in 1996 and were left almost unchanged since: if your machine has a valid licence for a recent version Windows, these fonts will be better with improved positioning, larger coverage of diacritics and additional letters needed for some languages.
  • After installing the fonts, you need to update the font cache using this command: `sudo fc-cache -f -v`
  • How to install Microsoft Windows fonts with Linux Ubuntu.