The TFontImageList is a Lazarus component that store glyphs/images used by graphic controls. The component generates its own images using an installed font.
It work just like a TImageList but using code point
of installed font on development computer. The images are built in design-time
and dont require the font installed on deployment. So you dont need redistribute the font with your software or access the internet to get it.
Some fonts are made for this purpose and we take advantage of this for generate a monochrome glyphs/images like websites and mobile apps does.
Just in the case you dont know what we are talking about you must read at Code point.
Some recommended fonts with a lot of icons for use, find out the code point
of the icon, never the icon name
.
- The limitation is one font for each TFontImageList component, using the same color and size for all icons of it.
- You need to know if the font size you choose fit inside the image list sizes width/height. The componente does not stretch or calc anything for you. Some adjusts are possible inside the images using XOffset and YOffset property options for all icons.
There is two packages availables, use them according your needs. Do not install both, only one is allowed at time.
- FontImageListBGRABitmap: This package uses the third party softwares for generate a transparent background with high quality for all platforms, and colored as well. Users usually require transparent background to use with native control background, so its very recommended. See the https://bgrabitmap.github.io/
- FontImageListLCL: This package uses the canvas to generate the images. Its not very accurated for transparent background, but generates the perfect colored background. When you only need the images with colored background this is a perfect choice.
- The packages must install the component TFontImageList for the
Misc
pallete. - The compile definition
FONTIMGLIST_FORCE_RUNTIME_BUILD_ICONS
must be defined if you want to generate images at run-time after changeCodepoints
property. This case you must have the font installed on running computer.
-
Find out the desired codepoints for build the images. Usually the font owners provides a way or a list of them. They also can be found using a simple charmap program.
-
Put the TFontImageList on TForm/TFrame/TDataModule, change the
Width
and theHeight
with the required image geometry. -
Go to
Options
property(TFontImageListOptions) if you want the colored background or keep theclNone
for transparent background. -
Go To
FontSource
property for choose the font/color/height of your images. The font must be already installed at this moment. -
Go to
Codepoints
property and write the codepoints of images. For each line only one codepoint is written and must be like:e88a
or$e88a
. -
Every time you change the
Codepoints
property at design-time then all images of list is generated. Dont forget revisit this property after change some other property. -
Its all, enjoy.
© 2025 Humberto Teófilo, All Rights Reserved.
This software is released under Modified LGPL(with linking exception, same of LCL). This is a free software, inclusive for commercial use and modifications under the license terms. See the file license.txt
.