Interactive button: change font weight without affecting button size

Hi there,
I’m trying to replicate this design (you can it yourself on https://glyphsapp.com/learn)

<a href="https://gifyu.com/image/SwjBo"><img src="https://s4.gifyu.com/images/Untitledc651a51a2b07ce15.gif" alt="Untitledc651a51a2b07ce15.gif" border="0" /></a>

As you can see, the button size is the same when inactive and when hovering on it, while the font weight increases.
I wasn’t able to replicate this design in Figma.
I’d like to have a component that I can reuse for different buttons with different texts.

Anyone can help? Thank you

This is the gif
Untitled