freetype-devel
[Top][All Lists]
Advanced

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

Re: How to use "autofitter" with TTF


From: Devesh Sharma (M20AIE233)
Subject: Re: How to use "autofitter" with TTF
Date: Wed, 28 Jun 2023 11:08:12 +0530



On Wed, Jun 28, 2023 at 10:35 AM Werner LEMBERG <wl@gnu.org> wrote:

> I am a beginner and interested to contribute to this project.

Great!

> I am exploring how to set "glyph-to-script-map" property for
> "autofitter" with Devanagari TTF fonts.  I explored the code in
> depth and realize that for TTF this property is not implemented.  Is
> this conclusion correct?

Nope.  How did you come to that conclusion?
Thank God I was wrong! :) I probably had jumped to conclusion too soon after looking at the truetype/ttdriver.c +157, since it did not include a conditional to process  "glyph-to-script-map" further autofit/afhints.c confused me.

> Furthermore, it seems that the above property works only for .CFF
> fonts.

This isn't correct, either.
Again Thank God!
The auto-hinter is completely agnostic of
whether glyphs use second-order (TTF) or third-order (CFF) Bézier
curves.
In the CFF code I found FT_HINTING_ADOBE at base/ftobjs.c +992. I misread the codes and jumped to incorrect conclusions. 

What exactly do you want to achieve?  If FreeType gets linked with
HarfBuzz (which you should always do), the `glyph-to-script-map`
property should be correctly set automatically – for SFNT-based font
formats, that is, which is both used by TTFs and CFFs.  However, you
won't find any other font formats today that can be universally used
on all platforms.
I want pygame->freetype->render_to() interface to render devnagari text with autofitting. That is not happening currently, and I am traversing the entire stack to get it done properly. I am not sure where the gap is?
If you can give me any example code in the freetype code base which details the usage of "autofitter", that would be great.

PS: I am open to contribute to this project despite where this discussion goes.


    Werner

reply via email to

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