Previous: , Up: Scaling and Freezing   [Contents][Index]


3.5.2 Freezing

If you want to save some arithmetic operations, you may want to freeze the font. Freezing means that all dimensions normally expressed in design size units will be converted to TeX point units once and for all (by multiplying them by the design size in question). This includes character metrics, kerns, interword space etc. Everything. That way, you won’t have to do the multiplication by yourself every time a dimension is accessed.

Again, there are two ways to freeze a font. The first option is to do it at load-time, by calling load-font with the :freeze key (a Boolean). For instance, after calling (load-font "cmr10.tfm" :design-size 12 :freeze t), (em font) will return 12.000034 instead of 1.0000029.

The other way to freeze a font is to do it later on, by using the freeze function.

Function: freeze FONT

Freeze FONT.

Freezing a font means that all dimensions normally expressed in design size units are multiplied by it, so as to lead values in TeX point units. If FONT is already frozen, this function does nothing and returns nil. Otherwise, it returns t.

You can unfreeze a font at any time with the following function.

Function: unfreeze FONT

Unfreeze FONT.

Unfreezing means performing the inverse of what freeze does. If FONT is not frozen, this function does nothing and returns nil. Otherwise, it returns t.

Finally, note that if you change the design size of a frozen font, the font remains frozen and all concerned dimensions are updated to reflect the change.


Previous: , Up: Scaling and Freezing   [Contents][Index]