Recent

Author Topic: Lightweight HTML/CSS rendering engine written in pure Free Pascal  (Read 6429 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2709
    • UVviewsoft
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #45 on: March 19, 2026, 03:53:24 pm »
Please make an announce of the new component at
https://forum.lazarus.freepascal.org/index.php/board,19.0.html
It must be visible very good.

krolikbest

  • Sr. Member
  • ****
  • Posts: 276
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #46 on: March 19, 2026, 07:44:43 pm »
Really impressive, thank you!

Wallaby

  • Guest
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #47 on: March 19, 2026, 11:22:20 pm »
Fixed a couple of compilation errors with older FPC, added interactive scrollbar and Qt5/6 backend.

Adding any scripting is currently not planned (what for? any kind of host app interaction comes back to the Lazarus/Pascal app).

myisjwj

  • Full Member
  • ***
  • Posts: 104
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #48 on: March 20, 2026, 03:20:40 am »
Thank you for Retrofoxed's efforts!
Great! The scroll bar is now available. It would be great if there were an onScript callback like in THtmlViewer.
For example:
procedure TForm1.HtmlViewer1Script(Sender: TObject; const Name, ContentType,
Src, Script: ThtString);
begin

end;
Of course, it would be even more complete if it were directly integrated with JavaScript support.

Wallaby

  • Guest
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #49 on: March 20, 2026, 04:12:42 am »
Thank you for Retrofoxed's efforts!
Great! The scroll bar is now available. It would be great if there were an onScript callback like in THtmlViewer.
For example:
[...]
Of course, it would be even more complete if it were directly integrated with JavaScript support.

What's your exact use case for this? I can understand why JS access would be needed for web-sites, but this isn't really a web browser (so far :-D) capable of surfing web-sites. In other words, how do you intend to use it?

zeljko

  • Hero Member
  • *****
  • Posts: 1927
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #50 on: March 20, 2026, 08:53:19 am »
All I can say is that this is pretty impressive work !

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1353
  • Professional amateur ;-P
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #51 on: March 20, 2026, 10:27:53 am »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12851
  • FPC developer.
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #52 on: March 20, 2026, 10:39:06 am »
Would be great to see if it can be integrated into the CHM viewer.

Good luck with that one. This came up with IPro versus THtmlViewer - and that didn't go anywhere.

Do you know what exactly caused the problems ?   

derox

  • Jr. Member
  • **
  • Posts: 52
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #53 on: March 20, 2026, 12:08:55 pm »
Thank you! This is really great, cool, sweet and nice! Will you be able to support FMX as well as VCL? iOS, iPadOS and Android support through FMX would be the icing on the cake  :D

dsiders

  • Hero Member
  • *****
  • Posts: 1613
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #54 on: March 20, 2026, 04:40:39 pm »
Would be great to see if it can be integrated into the CHM viewer.

Good luck with that one. This came up with IPro versus THtmlViewer - and that didn't go anywhere.

Do you know what exactly caused the problems ?   

Inertia.

AlexTP

  • Hero Member
  • *****
  • Posts: 2709
    • UVviewsoft
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #55 on: March 20, 2026, 08:17:13 pm »
Current code saves tag names to str fields, right? e.g. 'img'. I got a small idea: save not the str field but enum field, calculated from str. Will it make work faster?

Wallaby

  • Guest
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #56 on: March 20, 2026, 11:48:33 pm »
Current code saves tag names to str fields, right? e.g. 'img'. I got a small idea: save not the str field but enum field, calculated from str. Will it make work faster?

Great idea — and actually, Pixie already does exactly this! 🌟 Tag names are converted to integer IDs during parsing (via PixieId()), so internally the engine never compares strings like 'img' or 'div'. All tag matching uses fast integer comparisons instead.

The string-to-integer conversion happens just once when the HTML is parsed, and after that everything runs on plain numbers. This optimisation is already in place :-)

Wallaby

  • Guest
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #57 on: March 20, 2026, 11:51:10 pm »
Thank you! This is really great, cool, sweet and nice! Will you be able to support FMX as well as VCL? iOS, iPadOS and Android support through FMX would be the icing on the cake  :D

Yes, actually I already have a working FMX prototype. I can only test on Windows/macOS though - it'll be up to you guys to test on mobile platforms.

But it should work universally as FMX abstracts any target platform.

ALLIGATOR

  • Sr. Member
  • ****
  • Posts: 415
  • I use FPC [main] 💪🐯💪
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #58 on: March 21, 2026, 12:45:23 pm »
Maybe someone could port (adapt the canvas backend) it to Android?
(Using the Android NDK, following a similar approach to the one described here:
https://github.com/VadimBoev/FlappyBird
https://github.com/cnlohr/rawdrawandroid
&
LAMW
)

Just an idea (I'm not ready for that myself yet)
« Last Edit: March 21, 2026, 01:30:46 pm by ALLIGATOR »
I may seem rude - please don't take it personally

derox

  • Jr. Member
  • **
  • Posts: 52
Re: Lightweight HTML/CSS rendering engine written in pure Free Pascal
« Reply #59 on: March 21, 2026, 05:56:27 pm »
Yes, actually I already have a working FMX prototype. I can only test on Windows/macOS though - it'll be up to you guys to test on mobile platforms.

But it should work universally as FMX abstracts any target platform.

Nice 👍🏻

I suppose «contenteditable» for rich text editing will be quite hard to implement?!

 

TinyPortal © 2005-2018