3 ms·
+1 from another Figma engineer who happened to work on the text engine back in the day. I think that Evan generally wrote code that was as simple as possible —
by poiru 1y ago
+1 from another Figma engineer who happened to work on the text engine back in the day.
I think that Evan generally wrote code that was as simple as possible — there was no unnecessary complexity. In this case there indeed is some inherent, unavoidable complexity due to the math involved and the performance requirements, but otherwise I found our text rendering pipeline very understandable.
Evan actually wrote about it if you're curious to learn more: https://medium.com/@evanwallace/easy-scalable-text-rendering-on-the-gpu-c3f4d782c5ac https://medium.com/@evanwallace/easy-scalable-text-rendering...
- marhee 1y agoIt’s a clever trick. But can it render a textured text? Transparent text, gradient fills? Maybe it can, I dont know. But why not just triangulate the glyph shapes, and represent each glyph as a set of triangles. This triangulation can be done offline, making rendering very lightweight.
- poiru 1y agoThe linked post was about Evan's side project, but within Figma, all of that is indeed possible. The glyphs are transformed into vector networks[0], which has a fill pipeline that supports transparency, gradients, images, blending, masking, etc. [0]: https://www.figma.com/blog/introducing-vector-networks/ https://www.figma.com/blog/introducing-vector-networks/