While moving from the DOM to the Canvas 2D API for text rendering provides a massive performance boost, it introduces a severe typographical flaw: Canvas fillText() is notoriously bad at complex text shaping. It completely fails to render advanced programming ligatures (like turning => or === into a single, beautiful glyph) commonly found in fonts like Fira Code or JetBrains Mono.
To achieve flawless, desktop-grade typography without sacrificing Canvas performance, NitroIDE completely overrides the browser's text rendering engine by compiling HarfBuzz and FreeType into WebAssembly.
Instead of asking the Canvas to draw a string, we pass the string to our HarfBuzz WASM module. HarfBuzz analyzes the font file, processes the ligature rules, and returns an array of exact X/Y coordinates and specific glyph IDs.
Subpixel Kerning: Because we control the exact placement of every single character at the mathematical level, we can implement custom subpixel kerning algorithms, ensuring that italicized comments and dense JSON structures are perfectly legible at any zoom level.
This architecture decouples NitroIDE from the host operating system's font rendering quirks. Whether you are on a Windows machine with ClearType or a Mac with Retina scaling, the code in your editor will look mathematically identical, preserving the designer's exact intent.
Type some complex arrow functions and watch HarfBuzz shape them flawlessly.
Test Typography