Fonts
-
If I use a font installed on my machine in HISE will it be embedded with the final exported plugin or will it default to a different font on the user's machine?
-
Yes. If you load it using
Engine.loadFont()
it will be embedded into the plugin. -
Excellent!
-
That right there is worth the price of entry.....
-
BTW, you'll need to give it a .ttf file that resides in your
Images
subfolder. -
Has there been a change in the way fonts are loaded recently? I noticed that font style isn't being applied any more with a particular font.
-
No I haven't touched this code since ages. Can you upload an example project that shows this behaviour?
-
Well I just created a little test project to demonstrate the problem to you and typically the problem doesn't happen - so I guess it must be something else in my project that's causing the issue :-) fun!
-
Can someone explain Engine.loadFontAs(String fileName, String fontId)
I assume the font name needs to be in quotes. do you need to include the file path, or just the name? Whats the fontID? -
@dustbro
Engine.loadFontAs("{PROJECT_FOLDER}bahnschrift.ttf", "bahnschrift");
-
@dustbro Font ID is a name you can give to the font that you should then use throughout your project (instead of using the font's actual name). Christoph implemented this to prevent issues with font handling between different OS.
You should put your fonts in your project's Images folder. I usually put them in sub-folder called Fonts.
Using Lindon's example I would the write
Engine.loadFontAs("{PROJECT_FOLDER}Fonts/bahnschrift.ttf", "bahnschrift");
-
You should put your fonts in your projects Images folder.
Yes, definitely put them there, otherwise it won't be embedded in the binary and will use a fallback font on the end users machine, which defaults to Comic Sans MS.
-
…which defaults to Comic Sans MS.
-
@ustk yeah really ulgy (yep ugly spelt wrong..)