IntelliJ and other tools based on it, like Android Studio, look terrible on Ubuntu 14.04 with OpenJDK 7. The font rendering in the UI is terribly aliased and is a pain on the eyes. This is surprising since Eclipse renders beautifully using the same JDK and Ubuntu system.
Eclipse uses GTK for its GUI while IntelliJ and Android Studio use Swing. Thankfully, this situation can be fixed.
Replace the OpenJDK with a version in which font rendering has been fixed:
LibreOffice Calc is an excellent open-source replacement for the popular spreadsheet program Microsoft Excel. One irritation for me is that the default font and font size it uses are not what I would like. To set your own font, font size and other text formatting as default it takes a few steps as described below.
Open LibreOffice Calc. It opens with a new spreadsheet document.
First, we set our font as default for this spreadsheet document: Go to Format -> Styles and Formatting. Right-click on Default and choose Modify. In the Font tab, set the font, font size and other formatting options that you would like to be the default. Click OK.
We now save this format as a template: Go to File -> Templates -> Save As Template. Choose My Templates and click Save. Give your template a name.
Finally, we make our template as the default template: Go to File -> Templates -> Manage. In the Spreadsheets tab, click on your template and click Set as default. We are done! 🙂
All new spreadsheets created by Libreoffice Calc will now have the default font set in this template. Note that this is the font that will also be used for comments in Calc.
Similar to fonts for textual content, there are formatting styles or fonts that can be used on math expressions in LaTeX. For example, the set of real numbers R is typically written with what is called a blackboard bold font.
The formatting styles for math in LaTeX are:
mathnormal: This is the default for math expressions. The letters are italicized a bit. No need to apply it explicitly.
mathrm: Non-italicized version of normal.
mathit: Italicized like normal, but suits words better.
mathbf: Bold. Use for vectors and so on.
mathsf: Sans serif.
mathfrak: Fraktur. Used for lie algebras.
mathbb: Used for real sets.
A table of these fonts applied on symbols can be seen here.
Certain online submission services check the fonts used in the submitted PDF file. Many of them allow only Type 1 and TrueType fonts in the PDF. Type 3 fonts which may not scale well in printing are not allowed. I got the error shown in the screenshot above when I tried submitting to one such website.
Find out which fonts are being used in your PDF and for what objects. This can be done by using the PDFFonts tool as described here.
For example, I found that I had been using Type 3 fonts in a SVG image and in a plot generated by Matplotlib.
Next fix the source of these font problems. I edited the SVG image to use Type 1 or TrueType fonts. I requested Matplotlib to use LaTeX fonts for text rendering, as described here.
The PDF file regenerated from these files passed the font checks 🙂
PDFFonts is a useful tool to view information about the fonts in a PDF file. Typically, you need to bother with this only if you are having problems with submitting a PDF online or printing it.
This tool ships along with Poppler. To install it:
$ sudo apt install poppler-utils
Usage is straightforward. It is illustrated here with a sample PDF file:
$ pdffonts foo.pdf
name type encoding emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
MMFXPR+NimbusSanL-Bold Type 1 Custom yes yes no 25 0
KPMIUD+NimbusRomNo9L-ReguItal Type 1 Custom yes yes no 31 0
Arial,Bold TrueType WinAnsi no no no 77 0
Times New Roman,Bold TrueType WinAnsi no no no 78 0
ABCDEE+Calibri TrueType WinAnsi yes yes no 79 0
NHFWQZ+CMMI10 Type 1 Builtin yes yes no 160 0
COBEQK+CMMI7 Type 1 Builtin yes yes no 166 0
FOCRQR+CMR12 Type 1 Custom yes yes no 175 0
UJTTFG+CMR8 Type 1 Builtin yes yes no 266 0
DejaVuSans Type 3 Custom yes no no 283 0
SBITTL+CMMI8 Type 1 Builtin yes yes no 331 0
Cmr10 Type 3 Custom yes no no 475 0
DejaVuSans Type 3 Custom yes no no 958 0
The font used by GVim can be set by choosing Edit -> Select Font, which displays a dialog to pick the font. You can get the same dialog by using the command :set guifont=*
The chosen font is used only for the current session and GVim reverts back to its default font after that.
To set the default font used by GVim, add a command of the form set guifont= to your gvimrc. If you want to add it to vimrc file, then enclose this command in a if has("gui_running") block.
The only tricky part here is, what is the format in which the font and font size should be specified? An easy trick is to set the font and font size in the font dialog and then query it back using :set guifont?. Use the exact value that it displays. Note that the format of the font string varies according to the platform. A Ubuntu Mono font in size 10 is given as Ubuntu Mono:h10 on Windows and as Ubuntu Mono 10 on Linux.
Also on Linux, note that you should not enclose the font string in single or double quotes. If the font string has spaces, then escape them using backslashes. Enclosing in quotes works fine on Windows.