Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I change the font attributes, like the color, for a single text face without affecting all of them?

color Face font text
0
10 Posted

How do I change the font attributes, like the color, for a single text face without affecting all of them?

0

To change the font attributes, create a new font object, then set the field of the face you want to change. You can use the same FONT object for as many FACES as you need. Here is an example that changes the font for a line of text: out: layout [ style button button 200 ;wide buttons by default tf1: text 200×30 “This is a field of text” button “Make it Red” [ tf1/font: red-font show tf1 ] button “Make it Bold and Navy” [ tf1/font: navy-font show tf1 ] button “Make it Large” [ tf1/font: large-font show tf1 ] button “Show font fields” [ probe red-font ] ] red-font: make tf1/font [ color: red style: none ] navy-font: make tf1/font [ color: navy style: ‘bold ] large-font: make tf1/font [ size: 18 ] view out Above, the font attribute objects are inherited from above TF1 default font. Of course, this can also be done dynamically within the button code above. But the static method is more efficient, if you have the same attributes each time.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123