Sublime Forum

Sublime multiplatform UI - how?

#1

I use both Sublime applications every day and I sometimes wonder: how is the UI layer implemented on multiple platforms? I already know it’s a custom UI but I’d be very interested in some details, such as how is the smooth, inertial scrolling done on macOS - does it use the native scrollview and rendering everything inside it OR is it a new implementation from scratch that mimics the parameters of the native one?
Same with fonts - native rendering per platform or something custom using Harfbuzz or similar?

0 Likes

#2

Smooth scrolling is done through events from cocoa; it has special momentum events for momentum scrolling, we just scroll the pixel amount it gives us. Momentum scrolling on Linux requires some extra effort to match GTK’s behaviour. Fonts are rendered per platform to an atlas which can then be composed when rendering.

0 Likes

#3

Great answer, thank you!

0 Likes