Colorful Variable Font

I was trying to add a white colored box to some of my masters in my variable font. How can I change the color of the box to white while keeping the Letters black?

What do you mean by colour? Are you working with a colour font? Or are you just taking about subtracting from a path? Try changing the path direction of the path you want to act as a mask.

If you really need a white shape (instead of removing a part of the black shapes), you need to set up a color font. Check the tutorial page for details.

I have made a variable font with 4 Masters. I wanted to add an axis to crop the bottom half of the letters (as in the gif), but I figured it would be easier and cleaner if a white rectangle shape would rise and descend.

(The font will only be displayed black on white background) So I copied all 4 masters and started adding the rectangle to all of the 4 copied masters. Now I can’t figure out how to keep the black Lettershape while giving the rectangle a white color.

This is the effect I want to achieve but with an axis in a variable font:

I hope this explains my problem :slight_smile:

So you want a white box to slide up and cover the outlines underneath it?

This might be best solved with a higher-level technology like CSS on the Web.

Otherwise, you could add a white box to each glyph (using COLR/CPAL), make it low and place it below the glyph outlines. Then, in a second master, grow the white box upwards to cover the glyph outlines, for each glyph. Add an axis between the two masters.

Again, this is probably best solved outside the font.