-
Notifications
You must be signed in to change notification settings - Fork 22
Description
I'm wondering whether it would make sense and wouldn't be too difficult to add an option to use FreeType for rendering fonts?
I'm not sure if it would produce better quality fonts, from what I understood from the comments in skb_canvas.c and skb_rasterizer.c, the current rasterizer is based on some old stb_truetype version (which lacks quality in comparison to FT, but I realize that you improved it a lot).
FreeType can also render SVG-in-OT fonts using e.g. PlutoSVG (https://github.com/sammycage/plutosvg) (I didn't try yet whether Skribidi supports SVG-in-OT).
Some example implementations:
- ImGui optional FreeType backend (including SVG-in-OT using either PlutoSVG or LunaSVG): https://github.com/ocornut/imgui/blob/docking/misc/freetype/imgui_freetype.cpp
- SFML uses HarfBuzz and SheenBidi for text shaping and FreeType for rendering: https://github.com/SFML/SFML/blob/master/src/SFML/Graphics/Font.cpp
The reason why I prefer Skribidi over SFML is because it handles complex layouts, while SFML doesn't handle line wraps at all.
FreeType font loader also supports more formats: BZIP and GZIP compressed fonts, PNG bitmaps in fonts, WOFF fonts. For now, I use hb_face_create_or_fail_using("ft") + skb_font_collection_add_hb_font() in my WIP project, so that HarfBuzz uses FreeType to load fonts.
Any thoughts?