Try to avoid a few layout/context invalidations
The one in pango layout is pretty simple but rather effective (considering how simple it is).
The pangocairo-context change is important in GTK, which sets the font options on all CSS updates. This way we can often avoid invalidating the context altogether.