# Form Field Font Fallback Control
IronPDF auto-embeds a Tahoma/Arial fallback font whenever a form field's `Value` is set to a non-ASCII string, which can override the font a template actually needs. As of IronPDF `2026.6.1`, three new methods give you direct control over that behavior.
To embed a specific font, have a TrueType/OpenType (`.ttf`/`.otf`) file ready. To only suppress the fallback, no font file is needed.
## Solution
Set the font at the document level **before** filling any field that needs it. Three methods on `PdfDocument` replace the old manual workaround.
### Option A: Embed a Font from Bytes
Pass a font name and the raw font bytes to `SetFormFont`:
```csharp
var pdf = PdfDocument.FromFile("template.pdf");
pdf.SetFormFont("Poppins-Regular", File.ReadAllBytes("Poppins-Regular.ttf"));
pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş ğ";
pdf.SaveAs("filled.pdf");
```
`SetFormFont` writes into the AcroForm `/DR /Font` dictionary under the given `fontName`. If the template already used that exact name for a different font, it gets replaced, so pick a non-colliding name when you need to preserve the original mapping.
### Option B: Embed a Font from a File Path
When you have a path rather than bytes, use `SetFormFontFromFile`:
```csharp
var pdf = PdfDocument.FromFile("template.pdf");
pdf.SetFormFontFromFile("Poppins-Regular.ttf");
pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş";
pdf.SaveAs("filled.pdf");
```
### Option C: Suppress the Fallback
`DisableFormFontFallback` stops the Tahoma/Arial auto-embed without adding anything to the file:
```csharp
var pdf = PdfDocument.FromFile("template.pdf");
pdf.DisableFormFontFallback();
// do not auto-embed Tahoma/Arial
pdf.Form.FindFormField("bookingNumber").Value = "AS2323445";
pdf.SaveAs("filled.pdf");
```
**Recommended when:** the template's existing font references, plus the PDF viewer's own font substitution, already render the values correctly. This option costs zero file size.
All three examples assume a field named `"bookingNumber"` exists in `template.pdf`. `FindFormField` returns `null` when the name matches no field, so check for `null` before setting `.Value` or you'll hit a `NullReferenceException` rather than a font problem.
## The Pre-2026.6.1 Workaround
Before these methods existed, `SetDefaultFont()` on a form field did not control the Tahoma/Arial auto-fallback for non-ASCII text. The only override was to construct the field's `DefaultAppearance` string by hand:
```csharp
field.DefaultAppearance = "/Helvetica-Bold 12 Tf 0 0 0 rg";
```
The format is `/{FontName}-{Weight} {FontSize} Tf {R} {G} {B} rg`. The named font must already be registered in the document's AcroForm resource dictionary, and the values are raw PDF text operators with no validation.
## Notes and Limitations
- **Document-wide, not per field:** all three methods apply across the document. When different fields need different fonts, call `SetFormFont` once per font variant.
- **Trigger condition:** the auto-fallback only fires when a field's `Value` is set to a non-ASCII string. Other field updates (renaming, `ReadOnly`) are unaffected regardless of which option you use.
- **Font name characters:** `fontName` allows letters, digits, `-`, `_`, `.`, `+`. A 6-letter PDF subset prefix (e.g. `AAAAAA+Poppins-Regular`) is accepted and stripped automatically to the canonical name.
- **Force embed:** `forceEmbed: true` adds a fresh font copy on every call, growing the file each time. Leave it `false` unless you know the existing embed is stale.
- **Exceptions:** `SetFormFont` throws `ArgumentException` for an invalid `fontName` or `fontData`. `SetFormFontFromFile` also throws `FileNotFoundException` when the path doesn't exist.
[[i:(The pre-existing per-field method `IFormField.SetDefaultFont(fontName, fontSize, fontColor)` is unrelated and unchanged. It sets a field's appearance using a font that must already be installed on the rendering machine, and does not affect the non-ASCII auto-fallback described here.)]]
Equivalent functionality ships in IronPDF Python `2026.6.0.1+` and IronPDF Java `2026.6.1+` under each language's own naming convention (for example Java's `FormManager.setFormFont`/`setFormFontFromFile`/`disableFormFontFallback`, camelCase), which is not verified here to the same standard as the C# signatures above.
For more on fonts, see [Manage PDF Fonts in C#](/how-to/manage-fonts/).
IronPDF auto-embeds a Tahoma/Arial fallback font whenever a form field's Value is set to a non-ASCII string, which can override the font a template actually needs. As of IronPDF 2026.6.1, three new methods give you direct control over that behavior.
To embed a specific font, have a TrueType/OpenType (.ttf/.otf) file ready. To only suppress the fallback, no font file is needed.
Solution
Set the font at the document level before filling any field that needs it. Three methods on PdfDocument replace the old manual workaround.
Option A: Embed a Font from Bytes
Pass a font name and the raw font bytes to SetFormFont:
var pdf = PdfDocument.FromFile("template.pdf");pdf.SetFormFont("Poppins-Regular", File.ReadAllBytes("Poppins-Regular.ttf"));pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş ğ";pdf.SaveAs("filled.pdf");
var pdf = PdfDocument.FromFile("template.pdf");
pdf.SetFormFont("Poppins-Regular", File.ReadAllBytes("Poppins-Regular.ttf"));
pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş ğ";
pdf.SaveAs("filled.pdf");
C#
SetFormFont writes into the AcroForm /DR /Font dictionary under the given fontName. If the template already used that exact name for a different font, it gets replaced, so pick a non-colliding name when you need to preserve the original mapping.
Option B: Embed a Font from a File Path
When you have a path rather than bytes, use SetFormFontFromFile:
var pdf = PdfDocument.FromFile("template.pdf");pdf.SetFormFontFromFile("Poppins-Regular.ttf");pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş";pdf.SaveAs("filled.pdf");
var pdf = PdfDocument.FromFile("template.pdf");
pdf.SetFormFontFromFile("Poppins-Regular.ttf");
pdf.Form.FindFormField("bookingNumber").Value = "FONT TEST: € ş";
pdf.SaveAs("filled.pdf");
C#
Option C: Suppress the Fallback
DisableFormFontFallback stops the Tahoma/Arial auto-embed without adding anything to the file:
var pdf = PdfDocument.FromFile("template.pdf");pdf.DisableFormFontFallback();// do not auto-embed Tahoma/Arialpdf.Form.FindFormField("bookingNumber").Value = "AS2323445";pdf.SaveAs("filled.pdf");
var pdf = PdfDocument.FromFile("template.pdf");
pdf.DisableFormFontFallback();
// do not auto-embed Tahoma/Arial
pdf.Form.FindFormField("bookingNumber").Value = "AS2323445";
pdf.SaveAs("filled.pdf");
C#
Recommended when: the template's existing font references, plus the PDF viewer's own font substitution, already render the values correctly. This option costs zero file size.
All three examples assume a field named "bookingNumber" exists in template.pdf. FindFormField returns null when the name matches no field, so check for null before setting .Value or you'll hit a NullReferenceException rather than a font problem.
The Pre-2026.6.1 Workaround
Before these methods existed, SetDefaultFont() on a form field did not control the Tahoma/Arial auto-fallback for non-ASCII text. The only override was to construct the field's DefaultAppearance string by hand:
The format is /{FontName}-{Weight} {FontSize} Tf {R} {G} {B} rg. The named font must already be registered in the document's AcroForm resource dictionary, and the values are raw PDF text operators with no validation.
Notes and Limitations
Document-wide, not per field: all three methods apply across the document. When different fields need different fonts, call SetFormFont once per font variant.
Trigger condition: the auto-fallback only fires when a field's Value is set to a non-ASCII string. Other field updates (renaming, ReadOnly) are unaffected regardless of which option you use.
Font name characters:fontName allows letters, digits, -, _, ., +. A 6-letter PDF subset prefix (e.g. AAAAAA+Poppins-Regular) is accepted and stripped automatically to the canonical name.
Force embed:forceEmbed: true adds a fresh font copy on every call, growing the file each time. Leave it false unless you know the existing embed is stale.
Exceptions:SetFormFont throws ArgumentException for an invalid fontName or fontData. SetFormFontFromFile also throws FileNotFoundException when the path doesn't exist.
Please note: The pre-existing per-field method IFormField.SetDefaultFont(fontName, fontSize, fontColor) is unrelated and unchanged. It sets a field's appearance using a font that must already be installed on the rendering machine, and does not affect the non-ASCII auto-fallback described here.
Equivalent functionality ships in IronPDF Python 2026.6.0.1+ and IronPDF Java 2026.6.1+ under each language's own naming convention (for example Java's FormManager.setFormFont/setFormFontFromFile/disableFormFontFallback, camelCase), which is not verified here to the same standard as the C# signatures above.
Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.