Write text in bold

edited November 2013 in How To...

Hi everyone.

I need to write text in bold on the screen of my computer, but I don´t know how.

If anyone can help, thanks in advance.

Answers

  • Answer ✓
    String[] fontList = PFont.list();
    println(fontList);
    

    does this list any bold fonts?

  • Answer ✓

    mine does (linux):

    [1] "Arial"
    [2] "Arial Black"
    [3] "Arial Bold"
    [4] "Arial Bold Italic"
    [5] "Arial Italic"
    [6] "Bitstream Charter"
    [7] "Bitstream Charter Bold"
    [8] "Bitstream Charter Bold Italic"
    [9] "Bitstream Charter Italic"
    [10] "Century Schoolbook L Bold"
    [11] "Century Schoolbook L Bold Italic"
    [12] "Century Schoolbook L Italic"
    [13] "Century Schoolbook L Roman"
    ...
    

    just use createFont with one of those.

  • Mine too - also on Linux (Mint 15) p. 2.0.3

  • Answer ✓

    there are caveats - if you're exporting for other systems (either other operating systems or just other pcs) you have to be careful about choosing a font that'll exist over there, so don't pick anything too esoteric.

    the other alternative is converting a bold font to .vlw format (there's a tool for this), putting that in the data folder and using loadFont(). see reference for examples.

  • Thanks for the help. I've already managed to put text in bold.

    PFont Font1;
    void setup() {
      Font1 = createFont("Arial Bold", 18);
    }
    void draw() 
    {
    textFont(Font1);
     text("Hi", 10, 30);
    }
    
Sign In or Register to comment.