Re:Libschrift: A lightweight TrueType font rendering library
by kleiba on Tuesday April 21, 2020 @05:35AM
(#22933411)
It's a common gut reaction to jump to a "rewrite from scratch!" because it's more fun to start something new, but often times a serious refactoring is the more sane alternative.
Re:Libschrift: A lightweight TrueType font rendering library
by abainbridge on Tuesday April 21, 2020 @06:37AM
(#22933669)
Libschrift is about 1000 lines of code. Freetype is about 200,000. I'm pretty sure these projects have different aims. It is possible that refactoring Freetype to make it meet the aims of Libschrift would be harder than starting again.
Re:Libschrift: A lightweight TrueType font rendering library
by kleiba on Tuesday April 21, 2020 @10:49AM
(#22935391)
Yes, but note that at some point Freetype was only 1000 lines of code, too.
Re:Libschrift: A lightweight TrueType font rendering library
by Moru on Tuesday April 21, 2020 @05:59AM
(#22933500)
Yes, and the reality often have a way of getting back at you sooner or later. Recreate bugs that were solved years ago in the original code and suddenly you end up with something that looks just as complicated as the original.
Re:Libschrift: A lightweight TrueType font rendering library
by Aeolun on Tuesday April 21, 2020 @06:16AM
(#22933572)
The problem with “a serious refactoring” in open source is that it’s extremely unlikely the maintainer will accept the fact that you rewrote his baby.
Re:Libschrift: A lightweight TrueType font rendering library
by kleiba on Tuesday April 21, 2020 @10:52AM
(#22935422)
That's why you shouldn't just rewrite it on your own devices. The better way is to get in touch with the maintainer and become part of the project. Maybe there are good reasons why refactoring some portion of the code in certain ways is perhaps not the best idea?
Re:Libschrift: A lightweight TrueType font rendering library
by Aeolun on Wednesday April 22, 2020 @08:00AM
(#22944610)
If you absolutely want to fix their codebase, you can do that I suppose. But trying to make friends with a stranger just to get your PR eventually accepted is not nearly as interesting as just saving yourself all that trouble by just implementing the thing from scratch.
Parts of it have aged poorly, as well - for example you might get the impression that it offers kerning support, and while that is technically true in practice it is not because most kerning data is not stored where FT thinks it is, so you'll ask it for kerning data and get nothing. IIRC the solution for kerning with freetype now is to have a shaper like harfbuzz do it for you since the shapers understand the new kerning data.