Re: FT Cache Subsystem: Custom caches

Alexei Podtelezhnikov <[email protected]> Tue, 7 Nov 2023 21:21:18 -0500
Newsgroups gmane.comp.fonts.freetype.user
Message-ID <CAJU=AjWv4iOhL_vf7w2JJcMtd+e6aVsVA9YJvJmHDtEqLM7v9Q@mail.gmail.com>
Hi Kelvin

If you only interested in subpixels shifts and intend to cache 3
positions, you can achieve using LCD rendering and
https://freetype.org/freetype2/docs/reference/ft2-lcd_rendering.html#ft_library_setlcdgeometry.
It is apparent that LCD rendering is essentially 3 traditional
antialiased bitmaps produced for shifted outlines and stacked
together. Therefore, you have it already for 1/3-pixel shifts by
default. Because everything is periodic, you can continue with the LCD
output and clever reading frame shifts for subpixel positioning too.

Theoretically, this should work.

There is also https://freetype.org/freetype2/docs/reference/ft2-sizing_and_scaling.html#ft_set_transform
.  Perhaps you should wrap it into
https://freetype.org/freetype2/docs/reference/ft2-cache_subsystem.html#ftc_face_requester.

Alexei