Skip to content
Carlo Barazzetta edited this page Sep 5, 2020 · 18 revisions

FAQ - Tips and tricks

Q. The components are free to use?

A. Yes, they are completely free of use, under Apache license version 2.0.


Q. Why do I need to use IconFontsImageCollection to develop High-DPI app?

A. Because you can centralize the collection of the Icons in a single place (generally a Datamodule). Then you can use a TIconFontsVirtualImageList or the best choice of TVirtualImageList (available from D10.3) on every Form you need the Icons. TIconFontImageList remains only for backward compatibility or if you are building a single form application.


Q. The MaterialDesignIcons font used in the demos is free to use?

A. Yes, it's completely free of use, under Apache license version 2.0: download it from here: https://github.com/Templarian/MaterialDesign-Font.

Notice that The ttf files is released periodically, so we periodically align the unit Icons.MaterialDesign.pas that contains a mapping for codepoint and Name of the Icons.

You can find more Icon Fonts free to use in the web.


Q. Which Delphi version is supported?

A. The VCL components works from Delphi 7 to current version. The FMX component works from Delphi 10.1 to current. For some Delphi versions you there isn't the specific package in the repo, but you can start with a package of a similar Delphi version. You can also try to recompile FMX version with early versions of Delphi: we provide only packages from Delphi 10.1.

For non-unicode Delphi version (Like Delphi 7) you cannot use characters with "surrogate pairs".


Q. At run-time, do I need the Font(s) installed on the system?

A. For FMX alway yes. For VCL Windows it depends: you can Install them during deploy of the application or load the Fonts responding to the Event Handler OnFontMissing of the IconFontsImageCollection or IconFontsImageList: you can find an example into the Demo App.


Q. Can I mix different Icon Fonts in the same ImageList?

A. Yes, both in the VCL and FMX versions you can define at component level the default font (and color) you want to use for every icons or you can specify the font name and the icon color on a specific item, look at this image that shows the VCL component Editor:

https://github.com/EtheaDev/IconFontsImageList/blob/master/Demo/Images/MixedFonts.jpg

You can also do it in the FMX component Editor:

https://github.com/EtheaDev/IconFontsImageList/blob/master/Demo/Images/ImageEditorFMX.jpg

Q. Can I resize the icons at run-time?

A. Yes, it is very simple: in the VCL version you need only one line of code:

IconFontsVirtualImageList.Size := Value;
IconFontsImageList.Size := Value;

The imagelist redraw all the Icons with perfect rescaling!

If you are building an High-DPI enabled application, the components resize itself according to the Form where it is placed.

https://github.com/EtheaDev/IconFontsImageList/blob/master/Demo/Images/DemoChangeSize.gif

A. In the FMX you don't need to write nothing: if you are using the AutoSizeBitmap property the ImageList produces scaled bitmap required by the GUI for every component that uses it.

Q. Can I change color of icons according to the active VCL Style at runtime?

A. Yes, it is very simple: you need only one line of code:

UpdateIconFontsColorByStyle(IconFontsImageCollection);
UpdateIconFontsColorByStyle(IconFontsImageList);

The imagelist redraw all the Icons with a color "compatible" with the active VCLStyle!

https://github.com/EtheaDev/IconFontsImageList/blob/master/Demo/Images/DemoChangeStyle.gif

Q. The component uses GDI+ for rendering the icons?

A. Yes, if you are using a Delphi version from XE4 to actual the icons are rendered with GDI+: look at the differences: https://github.com/EtheaDev/IconFontsImageList/blob/master/Demo/Images/GDI+compare.png

Clone this wiki locally