[scribus-dev] Scribus CTL

Khaled Hosny khaledhosny at eglug.org
Wed Feb 24 16:48:06 UTC 2016


On Wed, Feb 24, 2016 at 12:06:48AM +0100, Jean Ghali wrote:
> Le 23/02/2016 22:31, Khaled Hosny a écrit :
> >>
> >>I’ll keep that in mind. We don’t use FontConfig, and since Scribus
> >>already depends on FreeType, building Cairo with FreeType font backend
> >>adds no extra dependencies and should be a reasonable expectation (we
> >>should just make sure CMake checks for this).
> 
> Building cairo with freetype on Windows is indeed possible. However cairo
> freetype backend depends on fontconfig on Linux. So it should be checked
> that not using fontconfig will not trigger unwanted behavior differences.

Cairo FT backed can use FontConfig, but that is only for the
cairo_ft_font_face_create_for_pattern () etc., which does not affect
rendering at all.

> Another remark: in ScImagePainter drawGlyph(), a cairo_font_face_t object is
> repeatedly created and destroyed for each painted glyph. This is probably
> slow. You should likely think about adding a setFace method (setFont is
> already used) so as to create and cache the cairo font object inside
> ScImagePainter. By doing so one can create/destroy this object only once per
> glyph run instead of once per glyph.

When I profiled the code this didn’t seem to be of much of an impact,
but I was planning to add a setFont() method except that ScPainter
already had one that takes QFont and is used only by drawText(), having
another method that takes ScFace and is used only by drawGlyph() etc.
will make the semantics of the API unclear. Anyway, I’m moving away from
touching ScPainter at all and introduced a new painter class to be used
for rendering boxes so that we can have the API that fits our need
without messing with the rest of the codebase. Further more, I reverted
to the old glyph rendering code until I figure out what is the best way
to handle other platforms.

Regards,
Khaled



More information about the scribus-dev mailing list