Text layer moves down one pixel when switching styles

Hi all! I have an issue, and wondering if it’s a bug, or if there’s something I can do to prevent this from happening.

I have a symbol that has two text layers. Those text layers are in a group that has horizontal alignment set.

I have two text styles that I sometimes switch between for this symbol, one is 16px font size with 24px line-height, and the other is 14px font-size with 24px line-height.

The line-height and character spacing is exactly the same between the two styles. The only different is the font size.

When I switch the text style from the 16px size to the 14px size, the layer shifts down 1 pixel. If I then switch it back tot he 16px font-size style, the layer shifts back up 1 pixel. I can’t figure out why this is happening and it’s actually causing a huge headache when trying to use this symbol. Any help is appreciated.

This is by design: Sketch keeps the text anchored on the first baseline when you make changes to type. There’s no workaround for this.

That said, while this is by design, it can be unexpected by users. It’s not the first time we hear about this, and I’d like to eventually give people more control about the anchoring of a text layer when changes are made to it.

2 Likes