Subtraction.com

Type Handling in Sketch Fixed

The latest version of Bohemian Coding’s Sketch finally fixes a longstanding problem that I wrote about in this post last November: the app’s handling of type has been erratic. Mixing multiple fonts and sizes has historically produced unpredictable results. According to Bohemian Coding, that is a byproduct of the app’s reliance on OS X’s text rendering engine. Version 3.6, released just this week, sports new “typesetter” code that behaves in a manner that’s much more consistent with what designers expect from type. Hallelujah! In this Medium post, the team goes into some detail on fixing the problem:

When designers speak of setting the line height to, say, 20 pt, what they mean is they want 20 pt between the baselines, and not line fragment rectangles of 20 pt height. That makes sense because what determines the visual vertical rhythm of text is the baseline, which is much more ‘visible’ than these abstract rectangles. So how did we fix this?

In Sketch 3.6 we’re introducing a new typesetter which produces consistent baseline offsets for paragraphs with a fixed line height. To make that work we’re looking at all of the line fragments in a paragraph and choosing a baseline offset which suits them all.

The consistent baseline offset is also maintained between paragraphs, even with varying fonts, as long as they have a fixed line height. When no fixed line height is set, we use the one the font indicated, which as we saw can leave us with varying results. When you set it to fixed, you get a beautiful, predictable vertical rhythm…

How does this work with existing documents? New text layers use the consistent baseline typesetter by default and text layers created in earlier versions of Sketch can adopt the new typesetting behavior by changing the line height.

As I argued last year, Sketch is full of winning ideas, but its handling of type had been doing them a major disservice—until now. Congrats to the team for addressing this longstanding and nontrivial problem. Read the full article at medium.com.

+