FontLoader: Load Entire Family Font Files
How can i load 4 font files with the same font type name?
I have trebuchet.ttf, trebucheti.ttf, trebuchetb.ttf and trebuchetbi.ttf and all of them have “Trebuchet MS” as their font type name.
When i use FontLoader i initially test if the font has been loaded before so it doesn’t end up failing:
- FontLoader{
- id: trebuchet
- }
- Component.onCompleted:{
- if (families.match(/Trebuchet MS/i)) {
- trebuchet.name = "Trebuchet MS";
- } else {
- trebuchet.source = "fonts/trebuchet.ttf";
- }
- }
The problem is that they all use “Trebuchet MS” as their font type name, and that will end up making all fontloaders pointing to the default Trebuchet MS.
0 replies
You must log in to post a reply. Not a member yet? Register here!
