56 TUGboat, Volume 42 (2021), No. 1 An attempt at creating font transitions are topologically equivalent). In this case, it is not difficult to prove that any two such glyphs cande- S.K. Venkatesan formed from one into another by a simple homotopy Abstract deformation. In any case, we will be constructing an algorithm that does this, so we prove it by example. In this short note we discuss the abstract topological In other glyphs there are holes in the manifolds; aspects of fonts and how a simple homotopy defor- as in the case of O, Q, A, etc. In some cases, as in B, mation can be created to transition a glyph in one there are two holes. So the glyphs can have more than font to that of another font. We demonstrate inter- one boundary as well. But in all cases the boundary esting transitions for some fonts from sans-serif to is a simply-connected one-dimensional curve. As serif using a JavaScript implementation of a simple a special trivial case of the Poincar´econjecture,1 algorithm. We also discuss other cases which involve we have that any simply-connected one-dimensional deformations that map non-homeomorphic configu- curve is homeomorphically equivalent to a circle. rations that involve catastrophic bifurcations. In fact, there is only one one-dimensional manifold (without boundary), the circle. 1 Introduction Donald Knuth in his METAFONT project [1] wanted 3 Description of the algorithm used for to initiate a framework for creating fonts through font deformation computer programs. An essay in Douglas Hofs- We shall here briefly describe the first algorithm used tadter's book Metamagical Themas: Questing for to map the glyph of one font into another. the essence of mind and pattern [2] challenges this ambitious initiative and discusses it in great detail. 3.1 Algorithm 1 A simple question is, can a computer program au- Step 1 We center a font glyph into a standard font tomatically create hybrid fonts, for example, a new box of 1em height. font that is 30% like Helvetica and 70% like Times? Step 2 We identify the boundary curves of the font. We answer this question using a simple algorithm Step 3 We divide the curve into equal segments and demonstrate its ramifications for some fonts. along the path of the curve and create a fixed number of an array of points. 2 Algebraic topology of font glyphs and Step 4 We reorder the points of the array so that their deformations the one that is nearest to the origin appears Topology is usually defined as the study of clay geom- first. etry, explained through an example of a teacup being Step 5 We do steps 1{4 for both the font glyphs. topologically equivalent to a ring (the handle of the Step 6 We now transition from one set of arrays to teacup). The crucial idea is that you can remold the another using a linear path in time, to show the clay without breaking it anywhere through any con- transition. tinuous deformation, unlike in Euclidean geometry 3.2 Algorithm 2 where lengths are also preserved. Font glyphs are, for the most part, connected Steps 1{4 Follow as in Algorithm 1 compact two-dimensional manifolds with simply-con- Step 5 We first segment the sans-serif font glyph. nected one-dimensional boundary curves. Although Step 6 We now segment the serif font glyph into most glyphs are simply-connected, there are also finer (typically 10 times more) segments than some glyphs such as lowercase \i" and \j" that have the sans-serif font glyph. two disconnected pieces of manifold, due to the dot Step 7 We now look for an orthonormal projection that is disjoint from the main shape. In any case, (due to symmetry requirements we may have each connected piece is a connected compact two- to use x-projections and y-projections as well) dimensional manifold with a boundary. from sans-serif (as sans-serif is more regular- Typically, in the English uppercase alphabet, shaped) font glyph onto serif font to locate the C,E,F,G,H,I,J,K,L,M,N,S,T,U,V,W,X,Y,Z and in the one-to-one correspondence. lowercase, c,f,h,k,l,m,n,r,s,t,u,v,w,x,y,z are glyphs Step 8 Once the points have been paired we now that are two-dimensional manifolds with a simply- transition from one set of arrays to another using connected single boundary which can be homeo- a linear path in time, to show the transition. morphically mapped to a two-dimensional disc with 1 It is no longer a conjecture, as Grigori Perelman one-dimensional circle as its boundary (we could have has proved the conjecture for the hitherto unproven just as well used a square instead of circle, as they three-dimensional case [5]. S.K. Venkatesan doi.org/10.47397/tb/42-1/tb130venkatesan-transfont TUGboat, Volume 42 (2021), No. 1 57 3.3 Some hints on filling the area inside 100% sans-serif: the curve The curve that has the longest length needs to be filled inside, while the rest of the curves should not be filled inside (except for the case of the dot for\i" and \j"). In order to identify which piece of curve 70% sans-serif, 30% serif: maps into which, we use the length and the centroid of the curves as the important parameters to guide in our choice. To identify that the dot in \i" and \j" needs to be filled, we need to find out if the other curves are inside the main curve or not, a non-trivial exercise. 30% sans-serif, 70% serif: In fact, it took more than a century to prove the Jor- dan curve theorem [3], i.e., that a one-dimensional closed curve embedded in a two-dimensional Eu- clidean plane divides the plane into two disconnected pieces (the inside and outside), but for approximately convex shapes this identification is not that difficult. 100% serif: 4 The Demo site and JavaScript algorithm The demo site is here: cqrl.in/dev/font-transition-js.html The JavaScript code, released under GPLv3, is here: github.com/Sukii/font-transition 6 The pessimism of Hofstadter and 5 Transition from Linux Biolinum Regular the confidence of Knuth to Linux Libertine Regular It is true that there are limits to what is feasible; for example, Einstein showed, using the principle of relativity, that the speed of light limits the speed of particles, as it would require infinite energy to cross that barrier. However, we also know that quantum tunnels break through such impossible barriers, as in the case of the Hawking tunneling effect, by which we are able to visualize black holes. More simply, X-rays are not visible to human eyes but they can be discerned through other means such as photographic plates. So limits of human perception and achieve- ments can be extended by other means, as we gain better perception of the problems. We have shown in this article, both theoreti- cally and through demonstration of font transitions that it is possible in some effective way to achieve what Donald Knuth envisaged. In this article, we restricted ourselves to transition from one font to another only in the case where both are topologically equivalent (i.e., homeomorphic), but it is possible to go beyond that into other complicated designs such as script fonts and gothic (Fraktur, etc.) fonts, i.e., create a transition effect from a sans-serif font glyph to a script or gothic font glyph. This can- not be achieved by a simple homotopy deformation. It requires creation of bifurcation effects and other Now let us typeset some text with this transition catastrophes studied by Rene Thom [4], V.I. Arnold font to see if it is reasonable: [5], and many others. An attempt at creating font transitions 58 TUGboat, Volume 42 (2021), No. 1 Instead of meandering into profundity, we shall now discuss a concrete example. Consider the follow- ing calligraphic character L: L −! L generated using the calrsfs LATEX package. Let us see what the transition from the sans-serif \L" in Linux Biolinum to this script L might look like: However, creating this transition was not as easy as the previous cases. The \script L" has three boundary curves while \sans-serif L" has only one boundary curve. But, if we carefully observe the pen stroke as it flows through the glyph, we can seeit In the above transition, one can observe that is just one stroke but self-intersecting at two places. all animals retain approximate left-right symmetry This can be considered as a two-dimensional ribbon in their external form. This left-right symmetry is embedded in (2+1)-dimension (like a twisting and imposed by the Darwinian pressure on the external turning fly-over we see in big cities). form by the environment that punishes any left-right Unfortunately, the font files do not store this self- asymmetry as it decreases survival fitness due to intersecting curve. Instead, the font files stores it as impaired physical mobility. We shall see in the next three boundary curves. In order to create the above section how such symmetry conditions can be im- transition we exported the glyph from the font file as posed on glyphs to preserve approximate left-right three SVG curves, welded them together as a single symmetry in some characters in the transition states. curve that self-intersects at two junctions but flows Insects possess some kind of left-right symmetry, unobstructed through the channels.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages4 Page
-
File Size-