Variable Fonts Instance, Multiple Master Fonts

Variable Fonts Instance, Multiple Master Fonts

TUGboat, Volume 38 (2017), No. 2 203 Variable fonts instance, multiple master fonts. The details might matter even more as they can now be exaggerated Hans Hagen when some transformation is applied. 1 Introduction There is currently (March 2017) not much in- formation about these fonts so what I say next may History shows the tendency to recycle ideas. Often be partially wrong or at least different from what is quite some effort is made by historians to figure intended. The perspective will be one from a TEX out what really happened, not just long ago, when user and coder. Whatever you think of them, these nothing was written down and we have to do with fonts will be out there and for sure there will be stories or pictures at most, but also in recent times. nice examples circulating soon. And so, when I ran Descriptions can be conflicting, puzzling, incomplete, into a few experimental fonts, with PostScript and partially lost, biased, . TrueType outlines, I decided to have a look at what Just as language was invented (or evolved) sev- is inside. After all, because it's visual, it's also fun eral times, so were scripts. The same might be true to play with. Let's stress that at the moment of this for rendering scripts on a medium. Semaphores came writing I only have a few simple fonts available, fonts and went within decades and how many people know that are designed for testing and not usage. Some now that they existed and that encryption was in- recommended tables were missing and no complex volved? Are the old printing presses truly the old OpenType features are used in these fonts. ones, or are older examples simply gone? One of the nice aspects of the internet is that one can now more 2 The specification easily discover similar solutions for the same problem, but with a different (and independent) origin. I'm not that good at reading specifications, first of So, how about this \new big thing" in font tech- all because I quickly fall asleep with such documents, nology: variable fonts. In this case, history shows but most of all because I prefer reading other stuff (I do have lots of books waiting to be read). I'm also that it's not that new. For most TEX users the names METAFONT and MetaPost will ring bells. They someone who has to play with something in order to have a very well documented history so there is not understand it: trial and error is my modus operandi. much left to speculation. There are articles, books, Eventually it's my intended usage that drives the pictures, examples, sources, and more around for interface and that is when everything comes together. decades. So, the ability to change the appearance Exploring this technology comes down to: locate of a glyph in a font depending on some parameters a font, get the OpenType 1.8 specification from the is not new. What probably is new is that creating Microsoft website, and try to figure out what is in the variable fonts is done in the natural environment font. When I had a rough idea the next step was to where fonts are designed: an interactive program. get to the shapes and see if I could manipulate them. The METAFONT toolkit demands quite some insight Of course it helped that in ConTEXt we already can in programming shapes in such a way that one can load fonts and play with shapes (using MetaPost). change look and feel depending on parameters. There I didn't have to install and learn other programs. are not that many meta fonts made and one reason is Once I could render them, in this case by creating a that making them requires a certain mind- and skill virtual font with inline PDF literals, a next step was set. On the other hand, faster computers, interactive to apply variation. Then came the first experiments programs, evolving web technologies, where real-time with a possible user interface. Seeing more variation rendering and therefore more or less real-time tweak- then drove the exploration of additional properties ing of fonts is a realistic option, all play a role in needed for typesetting, like features. acceptance. The main extension to the data packaged in a But do interactive font design programs make font file concerns the (to be discussed) axis along this easier? You still need to be able to translate which variable fonts operate and deltas to be applied ideas into usable beautiful fonts. Taking the common to coordinates. The gdef table has been extended shapes of glyphs, defining extremes and letting a and contains information that is used in gpos fea- program calculate some interpolations will not always tures. There are new hvar, vvar and mvar tables bring good results. It's like morphing a picture of that influence the horizontal, vertical and general your baby's face into yours of old age (or that of your font dimensions. The gvar table is used for TrueType grandparent): not all intermediate results will look variants, while the cff2 table replaces the cff table great. It's good to notice that variable fonts are a for OpenType PostScript outlines. The avar and revival of existing techniques and ideas used in, for stat tables contain some meta-information about the axes of variations. Variable fonts 204 TUGboat, Volume 38 (2017), No. 2 It must be said that because this is new tech- kern, scaled from general dimensions to the current nology the information in the standard is not always size of the font. easy to understand. The fact that we have two ren- When the outlines of glyphs are needed in Meta- dering techniques, PostScript cff and TrueType ttf, fun the font is also converted from its binary form also means that we have different information and to something in Lua, but this time we filter the perspectives. But this situation is not much different shapes. For a cff this comes down to interpreting from OpenType standards a few years ago: it takes the charstrings and reducing the complexity to time but in the end I will get there. And, after all, moveto, lineto and curveto operators. In the pro- users also complain about the lack of documentation cess subroutines are inlined. The result is something for ConTEXt, so who am I to complain? In fact, it will that MetaPost is happy with but that also can be be those ConTEXt users who will provide feedback turned into a piece of a PDF. and make the implementation better in the end. We now come to what a variable font actually is: a basic design which is transformed along one or 3 Loading more axes. A simple example is wider shapes: Before we discuss some details, it will be useful to summarize what the font loader does when a user requests a font at a certain size and with specific features enabled. When a font is used the first time, We can also go taller and retain the width: its binary format is converted into a form that makes it suitable for use within ConTEXt and therefore Lua- TEX. This conversion involves collecting properties of the font as a whole (official names, general di- mensions like x-height and em-width, etc.), of glyphs Here we have a linear scaling but glyphs are not (dimensions, Unicode properties, optional math prop- normally done that way. There are font collections erties), and all kinds of information that relates to out there with lots of intermediate variants (say from (contextual) replacements of glyphs (small caps, old- light to heavy) and it's more profitable to sell each style, scripts like Arabic) and positioning (kerning, variant independently. However, there is often some anchoring marks, etc.). In the ConTEXt font loader logic behind it, probably supported by programs that this conversion is done in Lua. designers use, so why not build that logic into the font The result is stored in a condensed format in a and have one file that represents many intermediate cache and the next time the font is needed it loads in forms. In fact, once we have multiple axes, even when an instant. In the cached version the dimensions are the designer has clear ideas of the intended usage, untouched, so a font at different sizes has just one nothing will prevent users from tinkering with the copy in the cache. Often a font is needed at several axis properties in ways that will fulfil their demands sizes and for each size we create a copy with scaled but hurt the designers' eyes. We will not discuss that glyph dimensions. The feature-related dimensions dilemma here. (kerning, anchoring, etc.) are shared and scaled when When a variable font follows the route described needed. This happens when sequences of characters above, we face a problem. When you load a TrueType in the node list get converted into sequences of glyphs. font it will just work. The glyphs are packaged in We could do the same with glyph dimensions but the same format as static fonts. However, a variable one reason for having a scaled copy is that this copy font has axes and on each axis a value can be set. can also contain virtual glyphs and these have to be Each axis has a minimum, maximum and default. scaled beforehand. In practice there are several layers It can be that the default instance also assumes of caching in order to keep the memory footprint some transformations are applied.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us