664 views
in GUI Development by

Hello

Is it possible to change the fontsize of a Font-Resource  during runtime? 

I think about something like this in a function so i can change valueX with e.g. a slider:

MyResources::MyFont.Height = valueX; // valueX is the desired fontsize

// or something like this:

Editor.FontSize = valueX;

Can I do it like this or do I have to define several Font-Resources with the desired height and change between them?

 

Thank you in advance

Regards Michi

1 Answer

+1 vote
by

Hello Michi,

you need several fonts with individual sizes and switch between the fonts dynamically. When generating code, Embedded Wizard converts all involved fonts in small bitmaps according to the specified font height. These bitmaps can't change at the runtime. This approach is optimized for Embedded Systems with managable amount of fonts, glyphs and sizes.

For sophisticated cases, if you have many fonts, many glyphs and many sizes, it can be reasonable to raster the fonts dynamically at the runtime. This expects your application to additionally include a TrueType font engine and all needed TrueType font files. This is usually an overkill for small Embedded Systems. Anyway, this approach is possible and we provide dedicated Platform Packages to allow our customers to integrate the extern TrueType font engine and raster the glyphs dynamically.

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard - Archive

Welcome to the Ask Embedded Wizard archive. This community forum served us well for many years, but we've evolved our support approach!

Your resources:

The Embedded Wizard Online Documentation provides comprehensive documentation, tutorials, examples and ready-to-use software packages.

For dedicated assistance, explore our Embedded Wizard Product Support.

You can still browse the valuable discussions from our community history here.

Embedded Wizard Website | Privacy Policy | Imprint

...