Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I read that MetaFont defines vector fonts. Elsewhere it says it produces raster output. What kind of font does MetaFont really produce?

share|improve this question

2 Answers 2

up vote 16 down vote accepted

Fonts with MetaFont are similar to TrueType and Type1 (and OpenType) fonts. Fonts are described in terms of curves and lines but the display is always in pixels, because most used output formats are based on pixels (like screen, laser printer,...). The difference is (among many others, such as hinting) that the place where rasterization happens is different. MetaFont converts these vector fonts into bitmaps right away (the pk-files) and the other font formats are turned into pixels at the system level (like the operating system or the pdf viewer). If the bitmaps are not optimized for the current output device (which is really hard to do nowadays), the output gets ugly. This is why we only use these "vector fonts" today. The rasterizer knows its output device.

share|improve this answer
    
Actually, the output usually looks pretty decent; with the one exception of which I am aware being Adobe [Acrobat] Reader, as long as the fonts have a decent resolution. (Though admittedly I haven't tried printing a document with 300 DPI fonts on a 360 DPI printer. Yet. But anyway, most on-screen renderers seem to do okay, and would in fact provide far uglier output if the fonts were rendered by metafont for the display resolution.) –  SamB Dec 19 '10 at 5:53
    
What about sub pixel rendering, hinting etc? Can this be done with bitmaps? –  topskip Dec 19 '10 at 7:56
    
@SamB Pixel fonts in Adobe Reader used to look hideous, but these days I thought it did an okay job. I don't agree that a MetaFont bitmap at screen resolution would look appreciably worse than a rasterised vector font, but it depends on what you're used to (Mac OS X's font anti-aliasing is far different than Windows' ClearType). –  Will Robertson Jan 4 '11 at 6:00
    
@Patrick Not with bitmaps, but with MetaFont (a) no to sub-pixel, but (b) yes to "hinting", although the process would be different — you can add resolution-dependent instructions to the output process to improve low-res display, which would be equivalent to what hinting tries to achieve on-screen. –  Will Robertson Jan 4 '11 at 6:02
    
@Will: This was based on having tried Yap with very low DPI (72?) metafont "mode" ... it really wasn't pretty, even allowing for the slightly-different DPI being assumed for display. (Of course, this might be related to my being accustomed to the anti-aliased results of the more usual "have metafont render at 300 DPI and resample down to the pretended display res", but I really doubt the Computer Modern family was "hinted" to the same degree as Times New Roman and friends -- or that metafont can even allow that kind of pixel-pushing tweakage.) –  SamB Jan 4 '11 at 19:14

Metafont outputs raster fonts (bitmaps, in other words). It never deals with vector shapes. Yes, the curves are defined programmatically, but the moment Metafont encounters the instruction like "draw some curve/path" it discretizes the path. This actually allows some features of Metafont (like erasing, pens) to be implemented in a more or less straightforward way.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.