freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Revised SVG stuff


From: Moazin K
Subject: Re: Revised SVG stuff
Date: Sat, 15 Jan 2022 21:09:08 -0800

Hi Werner,

I just got some time to quickly check this bug. The reason why the autohinting code seems to get triggered for that font is because `ttface->num_locations` is 1 for this font while it's 0 for all other fonts that I had in my test collection. This check happens in FT_Load_Glyph in `ftobjs.c` on line number 999 in my branch where autohint is set to true, there's a comment about `num_locations` over there. I'm under the impression that that value will not be set to `0` in the case of OTF fonts with TTF glyphs. I'm not sure how to add a check that can prevent hinting to be run for OT-SVG glyphs. Whether or not a glyph index has a corresponding SVG glyph in the table is determined later on inside cff_slot_load or TT_Load_Glyph. Any ideas on how to prevent autohinting from being run on an OT-SVG glyph?

Thanks,
Moazin

On Mon, Jan 3, 2022 at 10:48 AM Werner LEMBERG <wl@gnu.org> wrote:

Hello Moazin,


just now I've pushed new branches to the FreeType and FreeType Demo
repositories with my changes.

  https://gitlab.freedesktop.org/freetype/freetype/-/tree/wl/freetype-ot-svg-from-scratch-new
  https://gitlab.freedesktop.org/freetype/freetype-demos/-/tree/wl/freetype-demos-support-ot-svg-glyphs-new

While the library stuff is thoroughly checked and modified[*], the
demo stuff is not yet; to the latter code I've only applied the
necessary fixes to make it compile.

The reason why I've stopped is that I wasn't able to render this SVG
font:

  https://get.fontspace.co/download/family/gep41/ffdec6d38cd94d51803685fec480ef08/bigpartyo2-green-font.zip

Funnily, it was the first SVG that I downloaded, and I was quite
surprised to see no SVG rendering at all :-)

AFAICS, the error 'Unimplemented Feature' is returned in line 502 of
file `afloader.c`.  Please check.  It doesn't make any sense for SVG
glyphs to run the auto-hinter.


    Werner


[*] I did `git rebase -i HEAD^^^^^`, then walking over the code commit
    by commit, adding my changes with `git commit --amend`.  If I
    found new things I did rebasing again so that the changes get
    added to the right commit.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]