Author Topic: LazFontAwesome icons  (Read 507 times)

Dibo

  • Hero Member
  • *****
  • Posts: 1076
LazFontAwesome icons
« on: November 03, 2026, 08:17:28 pm »
I'm a big fan of FontAwesome from a years. Always had to use a scalled PNG files in Lazarus projects. Inspired by QtAwesome which I use in my C++ projects, made LazFontAwesome helper:
Pure Lazarus. Rendering uses only LCL classes and LazFreeType, which ships with Lazarus. There is no libfreetype, no DLL or .so, and no other external library.
All widgetsets. Works on Qt (KDE), GTK (GNOME) and Windows.
Colors. By default it is using system color (clBtnText) to adaptive for light and dark theme. But you can use whatever color you want.
Single executable. The Free fonts are compiled into the program as resources, so there are no font files to deploy next to your .exe. Only the style you use is linked: Solid is included by default, and Regular and Brands are added by putting one unit in your uses clause.
Typed icon names. Every icon is an enum value named after its Font Awesome name: folder-open is fas_folder_open. You get code completion and compile-time checking, and no Unicode code points to look up.
Sharp at every size. Icons are rendered from vector outlines, so 16, 24, 32 or 256 px are all crisp, which also suits HiDPI and multi-resolution TImageLists.
Low memory. Nothing is pre-rendered. A font is parsed on first use (about 1 MB for all three styles), and you only keep the bitmaps you create.

Does anyone know how to publish LPK package in Lazarus Online Package Manager? Wiki is still down and can't find information

More details and download:
https://github.com/dibok/LazFontAwesome
LazFontAwesome - modern icons in your app
https://github.com/dibok/LazFontAwesome
PasFLTK - binding for lightweight GUI framework
https://github.com/dibok/PasFLTK

paweld

  • Hero Member
  • *****
  • Posts: 1799
Re: LazFontAwesome icons
« Reply #1 on: November 03, 2026, 08:49:29 pm »
Looks great.

Quote from: Dibo
Does anyone know how to publish LPK package in Lazarus Online Package Manager? Wiki is still down and can't find information
Prepare the OPM package files (*.json and *.zip), and then send an email to: opm@lazarus-ide.org

To prepare the package, you need to enable developer mode (maintainer mode - or something similar; I'm writing this from my phone and don't remember the exact name of this option) in the OPM settings
Best regards / Pozdrawiam
paweld

Dibo

  • Hero Member
  • *****
  • Posts: 1076
Re: LazFontAwesome icons
« Reply #2 on: November 03, 2026, 09:57:06 pm »
Thanks. Sent via email.
Noticed also "Submit" button but it failed to send zipped package. Maybe due to wiki down? (related server)
LazFontAwesome - modern icons in your app
https://github.com/dibok/LazFontAwesome
PasFLTK - binding for lightweight GUI framework
https://github.com/dibok/PasFLTK

wp

  • Hero Member
  • *****
  • Posts: 13708
Re: LazFontAwesome icons
« Reply #3 on: November 03, 2026, 11:18:52 pm »
I am a bit confused: Your code comes with MIT license, fine. But the icons themselves? Following your link to "Font Awsome Free" as you call it, I first see a "Plans starting at 4$/mo." Free? After searching for a while (scrolling down the "plans" page) I found a mention of "Free". And finally after some more searching I found the license: https://fontawesome.com/license/free - yes, it is free, but the project owner must give appropriate credit in the project (CC BY 4.0 License) - this information should be mentioned somewhere on your github and in the package, otherwise you might seduce people to violate licenses...

I registered and downloaded the free icon set. Still confused: there are only svg file, no font as you mention in the initial post...

paweld

  • Hero Member
  • *****
  • Posts: 1799
Re: LazFontAwesome icons
« Reply #4 on: November 04, 2026, 06:54:14 am »
@wp: on the Font Awesome download page: https://fontawesome.com/download you’ll find the "Free" version, then you need to select the “desktop” option - the archive contains font files covered by a different (more liberal) license: SIL OFL 1.1 license.
This component uses this font, rather than the SVG icons licensed under CC BY 4.0.

Best regards / Pozdrawiam
paweld

Dibo

  • Hero Member
  • *****
  • Posts: 1076
Re: LazFontAwesome icons
« Reply #5 on: November 04, 2026, 08:25:27 pm »
Does anyone have the ability to test it on Gtk3 with current Lazarus 5 release candidate? I got info from OPM that on GTK3, the TBitBtn + TImageList is not scalling. TImageList has "resolutions" mechanism which pickup correct image size depending on DPI. "fademo" from LazFontAwesome package has four resolutions in TImageList: 16px. 24px, 32px and 48px. Bitbtns have equivalent values in TBitBtn.ImageWidth. It works on my enviromnents with Windows, Qt and Gtk2 in Lazarus 4.8 but seems that there is a bug with Gtk3. I'm not able for now quickly prepare test enviromnent for Lazarus 5 and it would be great if this bug could be fixed in upcoming Lazarus 5
LazFontAwesome - modern icons in your app
https://github.com/dibok/LazFontAwesome
PasFLTK - binding for lightweight GUI framework
https://github.com/dibok/PasFLTK

paweld

  • Hero Member
  • *****
  • Posts: 1799
Re: LazFontAwesome icons
« Reply #6 on: November 04, 2026, 09:01:54 pm »
In fact, TBitBtn doesn't work properly in GTK3 (it doesn't scale) - but this appears to be a bug with TBitBtn, since TSpeedButton works correctly (after switching to TImageList).

Lazarus trunk + FPC 3.2-fixes
Best regards / Pozdrawiam
paweld

zeljko

  • Hero Member
  • *****
  • Posts: 2038
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: LazFontAwesome icons
« Reply #7 on: November 04, 2026, 09:33:51 pm »
Pls open an issue against lcl-gtk3 and attach example project, so it get fixed before 5.0 is out.

paweld

  • Hero Member
  • *****
  • Posts: 1799
Best regards / Pozdrawiam
paweld

Dibo

  • Hero Member
  • *****
  • Posts: 1076
Re: LazFontAwesome icons
« Reply #9 on: November 05, 2026, 07:24:30 am »
Thanks @paweld for helping with that!
LazFontAwesome - modern icons in your app
https://github.com/dibok/LazFontAwesome
PasFLTK - binding for lightweight GUI framework
https://github.com/dibok/PasFLTK

 

TinyPortal © 2005-2018