You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.TypeLoadException: Cannot marshal field 'Reserved' of type 'SharpFont.TrueType.lnternal.HoriHeaderRec': This type can only be marshaled in restricted ways.
at System.Runtime.lnteropServices.Marshal.PtrToStructureHelper(lntPtr ptr, Object structure, Boolean allowValueClasses)
at System.Runtime.lnteropServices.Marshal.PtrToStructure(lntPtr ptr, Type structureType)
at SharpFont.PlnvokeHelper.PtrToStructure[T](lntPtr reference)
at SharpFont.TrueType.HoriHeader.set_Reference(lntPtr value)
at SharpFont.TrueType.HoriHeader..ctor(lntPtr reference)
at SharpFont.Face.GetSfntTable(SfntTag tag)
I'm trying to get to get access to the LineGap of a font which seems to be present only in the vertical and horizontal headers. The vertical header loads fine.
The text was updated successfully, but these errors were encountered:
I updated the repro code to include how the font is loaded.
After fiddling around with it today I found that this is only a problem in the SharpFont build included in the MonoGame pipeline. It works fine when I use the nuget package SpaceWizards.SharpFont. (the more official SharpFont package does not work on modern .NET versions: #126)
Crash in
Face
when trying to read the horizontal header of a TrueType font.This results in the following error:
I'm trying to get to get access to the
LineGap
of a font which seems to be present only in the vertical and horizontal headers. The vertical header loads fine.The text was updated successfully, but these errors were encountered: