Another one:
Happens with truetype Barcode fonts.
PdfSharp\PdfSharp.Fonts.OpenType\OpenTypeDescriptor.cs
Code:
void Initialize()
{
......
if (fontData.os2.sTypoDescender != 0)
{
this.descender = fontData.os2.usWinDescent;
Debug.Assert(this.descender > 0, "PDFsharp internal: Font with non positive ascender value found.");
// Force sign from hhea.descender
// TODO:
this.descender = Math.Abs(this.descender) * Math.Sign(fontData.hhea.descender);
}
else
this.descender = fontData.hhea.descender;
// original: Debug.Assert(this.descender < 0, "PDFsharp internal: Ascender should be less than 0.");
// new: In some fonts (i.e. Barcode fonts) descender may be 0
Debug.Assert(this.descender <= 0, "PDFsharp internal: Descender should be less than 1.");
......
}