Custom vector fonts

Hi,

from what I understand, CIQ only supports custom bitmap fonts, not vector fonts. Is that correct, or am I missing something?

My use case is that I’d like to include a larger set of icons in the app, ideally scaling with different font sizes. It would be great to load a single custom vector font and render it at the required size instead of generating multiple bitmap variants.

  • Correct, there is no support for custom vector fonts Disappointed

  • Is the issue about managing the generation of all font-size-specific bitmaps? or more about memory constraints of adding more bitmaps?

  • By and large, it is mostly about generating the bitmaps. In this app, I now only support newer-generation devices, so memory should be fine.

    Basically, my app uses four font sizes, chosen dynamically based on the amount of content that needs to be displayed. Right now, I have a JSON file that defines the corresponding four icon sizes for each device type, and a script that generates the icons based on that JSON.

    For devices that support vector fonts, I use them to get a more even spread of font sizes than with the default fonts. For each new device I support, I still have to figure out the font sizes and add them to my JSON.

    Having a vector font with my icons would make that whole process much easier. I would no longer need device-specific handling, and the code could simply draw the icon at the required size. On devices that support vector fonts, I would not even be limited to the four predefined sizes anymore, but could choose the font size freely.

  • One thing that came to mind; if you're only supporting newer-gen devices, does that give you access to drawBitmap2 where you can scale an icon bitmap down?

    More generally, I'd argue that you probably do want a few discrete steps in size, since it might feel odd for each UI view to have a custom text scaling based on its content.

  • One thing that came to mind; if you're only supporting newer-gen devices, does that give you access to drawBitmap2 where you can scale an icon bitmap down?

    Yes, I thought about bitmap scaling too. I was a bit worried about the visual quality of the result, especially regarding anti-aliasing. Performance is also a concern, although vector fonts are not exactly great in that regard either. I guess I’ll have to give it a shot to find out if it’s a viable option.