How to include fonts in exported application

edited May 2016 in Python Mode

In my program I’m using a few different fonts in one typeface (Roboto Regular, Roboto Medium, Roboto Italic, Roboto Bold Italic), but when I export it as an application, it displays everything as just one font (Roboto Regular). Where should I put the other fonts so that they are included in the application when it exports? (Ideally, this would also let other people who don’t have this font installed still see this font.)

Answers

  • I do have it in my data folder, which is what that page says I should do. I’m using Python Mode; might this be contributing to the problem?

  • edited May 2016

    Why don't you post your code so there are more eyes to check out for any possible bugs? :-\"

  • Sure! In setup(), I have

    global font_regular
    global font_italic
    global font_medium
    global font_bold_italic
    font_regular = createFont( 'Roboto-Regular', 15 )
    font_italic = createFont( 'Roboto-Italic', 15 )
    font_medium = createFont( 'Roboto-Medium', 15 )
    font_bold_italic = createFont( 'Roboto-BoldItalic', 15 )
    

    I use these fonts many places in the program, including in some classes. (I’m not posting all the code because it’s really long.)

  • edited May 2016 Answer ✓

    You're using createFont() instead of loadFont(), which I had linked to its reference above! :-@
    Please click at that web reference's link and read the instructions therein. >-)

    Function createFont() assumes the specified font exists in the current running OS though: 8-|
    https://Processing.org/reference/createFont_.html

  • Oh! I’m sorry; I did not notice that. It works now.

Sign In or Register to comment.