DEV Community

Discussion on: Avalonia platform support - why it's simple

Collapse
 
mikecodesdotnet profile image
Mike James

Your comment resulted in another curious inquiry for me to explore!

While it's correct that Avalonia UI's are pixel-perfect, things are a little more complex regarding text and sub-pixel rendering.

Each platform has a different rasteriser with Windows using DirectWrite, macOS using CoreText and Linux using FreeType2. We use these different rasterisers to ensure that fonts are readable and text "fits in" with the other apps on the users device.

We have considered using FreeType for all platforms to make font-rendering identical across the platforms, but it isn't trivial and can result in text either being too blurry or too sharp.

If you've some time and want to explore this more deeply, I suggest building Skia with FreeType and seeing what identical font rendering looks like accross platforms. It likely won't be straightforward but you'll see why it's not something you'd really want. You should find the docs on SkiaSharp helpful for creating a custom build.