Patrefans
Workbench from patreon
Workbench patreon

Tutorial 209: Font Weights

🕑 Added 2020-08-25 15:34:59 +0000 UTC
Tutorial 209: Font Weights

Comments

Workbench

You're welcome!

Thibaut Cordenier

Thanks for the suggestion, I didn't know this one.

Workbench

Check out Fontself if you decided to try it. https://www.fontself.com

Thibaut Cordenier

I definitively need to try this one :)

Workbench

Yeah, agreed. There is one way you could make this work, but you'd have to build a custom font. You'd basically put alternate weights/styles of the font in the same font as some of the special characters, so you could use a text animator to add like 100 to the character value and switch from regular to bold for example. On the plus side, as you said, you usually figure out other interesting things when you experiment. It's never wasted time.

Thibaut Cordenier

Thanks ! Damn, I should have red that description, would not have spent several hours on that... though I learnt some stuffs on the way. Anyway, it would have been awesome to simplify and automate a lot of text animation that way.

Workbench

I'd like to be able to do that too, but—and I guess I didn't explain it so well, I must've just hinted at it in the description—but createStyle() only works on the entire text. Unfortunately you can't treat it like a bunch of text objects and put them together. They didn't give us full access for some reason, probably because it connects to some ancient code that they didn't want to deal with. It'd be amazing if they even had a text animator property for font styles.

Thibaut Cordenier

Hey Joe, I need your help ! I'd like to combine ideas from tutorials 209 et 206, i.e using regex to select words from a text and then applying diverse animators (mostly colors fills and blur), changing their colors and switch their font from regular to bold, but only on these words. So far I've only reach the first part because if "createStyle().setFont("Aileron-Heavy")" works on the sourceText it doesn't in the expression selector... I try to change the if/else and try a forEach loop but I must have used the wrong methods in the wrong place... I'm fairly new to JS quirks. var weights = ['Thin','Light','Light Italic','Regular','Bold','Black','Heavy']; var RE = /(LIVRE|MONDE|VALENTIN|RACONTE|POLICE|FAITES|INSULTES)/gi; txt = text.sourceText.replace(RE, function($0) { return '~'.repeat($0.length); ; });

Workbench

Yep! That was early R&D for this tutorial.

Thibaut Cordenier

So it's the explanation of what was part of the June or July Elements file ?


More Creators