Stuff
public text v1 · immutable internal override bool GetFontMetrics(Graphics g, Font font, out int ascent, out int descent) {
IntPtr dc;
TEXTMETRIC tm;
tm = new TEXTMETRIC();
dc = Win32GetDC(IntPtr.Zero);
Win32SelectObject(dc, font.ToHfont()); <-- Crashes here
if (Win32GetTextMetrics(dc, ref tm) == false) {
Win32ReleaseDC(IntPtr.Zero, dc);
ascent = 0;
descent = 0;
return false;
}
Win32ReleaseDC(IntPtr.Zero, dc);
ascent = tm.tmAscent;
descent = tm.tmDescent;
return true;
}