Re: Font rendering question - should stroking create a gap?
Andrew Murray <[email protected]> Sat, 18 Jan 2025 16:50:06 +1100
| Newsgroups | gmane.comp.fonts.freetype.user |
|---|---|
| Message-ID | <[email protected]> |
> I don=E2=80=99t suppose there is a simple way to stroke text with a = filled inside? I=E2=80=99ve figured out the answer to this at least - by replacing = FT_Glyph_Stroke with FT_Glyph_StrokeBroker with inside set to 0. I guess I=E2=80=99m just curious about the relationship between the = stroked shape and the unstroked glyph. If the radius of a stroke is not = centred around the outline of the unstroked glyph, then what determines = what it is centred around? > On 18 Jan 2025, at 12:03=E2=80=AFam, Andrew Murray = <[email protected]> wrote: >=20 > Hi, >=20 > Over at Python Pillow, a user has reported a gap between a regular = rendering of a font and a stroked rendering of a font - = https://github.com/python-pillow/Pillow/issues/8697 >=20 > To visually demonstrate what I mean, a simpler Pillow script creates = the following image with Times New Roman.ttf on my macOS 15.2 machine - = there is a circle gap around the dot in the =E2=80=98I'. >=20 > <out.png> >=20 > I=E2=80=99ve attached stroke.c for a FreeType-only reproduction, and = output.txt to show what I see when I run the script - a simple rendering = that shows that the width of the dot in the =E2=80=98I=E2=80=99 is = smaller in width than the hole created when rendered with stroke. >=20 > <stroke.c> > <output.txt> >=20 > So, is this =E2=80=98gap=E2=80=99 expected behaviour from FreeType? = I=E2=80=99d be surprised if was a bug. >=20 > If it is accepted behaviour, I don=E2=80=99t suppose there is a simple = way to stroke text with a filled inside? >=20 > Thanks.