problem with created PDFs and non-named instances of Variation Fonts

Behdad Esfahbod behdad at behdad.org
Fri Jul 5 16:01:08 UTC 2024


Hi Werner,

On Fri, Jul 5, 2024 at 9:50 AM Werner LEMBERG <wl at gnu.org> wrote:

>
> [This is a copy of a question asked in the GNOME discourse forum:
>
> https://discourse.gnome.org/t/example-for-pdf-output-created-by-pangocairo-using-variation-fonts/22020
> – I'm not sure where to ask specific questions regarding pangocairo.
> Sorry for the duplication.]
>
>
> Folks,
>
>
> Is there an example that demonstrates how to use pangocairo to produce
> a PDF that contains Variation Font instances?
>

This seems to do it for me:

$ pango-view --markup --text='<span font_family="Noto Sans"
font_weight="870" font_size="102400">Test</span>' --output test.pdf
--no-display


> The background for my question is LilyPond, which comes with a cairo
> backend (by using the `-dbackend=cairo` command-line option), and
> which correctly creates PDFs with named instances of VFs.  However, it
> fails to create PDFs with non-named instances, which are silently
> replaced with a subsetted non-VF font.


Cairo synthesizes a subsetted non-VF font for those cases (and for
named-instances as well), since PDF does not support variable-fonts.

Hope that helps,
b


For my tests I used the current git versions of both pango and cairo
> (and the current git of LilyPond).
>
> You can find more details here:
> https://gitlab.com/lilypond/lilypond/-/issues/6613
>
>
>     Werner
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20240705/f8c9901a/attachment.htm>


More information about the cairo mailing list