question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Invalid glyph format when performing FontCollection.Install

See original GitHub issue

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of Fonts
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

When executing the lines of code below, on my development environment (.net5.0 on macOS with Rider), the below happens.

Exception

InvalidFontFileException: Invalid glyph format, only TTF glyph outlines supported

Callstack

SixLabors.Fonts.FontReader..ctor(Stream stream, TableLoader loader)
SixLabors.Fonts.FontReader..ctor(Stream stream)
SixLabors.Fonts.FontDescription.LoadDescription(string path)
SixLabors.Fonts.FileFontInstance..ctor(string path, long offset)
SixLabors.Fonts.FileFontInstance..ctor(string path)
SixLabors.Fonts.FontCollection.InstallInternal(string path, CultureInfo culture, out FontDescription fontDescription)
SixLabors.Fonts.FontCollection.InstallInternal(string path, CultureInfo culture)
SixLabors.Fonts.FontCollection.Install(string path)

Steps to Reproduce

Code

var fonts = new FontCollection();
var lightFamily = fonts.Install(Path.Combine(_hostingEnvironment.WebRootPath, "fonts/merkury_bold.otf"));

System Configuration

  • Fonts version: nuget 1.0.0-beta15
  • Other Six Labors packages and versions: SixLabors.ImageSharp==1.0.4, SixLabors.ImageSharp.Drawing==1.0.0-beta13, SixLabors.ImageSharp.Web==1.0.4
  • Environment (Operating system, version and so on): macOS Big Sur (11.6)
  • .NET Framework version: 5.0
  • Additional information: Similar issue reported #29 , but that was with SystemFonts, as was closed as fixed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
SamVanhouttecommented, Mar 8, 2022

So, that probably means, you can close this issue, as it is related to my lack of understanding/knowledge on font-specifics. Thanks for your feedback and help!
And appreciating the work you guys deliver ❤️

1reaction
tocsoftcommented, Mar 8, 2022

The fact its an *.otf rather than *.ttf is the big give away that its unlikely to be a compatible font. *.ttf is technically a subset of *.otf fonts with a very specific way of storing the glyph outlines.

That font contains CFF outline data (as can be determined by looking at the first 4 bytes of the file spelling OTTO in ascii) which we do not have support for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mac error: Invalid glyph format, only TTF glyph outlines ...
Trying to get any font from the system collection results in the above error on a Mac. Windows is working fine.
Read more >
Troubleshooting a font that does not export
Sometimes, you want to export a font and you get weird error messages instead. Here is how to fix that.
Read more >
How to install OS X *.TTC font on Windows? Error
"Cannot install (FONTNAME).ttc - The file '(FONTNAME).ttc' does not appear to be a valid font." Can *.TTC format font files be installed ......
Read more >
View topic - Private fonts sample for asp.net?
It seems no matter what I try, I always get the error "Font with the specified family name does not exist" on the...
Read more >
Character Formatting Extensions with DirectWrite
This is a display of all the glyphs in the selected font file. These glyphs are directly addressable by index if you use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found