Homepage  • Privacy Policy & Imprint
HtmlView / WebView / Browser

HTML renderer for Lazarus

"Pixie" is a new (2026) open source HTML/CSS rendering engine in Free Pascal. It has its own HTML5 parser, CSS3 tokeniser/parser, and a layout engine that handles block, inline, float, table, flexbox, and CSS grid.

https://gitlab.com/retrofoxed/pixie

Licence: MIT © SoftPerfect Pty Ltd

What it does

Pixie takes an HTML string and renders it into a Lazarus control (TPixieHtmlView) with full mouse interaction, scrolling, links, hover/active states, and form controls. Think of it as a way to use HTML/CSS for rich content display in native desktop apps — without embedding a browser.

Features

  • HTML5 parser (68 tokeniser states, 23 insertion modes) — handles malformed HTML the same way browsers do
  • CSS3 parser following the W3C CSS Syntax Level 3 spec
  • Layout: block, inline, float, table (colspan/rowspan), flexbox, CSS grid
  • Selectors: type, class, ID, attribute, combinators, :nth-child(), :not(), :is(), :hover, :active, ::before/::after
  • Gradients: linear-gradient(), radial-gradient(), conic-gradient() with repeating variants
  • Media queries (Level 4), custom properties (var()), border-radius, opacity, positioned elements
  • Owner-drawn form controls: text inputs, textareas, checkboxes, radio buttons, buttons — with caret, selection, and clipboard

Architecture — no dependencies

Pixie is pure Pascal with zero third-party dependencies. The rendering backend is abstracted behind a canvas interface with three implementations:

  • Direct2D / DirectWrite (Windows) — hardware-accelerated, native SVG via ID2D1DeviceContext5
  • Cairo (Linux / cross-platform)
  • Core Graphics (macOS)

~49,000 lines of Pascal across 58 units. A full demo app compiles to a 4.2 MB stripped executable (Win64, smart-linked). No DLLs, no runtime, no WebView2 redistributable.

Use cases for Lazarus apps

  • Rich "about" dialogs, changelogs, and release notes
  • In-app help systems and documentation viewers
  • HTML-formatted reports and print previews
  • Email or message display
  • Dashboard panels with styled content and tables
  • Any UI where you want the flexibility of HTML/CSS without the weight of an embedded browser

Current state

The engine is used in production in our commercial products. It handles real-world HTML well, though it's not trying to be a full browser — no JavaScript, no <video>, no CSS animations. The focus is on correct layout and rendering of static/interactive content.

Compiles with Lazarus/FPC (FreePascal) targeting Windows (32/64), Linux (x64, ARM64), and macOS (x64, ARM64).


Back  •  Scroll to Top  • Homepage