> > Given that hooks do not exist and have to be implemented, my > > question remains. Why hooks are better than modules? Werner, why? > > Just imagine that a user wants to use the brand-new `foosvg' library > with FreeType. Using hooks, he can quickly write a few lines of code > to implement the hook callback functions, then registering them. > Done.
https://bitbucket.org/moazin/librsvg-port-freetype-otsvg/src/master/port/rsvg_port.c This is 307 lines of hook code, which is actually more than 283 lines of the generic SVG renderer. These numbers show definitively that these hooks is an expensive layer too, which you are oversimplifying. A dedicated renderer should be about 300 in total. > On the other hand, writing a new renderer module needs FreeType's > internal header files – which no user code should ever rely on. FT_Renderer_Class and FT_Module_Class are public. This is all you need for FT_Add_Module. > I honestly don't know whether it works at all to load a user-compiled > module into FreeType. AFAICS, the library was not set up to manage > externally compiled modules. Nobody tried. I would hope that font-rs or Pathfinder tried it. That can be next year GSoC. Or, would Moazin kindly try a dedicated SVG renderer? This is obviously just a s final part of the SVG project, but I am obviously very passionate about modular FreeType design. _______________________________________________ Freetype-devel mailing list Freetype-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/freetype-devel