Sample Sin Forgiver certificate for fictional recipient Kyle R., showing QuestPDF fonts, a red seal, and a SAMPLE mark.

QuestPDF Fonts: What Changed After My 2026.9 Upgrade

I ran a bulk NuGet update across a lot of packages, and somewhere in that batch I ran into a problem with QuestPDF fonts. I think failing tests were what first sent me looking, although the exact sequence is a little fuzzy now. Comparing the previous results with the new ones helped me narrow it down to certificate generation and the font behavior that changed in QuestPDF 2026.9.

The app is Sin Forgiver, a parody app where you pay 99 cents for a certificate of forgiveness for a petty offense. Since the certificate is the product, getting PDF generation working matters. The fix involved shipping the fonts with the application, registering them explicitly, and deciding what should happen when someone’s text contains a character those fonts can’t draw.

What changed in QuestPDF 2026.9

My app moved from QuestPDF 2026.8.0 to 2026.9.1. The 2026.9.0 release notes describe three font defaults relevant to the upgrade:

  • Settings.UseSystemFonts is now false.
  • Settings.ThrowOnMissingFontFamilies is now true.
  • Settings.ThrowOnMissingTextGlyphs is now true.

Those settings address different problems. The first changes where fonts come from. The other two stop generation when a requested family is unavailable or when the font and its fallbacks can’t draw a character.

You can still enable system fonts. However, relying on fonts installed on the host leaves you dependent on that environment. For this app, I wanted the certificate’s fonts to travel with the API, so development and deployment would use the same files.

Bundling QuestPDF fonts with the API

The base fonts are Liberation Serif and Liberation Mono, replacements for Times New Roman and Courier New. The certificate design also uses IM Fell English, Literata, and Special Elite. Those three were already web fonts on the site, so a script converts them to TrueType for the PDF generator.

The files live under Resources/Fonts in the API project. This excerpt from the project file copies the fonts and their notices to both build and publish output:

<Content Include="Resources\Fonts\*.ttf;Resources\Fonts\LICENSE-Liberation-OFL.txt;Resources\Fonts\OFL-*.txt;Resources\Fonts\NOTICE.md;Resources\Fonts\LICENSE-special-elite-Apache-2.0.txt"
         CopyToOutputDirectory="PreserveNewest"
         CopyToPublishDirectory="PreserveNewest" />

Both destinations matter. A font can be available during a debug session and still be missing from the published application. If you’re adapting this, check the publish output as well as the source folder.

The notices belong there too. Liberation, IM Fell English, and Literata use the SIL Open Font License; Special Elite uses Apache 2.0. The bundled Special Elite file is a modified version, and its notice describes the conversion, merging, and subsetting. Include the license and notices appropriate to the files you distribute rather than assuming every font has the same requirements. QuestPDF’s own license is a separate consideration.

Registering QuestPDF fonts once

QuestPDF supports automatic discovery of deployed font files, but this app registers them explicitly. That gives me a specific list to load and means a missing file fails when startup opens it.

The EnsureRegistered() method handles repeated calls. Here are the guard fields and method from CertificateFonts; FontFileNames, omitted from this excerpt, is an array listing the bundled TTF filenames:

private static readonly Lock Gate = new();
private static volatile bool _registered;

public static void EnsureRegistered()
{
    if (_registered)
    {
        return;
    }

    lock (Gate)
    {
        if (_registered)
        {
            return;
        }

        QuestPDF.Settings.ThrowOnMissingTextGlyphs = false;

        var fontDirectory = Path.Combine(AppContext.BaseDirectory, "Resources", "Fonts");
        foreach (var fileName in FontFileNames)
        {
            var path = Path.Combine(fontDirectory, fileName);
            using var stream = File.OpenRead(path);
            FontManager.RegisterFontFromStream(stream);
        }

        _registered = true;
    }
}

This code uses FontManager from QuestPDF.Drawing and Lock from System.Threading; the application targets .NET 10. The lock prevents concurrent callers from registering the list twice, and the flag lets later calls return immediately.

Program.cs calls the method at startup. The generator calls it too, so tests and tools that don’t run API startup still get the fonts. A registration test calls it twice and checks that the expected families are available.

Choosing the family and its fallback

Once a font is registered, the document needs its family name, which may differ from its filename. This app keeps those names in CertificateFonts and exposes chains for the different text styles. Body text, for example, uses Literata followed by Lato, the font bundled with QuestPDF.

That fallback gives another font a chance to draw a character missing from Literata. It doesn’t provide coverage for every writing system, though, which brings us to the setting inside the registration method.

When a missing character shouldn’t stop generation

Why set ThrowOnMissingTextGlyphs = false while leaving missing-family checks enabled? In this app, the two failures need different responses.

A missing bundled font is a packaging problem. I want to catch it before a certificate reaches someone. User-entered text is less predictable: a name can contain emoji or Chinese, Japanese, or Korean characters that the bundled fonts don’t cover. With glyph checking enabled, an unsupported character could stop certificate generation after someone has paid.

Disabling that check lets generation continue. The font management documentation says unsupported glyphs then appear as placeholder characters. That doesn’t make the text render correctly; it avoids turning a coverage gap into a generation failure.

The generator test exercises both certificate types with emoji and CJK text. This shortened excerpt shows some of the input and the generation call:

var data = CreateCertificateData() with
{
    SinName = "Ate the last slice \U0001F355 罪",
    SinDescription = "ごめんなさい \U0001F525",
    CertificateRecipientName = "Test 例 \U0001F600 Person",
};

await using var pdfStream = await generator.GenerateAsync(
    data, TestContext.Current.CancellationToken);

The full test checks that the result contains bytes and has two pages. It doesn’t inspect the appearance of the unsupported characters. A font with the required coverage would be the more complete solution for that text; the current setting keeps the certificate from failing because of it.

Checking the result in the deployed application

After the changes, I checked generation in a Windows debug session, through tests, and in the containers running in my UAT environment. That last check mattered because copying fonts into a local build isn’t the same as getting them into a deployed application.

For your own deployment, check both pieces: are the font files present, and can the running application generate a document using them? This post describes my app on QuestPDF 2026.9.1, so use a document representative of your own fonts and content when checking another deployment.

Using the same generator for the website preview

The generator is useful outside the purchase flow too. In my Blazor Server SEO post, I described replacing text mock-ups with an image of an actual certificate so visitors could see what they were buying.

A small console tool calls the same generator with fictional data: Kyle R., a made-up offense about ghosting a group chat, and an invented certificate number. A Python script converts the first PDF page into website and sharing images using Poppler and Pillow, adding a red “SAMPLE” mark.

The preview also includes the certificate’s round SVG seal. Its lettering is already converted to outlines by a Python script, so it doesn’t depend on SVG text rendering.

Using the real generator keeps the preview tied to the certificate’s fonts and design. It’s still a snapshot, so the image needs regenerating whenever the certificate changes.

Conclusion

If your PDFs stop generating after the upgrade, start with the families the document requests and compare them with FontManager.GetRegisteredFonts(). Check the filenames in your deployment and the family names stored inside those files; they’re two different things to verify.

Then look at glyph coverage separately. Bundling the right family doesn’t mean it can draw every character someone enters. For this app, keeping generation available while allowing placeholders was the tradeoff. For yours, the next step may be adding a fallback that covers the text your users need.

Credits

0 comments on “QuestPDF Fonts: What Changed After My 2026.9 Upgrade”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.