Ifdef feature code not working

Per the Switching Shapes tutorial, I’ve set up my rlig feature with this code.

# ifdef VARIABLE

condition 105 < wght;
sub dollar by dollar.bold;
sub baht by baht.bold;
sub cent by cent.bold;
sub dollar.tf by dollar.bold.tf;
sub baht.tf by baht.bold.tf;
sub cent.tf by cent.bold.tf;
sub dollar.osf by dollar.bold.osf;
sub baht.osf by baht.bold.osf;
sub cent.osf by cent.bold.osf;
sub dollar.tosf by dollar.bold.tosf;
sub baht.tosf by baht.bold.tosf;
sub cent.tosf by cent.bold.tosf;
sub oslash by oslash.bold;
sub Oslash by Oslash.bold;
# endif

The font exports as a variable font fine, and as .otf instances it works if this feature is marked as inactive, but when active I get errors about glyphs not found. So it seems like the “ifdef VARIABLE” condition isn’t getting properly tested.

Try it with #ifdef VARIABLE and #endif without a space after the #. The tutorial might need a correction for that, but I’d have to double check the code. /cc @mekkablue

1 Like

That works, thanks!

Updating the tutorial. Thanks for the feedback.

1 Like