SixLabors / Fonts

:black_nib: Font loading and layout library.
https://sixlabors.com/products/fonts
Other
305 stars 69 forks source link

Problem with font "PMINGLIU.ttf", InvalidFontTableException: 'Unable to find table' #333

Closed IshmaZX82 closed 1 year ago

IshmaZX82 commented 1 year ago

Description

An error occurs when trying to use the font "PMINGLIU": SixLabors.Fonts.InvalidFontTableException: 'Unable to find table'

This exception was originally thrown at this call stack:
    SixLabors.Fonts.FontReader.GetReaderAtTablePosition(string)
    SixLabors.Fonts.Tables.General.VerticalMetricsTable.Load(SixLabors.Fonts.FontReader)
    SixLabors.Fonts.Tables.TableLoader.Load<TTable>(SixLabors.Fonts.FontReader)
    SixLabors.Fonts.FontReader.TryGetTable<TTableType>()
    SixLabors.Fonts.StreamFontMetrics.LoadTrueTypeFont(SixLabors.Fonts.FontReader)
    SixLabors.Fonts.StreamFontMetrics.LoadFont(string, long)
    System.Lazy<T>.ViaFactory(System.Threading.LazyThreadSafetyMode)

In the properties of the font, you can see the line: SubscriptXOffset = {"Unable to find table"}

Steps to Reproduce

var textOptions = new SixLabors.Fonts.TextOptions(sixFont);
var text = "文字測試文字測試文字測試文字測試文字測試";
var rect = SixLabors.Fonts.TextMeasurer.Measure(text, textOptions);

Font: PMINGLIU.zip

System Configuration