A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
Hi @ISIMobile
This issue has been isolated to the WPF TrueType font-subsetting path. After installing KB5120708, GlyphTypeface.ComputeSubset() may throw a System.IO.FileFormatException when processing certain Windows fonts, including Calibri.
A minimal reproduction is:
var glyphTypeface = new GlyphTypeface(
new Uri(@"C:\Windows\Fonts\calibri.ttf"));
glyphTypeface.ComputeSubset(new ushort[] { 0 });
On an affected system, the second line throws an exception similar to:
System.IO.FileFormatException:
'file:///C:/WINDOWS/FONTS/CALIBRI.TTF'
file does not conform to the expected file format specification.
This confirms that the issue does not require Crystal Reports, Infragistics, PrintDialog, or a complete XPS printing workflow. These components expose the problem because WPF uses font subsetting when serializing or printing XPS content.
The font itself is not necessarily corrupted. It can still be loaded, displayed, and read successfully. The failure occurs specifically during the ComputeSubset() operation in the following path:
MS.Internal.TrueTypeSubsetter.ComputeSubset
System.Windows.Media.GlyphTypeface.ComputeSubset
System.Windows.Xps.Serialization.FEMCacheItem.SubSetFont
Community testing indicates that the following font families may be affected: Calibri, Cambria, Constantia, Corbel.
Fonts reported as working include:
Arial, Segoe UI, Times New Roman, Verdana, Tahoma, Consolas, Candara, Calibri Light.
Testing also indicates a regression between WPF component versions 4.8.9340.0 and 4.8.9344.0, with version 4.8.9344.0 delivered by KB5120708. The same machine, document, and font file work before installing the update and fail after installing it.
Detailed community analysis suggests that the affected fonts contain a large legacy kern table whose stored subtable length cannot accurately represent its actual size. The updated WPF font-subsetting implementation appears to validate this structure more strictly and rejects the font. This analysis is consistent with the available reproduction results, but Microsoft engineering is still investigating, so it should not yet be considered the final official root cause.
As you might know, the only available temporary workarounds are:
- Use an unaffected font Replacing Calibri or another affected font with Arial, Segoe UI, Times New Roman, or another font that subsets successfully may restore printing while keeping the security update installed. This may not be practical for applications with many customized forms or customer-managed templates, and it may affect document layout or pagination.
- Disable font subsetting Developers who directly control XPS serialization may be able to disable font subsetting:
var packagingPolicy = new XpsPackagingPolicy(xpsDocument);
var serializationManager =
new XpsSerializationManager(packagingPolicy, false);
serializationManager.SetFontSubsettingPolicy(
FontSubsetterCommitPolicies.None);
serializationManager.SaveAsXaml(document);
This workaround should be tested carefully. Disabling subsetting may embed complete fonts, potentially multiple times, and can significantly increase XPS or PDF file size, memory usage, and processing time.
- Remove KB5120708 Removing KB5120708 has been reported to restore functionality. However, KB5120708 is a security update, and uninstalling it may remove important security protections or conflict with organizational patching policies. Therefore, uninstalling the update is not recommended as a preferred or long-term solution.
Microsoft is actively investigating this regression. The available workarounds are temporary mitigations and may not be practical at scale. We will update this thread when an official resolution or additional guidance becomes available.
If this explanation and the diagnostic steps were helpful, I would appreciate it if you could follow the instructions here, so that others experiencing similar behavior can benefit from the answer as well.