Re: Query regarding CFF font handling

Alexei Podtelezhnikov <[email protected]> Thu, 23 Oct 2025 14:08:07 -0400
Newsgroups gmane.comp.fonts.freetype.devel
Message-ID <[email protected]>
--Apple-Mail-48FC4A8E-8926-4274-B1FB-FF0EF52F2207
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Tony,

> The reason for the failure is that the first check in the function cff_get=
_advance, shown below, always fails.  At no point is there a check for FT_AD=
VANCE_FLAG_FAST_ONLY of the flag passed into the function.
>=20
> cff_get_advance( ... )  =20
> {
>     if ( !FT_IS_SFNT( face ) )                                  // <----- a=
lways fails, regardless of the flags
>       return FT_THROW( Unimplemented_Feature );
>   ...
> }

This error is ignored in base/ftadvanc.c and the identical slow fallback is i=
mplemented there. It is true that cff_get_advance used to ignore FT_ADVANCE_=
FLAG_FAST_ONLY, which was incorrect.

Alexei=

--Apple-Mail-48FC4A8E-8926-4274-B1FB-FF0EF52F2207
Content-Type: text/html;
	charset=utf-8
Content-Transfer-Encoding: 7bit

<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Tony,<br id="lineBreakAtBeginningOfSignature"><div dir="ltr"><br></div><blockquote type="cite"><div dir="ltr"><div dir="ltr"><div><div>The reason for the failure is that the first check in the function cff_get_advance, shown below, always fails.&nbsp; At no point is there a check for FT_ADVANCE_FLAG_FAST_ONLY of the flag passed into the function.</div>
<div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>cff_get_advance( ... )&nbsp; &nbsp;</div></div><div><div>{</div></div><div><div>&nbsp; &nbsp; if ( !FT_IS_SFNT( face ) )&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // &lt;----- always fails, regardless of the flags</div></div><div><div>&nbsp; &nbsp; &nbsp; return FT_THROW( Unimplemented_Feature );</div></div><div><div>&nbsp; ...</div></div><div><div>}</div></div></blockquote></div></div></blockquote><div><br></div><div>This error is ignored in base/ftadvanc.c and the identical slow fallback is implemented there. It is true that cff_get_advance used to ignore FT_ADVANCE_FLAG_FAST_ONLY, which was incorrect.</div><div><br></div
 ><div>Alexei</div></body></html>
--Apple-Mail-48FC4A8E-8926-4274-B1FB-FF0EF52F2207--