Translations of this page:

Font Hinting

Occasionally, graphics containing contain small, or very small, bits of text are needed in online questionnaires. The text quickly becomes blurry and illegible – usually due to improper scaling or carelessness when exporting the vector graphic.

In general, the best results are obtained by inserting the text directly as text in the website. Image elements and text can be positioned wherever you want using CSS positioning.

The second-best result is obtained by exporting the text (as a vector object) directly in the correct resolution. Image editing software (e.g. GIMP) can be used to do this. Enable hinting by checking the Hinting checkbox in the tool options. Doing this in graphic design software such as Illustrator can be a little more complicated.

Hinting in Illustrator CS 4

Illustrator offers a feature Save for Web & Devices. The result is not bad, but far from perfect.

Save for WebAfter Optimization
Export for WebExport after Optimization

A few additional steps are needed to transfer small fonts neatly into a raster graphic:

  • In EditPreferencesUnits …, select “Pixel” as the unit for General and Text.
  • Scale image or image element to the required size (in pixels).
  • Turn on ViewPixel Preview
  • Deactivate ViewSnap To Pixel
  • Deactivate ViewSnap To Point

The first impression of how the image will look later on as a raster graphic can be seen here. For further optimization, zoom in closely on the text (e.g. zoom level 400%).

Keep an eye on the sharpness of the horizontal lines here – for example, the horizontal dashes in the upper and lower case versions of E. Illustrator should take care of this as much as possible – but sometimes this is not enough. If need be, make the font size a little bigger or smaller to ensure the parallel horizontal lines look sharp on the raster grid.

  • Go to the menu item EditPreferencesGeneralKeyboard Increment and set a lower value, e.g. “0.1 pixels”

Use the arrow key to shift the text to the left and right – this means you can see when the letters fit better into the raster grid, or when it does not look as good. If one vertical dash is always razor sharp, wheres the other is always blurry, play around a little bit with the character spacing.

  • If the overall image looks correct, highlight all the objects and select ObjectRasterize. For Resolution, select “Screen”, for Background, select “white”.

After you have confirmed this with OK, you will not see a difference as you are already in the Pixel Preview. If you switch to the normal view as a test, you will see that the text has been pixelated.

  • Last but not least, save the image with FileExport as a graphic, for example in PNG format.
en/general/type-hinting.txt · Last modified: 06.02.2015 09:04 by alexander.ritter
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Driven by DokuWiki