I just got a new set of TTF fonts from our graphic designers. I'm trying to register them with CodenameOne doing something like:
This results in my getting a "Font name not found" exception. The font file is located in root of my source tree.
The full stack trace for the exception is shown below. Now the graphic designers are Mac guys, but I assume a true-type font is a true type font regardless of platform. On the creation of the font, does the CodenameOne code look inside to file to see whether the font names match?
java.awt.FontFormatException: Font name not found
at sun.font.TrueTypeFont.init(TrueTypeFont.java:562)
at sun.font.TrueTypeFont.<init>(TrueTypeFont.java:191)
at sun.font.CFontManager.createFont2D(CFontManager.java:157)
at java.awt.Font.<init>(Font.java:614)
at java.awt.Font.createFont(Font.java:939)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:3247)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:201)
at org.techna.cip.AppContext.init(AppContext.java:44)
at org.techna.cip.CIPApp.init(CIPApp.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.codename1.impl.javase.Executor$1.run(Executor.java:70)
at com.codename1.ui.Display.processSerialCalls(Display.java:1051)
at com.codename1.ui.Display.mainEDTLoop(Display.java:871)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:119)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.codename1.impl.javase.Executor$1.run(Executor.java:70)
at com.codename1.ui.Display.processSerialCalls(Display.java:1051)
at com.codename1.ui.Display.mainEDTLoop(Display.java:871)
at com.codename1.ui.RunnableWrapper.run(RunnableWrapper.java:119)
at com.codename1.impl.CodenameOneThread.run(CodenameOneThread.java:176)
Caused by: java.lang.RuntimeException: java.awt.FontFormatException: Font name not found
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:3257)
at com.codename1.ui.Font.createTrueTypeFont(Font.java:201)
at org.techna.cip.AppContext.init(AppContext.java:44)
at org.techna.cip.CIPApp.init(CIPApp.java:28)
... 9 more
Caused by: java.awt.FontFormatException: Font name not found
at sun.font.TrueTypeFont.init(TrueTypeFont.java:562)
at sun.font.TrueTypeFont.<init>(TrueTypeFont.java:191)
at sun.font.CFontManager.createFont2D(CFontManager.java:157)
at java.awt.Font.<init>(Font.java:614)
at java.awt.Font.createFont(Font.java:939)
at com.codename1.impl.javase.JavaSEPort.loadTrueTypeFont(JavaSEPort.java:3247)
... 12 more