LMS & eLearning

Certificate Builder PDF Shows Boxes, Missing Fonts or Wrong Characters

A Certificate Builder PDF prints squares instead of letters, falls back to a serif you did not choose, or refuses an uploaded font. How fonts reach mPDF and the fix for each symptom.

Certificate Builder PDF Shows Boxes, Missing Fonts or Wrong Characters

Font problems in the LearnDash Certificate Builder (1.1.2) show up in three ways: a learner's name prints as empty squares, the whole certificate renders in a serif face although a different font was selected, or the font upload screen refuses a file. All three come down to how the add-on hands fonts to its bundled mPDF engine. This troubleshooting guide walks through that mechanism as the source implements it, then gives the fix for each symptom, including the non-Latin name case that classic certificates also struggle with.

How fonts reach the PDF

When the PDF service starts, it configures mPDF with a default font of freeserif and registers three bundled families: FreeSerif, FreeSans and FreeMono, each with regular, bold, italic and bold italic files, with OpenType layout enabled for the first two. It sets FreeSans as the backup substitution font, so when a glyph is missing from the chosen font mPDF looks in FreeSans before giving up. It then reads the option learndash_certificate_builder_fonts, where the font manager stores uploaded families, registers each one, and adds the user font folder as a font directory. Headings and paragraphs apply the font family chosen in the block, or the builder block's default font, through generated CSS rules keyed to each block's id. Our walkthrough of the builder's PDF pipeline covers the rest of the process.

Symptom 1: squares or blanks where letters should be

Boxes mean no registered font has a glyph for that character, after FreeSans substitution. The GNU Free fonts cover Latin, Greek, Cyrillic and many other scripts, but not all of them, and not every symbol. A name in a script outside their coverage, or an emoji pasted into a heading, prints as boxes.

Fix: upload a TTF that covers the script, under LearnDash LMS, Certificates, Fonts, as described in adding custom fonts to the Certificate Builder, and select it for the block that holds the name. Because substitution only consults FreeSans, choosing the covering font explicitly on the block is what makes it work; uploading alone does not add it to the fallback chain. For sites with learners in several scripts, select a broad-coverage font for the name block rather than per-learner logic, which the builder does not support.

Symptom 2: the PDF uses a serif you did not pick

FreeSerif is the default when a block has no font set and the builder block's default font is empty or names a family that is not registered. The switcher that converts a classic certificate writes dejavusanscondensed as the default font attribute, a family the builder does not bundle, so a converted certificate whose blocks inherit the default renders in FreeSerif until you choose a font. Fix: set the builder block's default font to a registered family and check each heading and paragraph's font setting. If an uploaded font was selected and the PDF still falls back, the family key stored on the block no longer matches the option, which happens when a font was removed and re-uploaded under a different internal name; reselect it.

Symptom 3: the uploader rejects the file

The font manager requires a Regular file and accepts optional Bold, Italic and Bold Italic files. Each file is opened with mPDF's TrueType analyser to extract the family name, and a file the analyser cannot parse is rejected with the analyser's message. That rules out web font formats and OpenType files with PostScript outlines, which look like fonts but are not TrueType; convert them to TTF with a font tool first. Uploads also require the manage_options capability and the uploader's nonce, so a user without administrator rights sees nothing on the screen. The family name is derived from the font's internal name, sanitised, and the label you type is only for display.

Symptom 4: fonts worked on staging and vanished on production

Uploaded files are stored under uploads/learndash-certificate-builder/user_fonts, and the option records each file's URL. Two things break after a move: the files were not copied with the uploads folder, or the site URL changed and the stored URLs point at the old domain. Fix: copy the folder, then re-upload the fonts on production if the URLs are stale; a search-and-replace on the options table also works if it rewrites serialized data safely.

Symptom 5: a bold or italic word renders in the regular weight

mPDF uses the file registered for that style. If only the Regular file was uploaded, bold text in the PDF is synthesised or falls back, depending on the font. Upload the Bold and Italic files in their slots; the manager merges them into the same family entry.

Symptom 6: fonts load but the PDF is slow

Each download renders from scratch and mPDF caches font metrics in a temporary directory under uploads. A very large font file, or a font directory that is not writable so the cache is regenerated on every request, slows every certificate. Subset fonts to the scripts you need before uploading, and check that the uploads folder is writable.

Classic certificates and non-Latin names

Classic certificates use TCPDF, which ships with Helvetica, Times and the same three Free families, and has no font uploader. A classic certificate that prints boxes for a Cyrillic or Greek name is usually styled with Helvetica, which lacks those glyphs; declaring FreeSerif or FreeSans as the font family in the certificate's inline styles or in the Certificate Custom Styles setting fixes most cases. For scripts beyond the Free fonts' coverage, the practical route is the builder with an uploaded font; converting a classic certificate to the builder explains the switch.

Testing method

  1. Create a test learner whose display name contains the characters that fail.
  2. Complete a test course and download the certificate; the Preview button renders without a user, so it will not reproduce a name problem.
  3. Change one thing at a time: the block's font, then the default font, then the uploaded files.

If the PDF errors out rather than rendering boxes, the font file itself may be corrupt; remove it from the Fonts screen and re-upload a fresh copy. The builder hooks guide shows the mPDF instance filter, which developers can use to register a font programmatically or to change the substitution list.

When to get help

Most font problems are solved by uploading the right TTF and selecting it on the name block. Certificates in right-to-left scripts, mixed-script names, or a brand font that only exists in web formats are cases our LearnDash services team handles regularly; a LearnDash developer can also add a broader fallback font through the mPDF filter so that no learner sees boxes.

Frequently asked questions

Why does my certificate print boxes for some names?

No registered font, including the FreeSans fallback, has those glyphs. Upload a TTF that covers the script and select it on the name block.

Why is everything in a serif font?

FreeSerif is the default when no registered font is set. Set the builder block's default font and each block's font to a registered family.

Which file formats can I upload?

TrueType files that mPDF's analyser can parse. Web font formats and PostScript-flavoured OpenType files are rejected; convert them to TTF.

Where are uploaded fonts stored?

In uploads/learndash-certificate-builder/user_fonts, with their URLs recorded in the learndash_certificate_builder_fonts option.

Add WorldWin Coder to your preferred sources

Add worldwincoder.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

· Developers and project managers

Articles written and reviewed by the developers and project managers at WorldWin Coder, who build and maintain websites, web applications and mobile apps on WordPress, Moodle, PHP, Laravel, CodeIgniter and Flutter.

Free consultation

Need help with LearnDash?

Tell us what you are working on. A developer who does this every week reads your message and replies within one business day with next steps and a free quote.

  • Free consultation and quote
  • NDA on request
  • You own the source code
  • Reply within one business day

Tell us about your project

Add budget and timeline optional, helps us quote faster

This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Keep reading

Have something to build, fix or move?

Tell us where you are. A developer reads every inquiry, and you get next steps and a free quote within one business day.