As TFM evolves over time, you might one day feel the need for conditionalizing your code on the version of the library.
The first thing you can do to access the current version number of
TFM is use the
Return the current version number of TFM. TYPE can be one of
returned value is a fixnum. Otherwise, it is a string.
A TFM version is characterized by 4 elements as described below.
*release-status*. The status of a release can be
:rc(standing for “release candidate”) or
:patchlevel. These are in effect 4 levels of expected stability.
*release-status-level*. Status levels start at 1 (alpha 1, beta 1 and release candidate 1) except for stable versions, in which case patch levels start at 0 (e.g. 2.4.0).
In addition to that, each version of TFM (in the sense
major.minor, regardless of the status) has a name, stored in the
*release-name*. The general naming theme for TFM
is “Uncial Fonts”, from the
Here is how the
version function computes its value.
:numberis computed as major * 10000 + minor * 100 + patchlevel, effectively leaving two digits for each level. Note that alpha, beta and release candidate status are ignored in version numbers (this is as if the corresponding status level was considered to be always 0). Only stable releases have their level taken into account.
:shortversion will appear like this for unstable releases: 1.3a4, 2.5b8 or 4.2rc1. Remember that alpha, beta or release candidate levels start at 1. Patchlevels for stable releases start at 0 but 0 is ignored in the output. So for instance, version 4.3.2 will appear as-is, while version 1.3.0 will appear as just 1.3.
:longversion is expanded from the short one, and includes the release name. For instance, 1.3 alpha 4 "Artificial Uncial", 2.5 beta 8 "Rotunda", 4.2 release candidate 1 "Romantic Rustic" or 4.3.2 "Square Capitals". As for the short version, a patchlevel of 0 is ignored in the output: 1.3 "Artificial Uncial".