Designing for different visual angles with Variable Fonts and Posenet

Published by Kushtrim Hamzaj
November 8, 2022

The introduction of machine learning libraries has opened up new ways to experiment with context aware typography and letterforms. By knowing where the user’s position is on the screen, and taking advantage of variable fonts, we can communicate typography in new ways. For example, for different viewing angles.

Long and Short Viewing Relationships

When we design a variable typeface, we mostly concentrate to represent optimal visual performance of our typeface for a specific viewing angle – mainly the front view. How the typeface looked on other viewing angles was out of the designer’s control and as such disregarded. These flaws became noticeable in the work of the Swiss Graphic Designer Wolfgang Weingart and his photo-optical experiments in 1965 called “Examination of the Letter M”, in which he photographed the letter “M“ from different viewing angles to produce astounding type design variations. Although Weingart primarily did not intend his experiments for legibility and readability, he provided plenty of questions to think about when designing a typeface that can be read on multiple viewing angles. The effect of small and large visual angles on typography has already been explored and documented across in the medium of print in subtle ways. For example the research from Sofie Beier shows that letter boldness benefits on smaller visual angles than larger visual angles.

Examination of the Letter M, 1965
Examination of the Letter M, Animation
Examination of the Letter M, Animation

Exploring Angles

The aim of this project is to design a similar experiment, but in a digital context and to combine these approaches and findings with type through machine learning (ML) and variable fonts. While one could argue that machine learning (ML) may have its disadvantages in terms of privacy, it gives a glimpse into the possibilities of variable typography in new context aware spaces. Things like world location, acceleration, reading perspective/distance and ambient light all were not possible before, and now with the introduction of sensors and machine learning they become accessible to the designer. By understanding these advantages, we can communicate variable typography in new ways. As an example, the displayed typeface above (figure 1) showcases a variable typeface smoothly interpolating between various axes. Yet, the typeface solely operates as an animation and lacks responsiveness to the reader’s behavior in the given context. So the question stands: how can we instruct the typeface to adapt its axes seamlessly according to the reader’s viewing angle in real-time on the device using machine learning?

Figure 1: Animated variable typeface created in three multiple masters for this project, animated using CSS programming language, but is non-responsive to context.

Machine Learning

One potential strategy to enable the typeface designed (figure 1) to adapt to the reader’s viewing angle is to utilize a face detection ML library that assesses the user’s proximity to the screen by detecting their face’s position in relation to the frame. There are many face recognition libraries available out there, but for this experiment, I opted to install the PoseNet library from ml5.js* (figure 2) to analyze the user’s camera feed and identify facial landmarks in the browser. Ml5.js is a user-friendly machine learning library that simplifies Machine Learning for designers by providing an accessible means of rendering graphical output to the browser.

Figure 2: Screenshot from the 17 PoseNet Keypoints
Note: Adapted from Real-time Human Pose Estimation in the Browser with TensorFlow.js in TensorFlow.js, n.d., Retrieved March 16, 2023, from https://blog.tensorflow.org/2018/05/real-time-human-pose-estimation-in.html. Copyright 2023 by TensorFlow. Used with permission.

Having loading the PoseNet library into the browser (which, by the way, is accompanied in a series of online tutorial by Daniel Shiffman on his YouTube channel, offering beginner-friendly machine learning tutorials and challenges), I was able to process facial landmarks detection like the eyes, nose, and ears, directly in the browser. This approach enabled me to manipulate the data according to my preferences. After having these data I utilized p5.js* to visualize facial landmarks like the eyes, nose, and ears, using the processed data generated by ml5.js (figure 3). To ensure a balanced calculation of the user’s position, I chose the nose as the central point of both the face and the entire screen. With the information furnished by PoseNet, I was able to pinpoint the exact position of the nose on the screen (as shown in figure 4). However, the data provided by the browser was too detailed and very complex to be edited with p5.js. Therefore I created a 12-column grid with p5.js to serve as a reference point for facial landmarks (figure 5). This approach allowed me to calculate the nose’s position based on its location on the grid (e.g., number 1, 2, or 3) and provide more specific information about the location of facial landmarks, in this case the nose.

Figure 5: This is an overview of the 12-grid that was created utilizing p5.js.
Note: The grid was designed to provide a reference point for facial landmarks, simplifying the data generated by PoseNet and aiding in the calculation of the nose’s position on the screen. The grid consists of 12 columns and serves as a visual aid to improve accuracy and precision.

The Typeface

The variable typeface developed for this project has been designed with a focus on adjustability and responsiveness to the reader’s viewing angle. The typeface includes three axes: the right master, left master, and weight master, which are all meant to be controlled by the machine learning library, PoseNet. The right and left master axes enable the typeface to tilt in the corresponding direction, providing a dynamic appearance that changes based on the reader’s perspective. In contrast, the weight master axis adjusts the thickness of the font, creating further visual interest as the typeface adapts to different angles.

Figure 6: Animated variable typeface created in three multiple masters – right, left, and weight
Note: This typeface was designed to be responsive and legible from multiple angles, ensuring optimal visibility and readability and specifically for this project.
Typeface Animation
The complete Alphabet
Text Sample

Exploring Angles

After successfully setting up facial landmark detection using PoseNet and visualizing the data with p5.js, the focus of the experiment shifted to integrating a variable typeface onto the canvas. In the example below (as depicted in figure 7) you can see how the typeface is reacting to the user’s position on the screen. This is happening due to the fact that I am changing font-variation-settings as the nose is moving left and right to the screen. For example, if the user’s nose was detected in grid column 2, the font weight could be set to 500, and vice versa (figure 8). This approach provided greater control over the context of the typeface, as the user’s position could be determined and the typeface adjusted accordingly (figure 9).

Figure 7: Three masters in action with PoseNet library.
Figure 8: Backend view of the font variations being manipulated using p5.js and the data provided by PoseNet.
Figure 9: Video capture of the font variation settings being updated while the user is moving right or left to the screen, the capture is made using google chrome dev-tools.
Figure 10: Aerial view of the setup

Final Prototype

In this prototype, the interpolations of the variable typeface occur within the constraints of the built-in FaceTime HD camera located near the top edge of the retina MacBook Pro display. While this camera setup was sufficient for the purposes of this experiment, there is certainly room for improvement and expansion in future iterations. For example, a wide-angle camera (as one seen in the latest Ipads) could be used to capture a broader field of view and provide more flexibility in terms of viewing angles. Additionally, non-linear interpolation could be explored as a means of easing and animating the text as it is approached from different angles. These considerations could further enhance the user experience and make the variable typeface more adaptable to a wider range of digital contexts.

Figure 10: Typography interpolation based on viewing angle. Note how font axes become more prominent as the user (on a built-in FaceTime HD camera) moves closer to the screen.

Experimenting and going the distance

There is ample room for experimentation in the field of context-aware interfaces and variable typography, regardless of whether you are optimistic or pessimistic about their potential. For example, airport signage could dynamically highlight relevant information such as gate numbers and walking time as people approach. Similarly, restaurant signs could reveal menu items upon closer inspection. In the realm of gaming, typography hierarchy could adjust based on proximity to threats or danger levels. This intersection between physical space and type/interface behavior offers exciting possibilities for exploration and creativity. As designers, it is important to approach this space with a sense of responsibility and a desire to foster curiosity and innovation.

References:

Weingart, W. (1965). Examination of the letter M. In Masters Design Lab (Ed.), Masters Design Lab Exhibition Catalog.

Beier, S., & Oderkerk, C. A. T. (2019). Smaller visual angles show greater benefit of letter boldness than larger visual angles, 192, 56-75. https://doi.org/10.1016/j.actpsy.2019.102904

ATypI. (2016, January 16). Special OpenType Session [Video]. Youtube. Retrieved March 14, 2023, from https://www.youtube.com/watch?v=6kizDePhcFU