# Is there a trick to getting .otf fonts to work?

**URL:** <https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277>\
**Category:** Coding Questions\
**Created:** [December 15, 2020, 8:04pm UTC](https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277 "2020-12-15T20:04:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CaseyJ](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/caseyj/32/15118_2.png) [@CaseyJ](https://discourse.processing.org/u/CaseyJ)\
**Post date:** [December 15, 2020, 8:04pm UTC](https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277/1 "2020-12-15T20:04:39Z")

</div>

Hello,

Working on a project using the “Bookmania” font. It is an .otf font and I am on Windows 10 using Processing 3. For whatever reason it works fine on Mac OSX…

[https://allbestfonts.com/bookmania/](https://allbestfonts.com/bookmania/)

When I run the code to printArray all of the fonts it is listed as “Bookmania-Regular”. However, when I run it the terminal says it is not found and will use another instead.

Is this to be expected?

I even included the file in the data folder.

Any work arounds here?

Thank you for any tips!

/////

PFont myFont;

void setup() {  
size(200, 200);  
// Uncomment the following two lines to see the available fonts  
//String[] fontList = PFont.list();  
//printArray(fontList);  
myFont = createFont(“Bookmania-Regular”, 32);  
textFont(myFont);  
textAlign(CENTER, CENTER);  
text("!@#$%", width/2, height/2);  
}

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [December 15, 2020, 8:11pm UTC](https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277/2 "2020-12-15T20:11:57Z")

</div>

Have you tried to load the font from the data sub-directory, using the full filename? Like this:

`myFont = createFont("font_name.otf", 32);`

---

<div class="post-metadata">

**Author:** ![CaseyJ](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/caseyj/32/15118_2.png) [@CaseyJ](https://discourse.processing.org/u/CaseyJ)\
**Post date:** [December 16, 2020, 12:22am UTC](https://discourse.processing.org/t/is-there-a-trick-to-getting-otf-fonts-to-work/26277/3 "2020-12-16T00:22:54Z")

</div>

Great hunch that totally worked you are my hero!

To be sure I had typed it as “Bookmania Regular.otf” and that worked.

When I do the printArray of all the fonts it comes up as “Bookmania-Regular” … note the hyphen. I had to be sure to drag it into the sketch AND specify the .otf.

Works great now I thank you very much!
