aseprite / aseprite

Animated sprite editor & pixel art tool (Windows, macOS, Linux)
https://www.aseprite.org
29.62k stars 6.26k forks source link

Using Skia for font rendering #4362

Open dacap opened 8 months ago

dacap commented 8 months ago

Some days ago I started working to switch to Skia-m124 (in the beta branch of laf and aseprite) for font rendering using native fonts (instead of FreeType as we do now).

Skia uses DirectWrite on Windows, CoreText on macOS, and FreeType/HarfBuzz on Linux for text layout/shaping and rendering. It allows better font rendering and easy handling of available system fonts + better handling of font fallbacks. Also support for emojis:

image1

image2

After this we'll need to enable IME support (#2841) in a near future too (some work was already done to support inserting Emojis on Windows).

This will fix #4397 and probably other issues like #1877

dacap commented 8 months ago

https://github.com/aseprite/aseprite/commit/ab18cd986c8e501e0178a689fff424e2c985f9da is the first step. We need a way to specify system fonts in themes and from Edit > Preferences > General with a new font selector.

ckaiser commented 3 months ago

Added two PRs related to this, first is #4604, which was causing crashes on Windows - and second is #103 which also fixes crashes on Windows and improves the font rendering on Windows in general.

It still suffers from some issues especially when compared to main. (All comparisons done on Windows, for now)

jmswrnr theme Edgtheme My own theme (Segoe UI font)
comparison_jmsw comparison_edgtheme comparison_custom
dacap commented 2 months ago
  • With some languages like Japanese and Arabic, using the default theme, things render differently. Technically more "correct" but I'm not sure if better legibility-wise for real users

Known issue :cry:, probably we could offer an antialias fallback for sprite sheet fonts, here an example with an antialias fallback (on Linux):

Screenshot from 2024-08-29 15-48-06

and without antialias:

Screenshot from 2024-08-29 15-47-49

I noticed that the text is quite unaligned (at least on Linux).

dacap commented 4 days ago

I'll close this issue as the text rendering is now using Skia, but I'll review those comments later (and probably users will report a lot of new text rendering issues).