Hi Patrick,

On Wed, 2025-04-09 at 09:19 +0200, Patrick Gundlach wrote:
> I am playing with variable fonts, and I
> can see that I can create font metrics with
>
> font:set_variation(...)
>
> so the shaper takes the new widths into account.
>
> But writing this font into PDF has no visible effect. I assume the
> subsetter in LuaTeX does not take the variations into account.

You can use the (undocumented) "glyph_stream_provider" callback to write
the correct data to the PDF file. If you're using luaotfload or ConTeXt,
it handles the "glyph_stream_provider" for you, so you can just add the
data for each character to "fonts.hashes.streams[<font_id>].streams",
which is an array indexed by the character index. You can use
"glyph_stream_provider" for both CFF and TrueType-encoded characters;
for type-3 encoded characters, you'll need to use mode 2 in the
"provide_charproc_data" callback.

I've only ever personally used "provide_charproc_data", so if I'm wrong
on some of the details for "glyph_stream_provider", hopefully someone
will correct me.

Thanks,
-- Max
_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to