Add bold to a single word inside a text description

Hi All, I have a question in p5js. How to change only one word that is included in a hole text displayed as information? using textStyle(BOLD); change the hole document. Do I have to iterate word by word? thanks for the help David

Answers

  • That's a hairy problem to solve. Guess you're better off asking it in their own repo: :|
    https://GitHub.com/processing/p5.js/issues

  • edited April 2016 Answer ✓

    Actually the solution was createP(document); it can change only one word to bold the word

  • Answer ✓

    @Dazzid: in which case your question was not adequately clear (some code would have helped). The impression was that you wanted to style text being added to the canvas element - which is in fact non-trivial. Styling HTML elements on the other hand is trivial and, as you've discovered, simply a matter of wrapping the targeted text in an appropriate tag. In this case the <strong> tag would be most appropriate...

  • edited April 2016

    @blindfish you right, at first glance I was trying to style text being part of p5 drawing text(myText,0,0); but now I do quite the same but using HTML. Thanks for the support

Sign In or Register to comment.