Is there a way to look into the fonts?

Is there a way to "look" into the fonts? Either by reading the cft files in the SDK (listing their content about which characters it contains, the size of the characters, etc) or by displaying them (and I hope you won't tell me to look at them by displaying text in the devices in the simulator)

Also: how much the cft fonts used by the simulator can be "trusted" to make decisions regarding the real devices' fonts?

  • Posted 2 issues in github:

    https://github.com/markw65/monkeyc-optimizer/issues/2 new devices don't output fonts as the old ones,

    https://github.com/markw65/monkeyc-optimizer/issues/3 some devices are missing some of the fonts

  • There is a way to generate a font for emulator from TTF? Anyway what kind of type is this? Google was NOT my friend Slight smile

  • No, I mean generate font for the emulator. Because the font size in the emulator is not fit the size in the device (explore2).

    I made a test, a THAI_HOT font must be 80px said the documentation. It is fit in the emulator but in the device is smaller. So we need a resized font for the emulator to make them correct. The precompiled fonts is not good.

  • If you find a difference (say more than a pixel or two) file a bug report in the bug report forum.  Be sure you mention the specific device.  Note, that even if two different devices have the same screen resolution, that doesn't mean the fonts are the same.

  • Believe me, the CIQ team would love to do that, if it was that easy. As far as I understood from earlier forum replies they can't do that, I don't know for what reason (technical or legal) and that is why the simulator has different fonts for some (probably older?) devices. I use a tool from https://github.com/markw65/monkeyc-optimizer to extract font related info from the devices data, but that "broke" since new devices have ttf fonts.

  • I updated now the monkeyc-optimizer from 1.1.44 to the latest (1.1.87) and it broke my scripts, because the output of cft-font-info changed from:

    {"fonts":{"font1":{...},"font2":{...},...}}

    to:

    {"font1":{...},"font2":{...},...}

    Is this intentional? Is there a way (like passing a parameter to cft-font-info) to keep the old format or do I need to adjust my scripts?

  • Check this photo. All font got a grey background to see the real font size.

    First 0 is a pixel font, 80px, I made it. Around that a rectangle 80px. Next a NUMBER_THAI_HOT than a SYSTEM_NUMBER_THAI_HOT. As you can see on the monitor both have a same height in emulator.

    Then see on my device the very same datafield, the two font is smaller than the pixel font and the rectangle. So the emulator font is 80px high the device font is smaller. In my opinion it means the emulator and the documentation is wrong. So if I can make a slighly smaller font in the emulator, I get the same like in the device, so I can start to design the frontend.

    docs for explore2

  • I am familiar with this (and other) problems that make the simulator not very useful to design pixel-perfect look on the real device. I agree it's bad, and it would be very good if Garmin could fix it. I don't think you will be able to do it, especially because it looks like even Garmin are not able to. In order to be able to do it you would need to be able to extract the exact fonts included in every existing device's firmware (probably different fonts from different part numbers, and maybe even different fonts from different versions of the firmware, if Garmin change them between versions). Let's assume that Garmin don't change the fonts in newer FW versions, or that we only care about the latest for each part number. Even then someone would need to come up with a way to extract the fonts from the physical devices, and compile a comprehensive collection of them. Then someone will come up with a way to convert the extracted fonts to the format that the simulator needs. (My guess is that this is where Garmin has problems) So realistically this won't happen, and even if it will for some devices, those will be the devices that let's say you or a few more devs own and are able to put their hands on, which arguably are the less important devices (since we can test on the physical device) and the more important devices (that we don't own but want to support) are impossible to test in the simulator, because it's gonna be exactly like now: it's your guess whether the simulator shows exactly how it'll look like in the real device.

    So the only feasable way to create an app that looks the way you like is to use custom fonts, because that'll almost look like on the real device.

    There are other things I am not sure of, like when you draw a rectangle, a circle or even just a streight line, which pixels will it occupy, I don't remember already what I found, but at least there are inconsistences between how different devices draw in the simulator (again, it's your guess if they each behave like their respective physical device, or not exactly)

    And then we didn't talk about the pixel shifting yet, and probably a dozen other things that make it impossible to create a pixel perfect look

  • Sorry, I refactored the code to avoid holding the entire output in memory and inadvertently changed this. I didn't notice either, because the one project I have that uses it is also still on a very old version.

    I should fix it, because now "devices" is mixed in with all the fonts.