FontFamily font metrics compatible functions #299
-
Since System.Drawing.Common is dead (=runtime exceptions galore), it would be benefical to provide methods compatible with FontFamily metrics for easier migration from System.Drawing.Common to SixLabors.Fonts.
I looked through the code and it seems that the reflection of OS2Table is currently the only way. Use case: In my case, I need to be compatible with the Excel adjust-cell-size-to-content that uses FontFamily values. I will take reflection, but compatible API would be nice. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
These properties already exist in the You want the normalised values as there are properties within a font file which determine which metric to use. In addition some fonts miss certain metrics which require replacement values to be calculated based on known conventions. There no benefit to us exposing the internal metrics. TL;DR System.Drawing is wrong. Six Labors and FontForge are correct. |
Beta Was this translation helpful? Give feedback.
These properties already exist in the
FontMetrics
type which is a property of theFont
type. https://docs.sixlabors.com/api/Fonts/SixLabors.Fonts.FontMetrics.htmlYou want the normalised values as there are properties within a font file which determine which metric to use. In addition some fonts miss certain metrics which require replacement values to be calculated based on known conventions.
There no benefit to us exposing the internal metrics.
TL;DR System.Drawing is wrong. Six Labors and FontForge are correct.