Recent

Author Topic: fpGUI Toolkit v2.0.1 has been released  (Read 1328 times)

Graeme

  • Hero Member
  • *****
  • Posts: 1496
    • Graeme on the web
fpGUI Toolkit v2.0.1 has been released
« on: February 11, 2026, 07:43:51 pm »
Hi everyone,

Here is a small bugfix release. Thank you to everyone that tested
and reported bugs. Below is what's changed in this release:

v2.0.1 (2026-02-11)
- Bug Fixes
* Fixed infinite recursion crash when default font fails to load on
distros with non-standard font paths (Arch, Void, Fedora). Raises
a clear EfpGUIException instead. (Fixes #143)
* Added /usr/share/fonts/ as a recursive font search path, covering
all Linux distro font directory layouts. Added ~/.local/share/fonts/
for XDG user fonts.
* Fixed ERangeError in DoDrawImagePart when the image rectangle is
fully clipped out of the visible area. (Fixes #121)
* Fixed Canvas.GetClipRect returning an empty rectangle when no
explicit clip rect was set. (Fixes #113)
* Fixed access violation in timer list when a timer destroys itself
during its own callback, or after Windows hibernation. (Fixes #17)
* Widened TfpgMsgParmUser.Param1/2/3 from Integer to PtrInt for
correct 64-bit window handle passing.
* Added missing extrafpc.cfg in hexviewer example folder.
* Fixed AggPas Win32 font engine compilation and rendering: added
proper ifdef splits for Win32 TrueType vs FreeType font engines,
fixed font size DPI scaling, and removed unnecessary freetype.dll
dependency when using the default Win32 font engine.
- Improvements
* Timer architecture redesign:
- X11 message loop now uses the calculated timeout instead of a
hardcoded 10ms poll, reducing idle CPU wakeups
- GDI message loop replaced blocking GetMessage with
MsgWaitForMultipleObjects, enabling proper timeout support
- Removed redundant native Windows.SetTimer mechanism; timer
checking is now unified through the main loop
- All timer arithmetic switched from wall-clock time (TDateTime/Now)
to monotonic time (GetTickCount64/CLOCK_MONOTONIC), making timers
immune to NTP sync, DST changes, and system hibernation
* Normalized GDI clip rect storage to widget-local coordinates,
matching the X11 and Cocoa backends.
* About fpGUI dialog now shows the canvas backend type (AggPas or
Native) after the version number.
* Added 'freetype' build profile for PasBuild, allowing Windows
users to toggle between the Win32 TrueType and FreeType font
engines via: pasbuild compile -p windows,agg,freetype


https://github.com/graemeg/fpGUI

Previous release: https://forum.lazarus.freepascal.org/index.php/topic,73438.0.html
« Last Edit: February 15, 2026, 09:56:00 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

PierceNg

  • Sr. Member
  • ****
  • Posts: 431
    • SamadhiWeb
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #1 on: February 12, 2026, 09:13:32 am »
Getting font problem on Windows with FreeType.

OS = Windows 11 Home build 26100
FPC = v3.2.2 x86_64-win64, as installed by Lazarus 4.4 installer
freetype.dll = Tested two versions, one bundled with JDK 17, another most recent v2.14.1 built from source on the same machine using VS 2022 CE. The DLL is on my PATH.

Code: Text  [Select][+][-]
  1. c:\src\pascal\fpGUI\pasbuild clean
  2. ...
  3.  
  4. c:\src\pascal\fpGUI\pasbuild compile -p windows,agg,freetype
  5. ...
  6. [INFO] Reactor build complete: 2/2 modules built
  7.  
  8. c:\src\pascal\fpGUI\pasbuild test -p windows,agg,freetype
  9. ...
  10. [INFO] Execute command: .\TestRunner.exe --all --format=plain
  11.  
  12. An unhandled exception occurred at $000000010009E31A:
  13. EfpGUIException: Unable to load default font "Arial-10". Please ensure font files are installed in a standard font directory.
  14.   $000000010009E31A
  15.   $000000010009E28A
  16.   $000000010007BBC0
  17.   $0000000100081D95
  18.   $000000010009AB62
  19.   $000000010009AFD4
  20.   $00000001000ACFF8
  21.   $000000010003AE66
  22.   $000000010003B10E
  23.   $000000010003A898
  24.   $0000000100001F02
  25.   $0000000100001F86
  26.   $00000001000150C0
  27.   $0000000100001EB0
  28.   $00007FF94C48E8D7
  29.   $00007FF94E4AC40C
  30.  
  31.  
  32. [ERROR] Tests failed with exit code: 217
  33. [ERROR] Goal failed: test
  34. [ERROR] Module build failed: fpgui-framework
  35. [INFO] Reactor build complete: 0/2 modules built
  36. [ERROR] Goal failed: reactor-test
  37.  

Running TestRunner.exe at the command prompt gets the same error.

This is a borg standard Windows 11 setup and font files are found in c:\windows\Fonts.

Building without FreeType works, with 10 failures out of 397 tests, mostly in the new Mig stuff.

Roland57

  • Hero Member
  • *****
  • Posts: 588
    • msegui.net
BGRABitmap demo with a Makefile
« Reply #2 on: February 12, 2026, 08:22:06 pm »
I polished an old example of mine, and for fun made a Makefile (for Linux). Compilation and execution successful with fpGUI 2.0.1.

I also tested with success compilation in Lazarus.

It draws a chessboard using Chess Alfonso-X True Type font.

Code: Pascal  [Select][+][-]
  1. procedure DrawChessBoard(bmp: TBGRABitmap);
  2. const
  3.   CHARS: array[0..9]of string = (
  4.     '!""""""""#',
  5.     '$tMvWlVmT%',
  6.     '$OoOoOoOo%',
  7.     '$ + + + +%',
  8.     '$+ +wL + %',
  9.     '$ + Qk+ +%',
  10.     '$+ + + + %',
  11.     '$pPpPpPpP%',
  12.     '$RnBqKbNr%',
  13.     '/(((((((()'
  14.   );

Maybe you will have to copy arial.ttf in the folder. I couldn't include it in attachment.
« Last Edit: February 12, 2026, 08:25:30 pm by Roland57 »
My projects are on Codeberg.

cdbc

  • Hero Member
  • *****
  • Posts: 2687
    • http://www.cdbc.dk
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #3 on: February 13, 2026, 07:40:25 pm »
Helllooooo  ;D
I simply cannot help myself -- got to playing with the new features in fpGUI -- I've got 1 thing to say "ME LIKEY!"
For you guys with fpGUI >= 2.0.0 on your drive -- check this out:
Code: Pascal  [Select][+][-]
  1. program fpgui_mig_Demo;
  2.  
  3. {$mode objfpc}{$H+}
  4.                                    /// for public domain \\\
  5. uses            /// made for your amusement by Benny Christensen a.k.a. cdbc \\\
  6.   classes, sysutils,
  7.   fpg_main, fpg_form, fpg_base, fpg_label, fpg_edit, fpg_button, fpg_panel,
  8.   fpg_mig_cc, fpg_miglayout, fpg_stylemanager, fpg_style_plastic;
  9.   { using the new MIG-layout-manager }
  10. type
  11.   { TMainForm }
  12.   TMainForm = class(TfpgForm)
  13.   private
  14.     lblNavn:  TfpgLabel;
  15.     edtNavn:  TfpgEdit;
  16.     btnGem:   TfpgButton;
  17.     stbInfo: TfpgPanel;
  18.     procedure HandleFormKeyPress(Sender: TObject; var KeyCode: word;
  19.                                  var ShiftState: TShiftState; var Consumed: boolean);
  20.     procedure SetupLayout;
  21.   public
  22.     procedure AfterCreate; override;
  23.   end;
  24.  
  25. procedure TMainForm.AfterCreate;
  26. begin
  27.   inherited AfterCreate;
  28.   Left:= 100; Top:= 100; Width:= 550; Height:= 200;
  29.   WindowTitle := 'MigLayout Demo';
  30.   fpgStyleManager.SetStyle('plastic-dark'); { we'll just make sure :o) }
  31.   { setup components - note we don't have to set X, Y, Width, Height here! }
  32.   lblNavn := TfpgLabel.Create(self);
  33.   lblNavn.Text := 'Dit Navn:';
  34.  
  35.   edtNavn := TfpgEdit.Create(self);
  36.   edtNavn.Text := '';
  37.  
  38.   btnGem := TfpgButton.Create(self);
  39.   btnGem.Text := 'Gem Data';
  40.  
  41.   stbInfo:= TfpgPanel.Create(Self);            { <--- i'm missing a statusbar, }
  42.   stbInfo.Alignment:= taLeftJustify;                { so this'll have to do %) }
  43.   stbInfo.Style:= bsLowered;                            { baby steps \o/\ö/\o/ }
  44.   stbInfo.Text:= '[Ctrl + Q] = Quit';
  45.  
  46.   SetupLayout; { employs the MIG-Layout-manager :o) }
  47.   OnKeyPress:= @HandleFormKeyPress; { convenience with 'Ctrl+Q' to close/quit }
  48. end;
  49.  
  50. procedure TMainForm.HandleFormKeyPress(Sender: TObject; var KeyCode: word;
  51.                                        var ShiftState: TShiftState; var Consumed: boolean);
  52. var ct: boolean;
  53. begin
  54.   ct:= ssCtrl in ShiftState;
  55.   case KeyCode of
  56.     $51: if ct then begin
  57.            Consumed:= true; { <- important }
  58.            Close; { Ctrl + Q ~ fpg_key_q }
  59.          end;
  60.   end;
  61.  
  62. end;
  63.  
  64. procedure TMainForm.SetupLayout;
  65. var layout: TfpgMigLayoutManager;
  66. begin
  67.   { initialize MigLayout }
  68.   layout := TfpgMigLayoutManager.Create;
  69.  
  70.   layout.AddLayoutComponent(lblNavn, TfpgMigCC.Create.Cell(0,0));
  71.  
  72.   { growx = stretch horz }
  73.   layout.AddLayoutComponent(edtNavn, TfpgMigCC.Create.Cell(1,0).GrowX);
  74.  
  75.   layout.AddLayoutComponent(btnGem, TfpgMigCC.Create.Cell(2,0).GapY('20','  ').GapRight('10'));
  76.  
  77.   layout.AddLayoutComponent(stbInfo, TfpgMigCC.Create.Cell(0,1).Width('100').Height('25').AlignY('5').GrowX.DockSouth);
  78.   { activate our layout }
  79.   self.LayoutManager:= layout;
  80. end;
  81.  
  82. begin
  83.   fpgApplication.Initialize;
  84.   { i don't like spaces in cmdline params, so i alias it ;) }
  85.   fpgStyleManager.RegisterClass('plastic-dark',TfpgPlasticDarkStyle);
  86.   with TMainForm.Create(nil) do try
  87.     Show;
  88.     fpgApplication.Run;
  89.   finally Free; end;
  90. end.
In the hope it can amuse others too  8-)
Dang I like fpGUI, thanks Graeme & team =^
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Graeme

  • Hero Member
  • *****
  • Posts: 1496
    • Graeme on the web
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #4 on: February 14, 2026, 12:14:58 am »
Getting font problem on Windows with FreeType.

Thank you for reporting this. It's fixed and in the 'develop' branch. I'm busy creating a new v2.0.2 bugfix release that will contain this fix too.

I'll double check those failing tests right now.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

Graeme

  • Hero Member
  • *****
  • Posts: 1496
    • Graeme on the web
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #5 on: February 14, 2026, 01:14:03 am »
I simply cannot help myself -- got to playing with the new features in fpGUI -- I've got 1 thing to say "ME LIKEY!"

LOL - glad you like it. 

The layout code could be simplified as follows:

Code: Pascal  [Select][+][-]
  1.   stbInfo.Height := 25;  // define a preferred height for StatusBar
  2.  
  3. ...
  4.  
  5. procedure TMainForm.SetupLayout;
  6. var layout: TfpgMigLayoutManager;
  7. begin
  8.   { initialize MigLayout }
  9.   layout := TfpgMigLayoutManager.Create;
  10.   layout.LC.Fill.Debug;                    //   <--  Graeme: This is key
  11.  
  12.   layout.AddLayoutComponent(lblNavn, TfpgMigCC.Create());
  13.  
  14.   { growx = stretch horz }
  15.   layout.AddLayoutComponent(edtNavn, TfpgMigCC.Create().GrowX);
  16.  
  17.   layout.AddLayoutComponent(btnGem, TfpgMigCC.Create());
  18.  
  19.   layout.AddLayoutComponent(stbInfo, TfpgMigCC.Create.DockSouth);
  20.   { activate our layout }
  21.   self.LayoutManager:= layout;
  22. end;
  23.  

The .Fill on the LC (layout constraint) will allow all cells to grow and take up all available space. Meaning it will push your StatusBar (panel) all the way down.

The .Debug is simply so you can visually see how mig calculated the cell sizes and component sizes.

Attached is the results. Without and without the debug rendering. And then in the Dark Plastic theme. :)

« Last Edit: February 14, 2026, 01:19:55 am by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

cdbc

  • Hero Member
  • *****
  • Posts: 2687
    • http://www.cdbc.dk
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #6 on: February 14, 2026, 02:27:42 am »
Wow - way cool mate, thanks  ;)
So I refined the /express-demo/ with your input and attached the second version \ö/  ...Oh and I refined the styles-handling as well (I love your use of interfaces)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

Graeme

  • Hero Member
  • *****
  • Posts: 1496
    • Graeme on the web
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #7 on: February 14, 2026, 04:24:40 pm »
So I refined the /express-demo/ with your input and attached the second version \ö/
Nice.

Now to show how it's done using PasBuild (https://github.com/graemeg/PasBuild).

Notes:
* Project is now structured according to PasBuild's conventions. It uses PasBuild 1.3.0 for the external dependency management feature
* It has a dependency on fpGUI v2.0.3 release
* Even the attached archive was created by PasBuild

Usage (PasBuild only):
* Assumes PasBuild and FPC is installed and globally available on your system
* cd <fpgui> then pasbuild compile -m fpgui-framework -p unix,debug
* Now install fpGUI to local repository:  pasbuild install -m fpgui-framework
* Download and unpack the attached project archive
* change to project directory: cd <mig-test-project>
* Then run pasbuild compile to compile the demo
* target/fpgui-mig-test to execute it.

NOTE: You only need to compile and install fpGUI once, for all future fpGUI based projects.

Usage from Lazarus:
* Assumes fpGUI was compiled & installed with PasBuild
* Open src/main/pascal/Main.pas with Lazarus IDE
* When prompted, select "Simple Program"
* Open "Project → Project Options → Compiler Options → Paths" add ~/.pasbuild/repository/fpgui-framework/2.0.3/x86_64-linux-3.2.2 to "Other Unit Files". Adjust the platform triplet [x86_64-linux-3.2.2] to what's available on your system.
* Compile and Run.

:)
« Last Edit: February 14, 2026, 05:03:28 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

cdbc

  • Hero Member
  • *****
  • Posts: 2687
    • http://www.cdbc.dk
Re: fpGUI Toolkit v2.0.1 has been released
« Reply #8 on: February 14, 2026, 09:32:46 pm »
Hi Graeme
Thank you for that, this is pure gold!!!
I pulled both repos and downloaded your atttachment =^
Read your instructions and proceeded to compile the lot & make a 'fpgui-framework' repo, then compiled the 1.2.0 in your attachment ==> Success!
Felt bold, so I went ahead and /masssaged/ the project file for 'uidesigner' as well, built it without a hitch ==> I do love it, when things just work!
Thanks a lot mate, for my new toys/tools  8-) :D
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

 

TinyPortal © 2005-2018