fonts.xml BUILD: ERROR: "charset=" is not a valid key/value pair.

Hello. I am new to garmin IQ and I am coding on a macOS 10.12.1 and got Eclipse Neon up and running with the 2.2 build and have successfully created a new Garmin IQ project and executed it through the simulator! Yay!

I now want to load a custom font and using this youtube and website I can follow what needs to be done and have fnt and png files.
https://www.youtube.com/watch?v=PRQyA4BeqqE
http://kvazars.com/littera/

However when I go to create the folder 'fonts' and then the file fonts.xml i come across the error.

I can run the code successfully with this xml code:
<fonts>
<font id="customFont"></font></fonts>

I know it is missing filename but it runs. Once I change it to the following:
<fonts>
<font id="customFont" filename="customFont.fnt"></font></fonts>

I now get the following error:
BUILD: /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar /Users/ben/Documents/connectiq-sdk-mac-2.2.1/bin/monkeybrains.jar -o /Users/ben/Documents/workspace/TimeSlideDos/bin/TimeSlideDos.prg -w -y /Users/ben/Documents/developer_key -z /Users/ben/Documents/workspace/TimeSlideDos/resources/drawables/drawables.xml:/Users/ben/Documents/workspace/TimeSlideDos/resources/fonts/fonts.xml:/Users/ben/Documents/workspace/TimeSlideDos/resources/layouts/layout.xml:/Users/ben/Documents/workspace/TimeSlideDos/resources/strings/strings.xml -m /Users/ben/Documents/workspace/TimeSlideDos/manifest.xml /Users/ben/Documents/workspace/TimeSlideDos/source/TimeSlideDosView.mc /Users/ben/Documents/workspace/TimeSlideDos/source/TimeSlideDosApp.mc
BUILD: ERROR: "charset=" is not a valid key/value pair.
BUILD: Complete

So without filename set I can run with warning that I am missing filename, with filename I get an odd charset error?

Any ideas is greatly appreciated!

Thank you,
Ben
  • I would suggest you to publish source files you use to investigate further.

    For example, I created these fonts to test Cyrillic part and my font converter.
    You can use these by adding to resources folder and then refresh project directory.
    fontTiny = Ui.loadResource(Rez.Fonts.id_font42r);
    fontSmall = Ui.loadResource(Rez.Fonts.id_font43r);


    Header in .fnt file should be correct. Charset means the codepage you use. I tested and found Garmin CIQ SDK can accept different scaleH/scaleW values, so 256 is not a dogma. It's just how image represented by converters.

    info face="font043r" size=7 bold=0 italic=0 charset="cp1251" unicode=0 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=1,1 outline=0
    common lineHeight=9 base=8 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=0 redChnl=3 greenChnl=3 blueChnl=3
    page id=0 file="font043r.png"
    chars count=224
  • Thank You!

    Thank you!! I was able to look through your .fnt file and found the issue:

    Here was my original .fnt file:
    info face=customFont size=72 bold=0 italic=0 charset= unicode= stretchH=100 lineHeight=89.57

    Here is fixed version that works in simulator:
    info face=customFont size=72 bold=0 italic=0 charset=0 unicode=0 stretchH=100 lineHeight=90

    One other issue I had was the lineHeight had decimals and eclipse did not like that so I reran the fnt & png files and luckily got whole integer numbers and simulator works great!

    Thank you!!