PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

XFont Metrics
http://forum.pdfsharp.com/viewtopic.php?f=2&t=4412
Page 1 of 1

Author:  jmucchiello [ Fri Jan 06, 2023 4:39 pm ]
Post subject:  XFont Metrics

XFont.CellDescent, which I assume maps to XFont.Metrics.Descent, returns a "int". What is that int? Is it in points? twips? inches?

When you call XGraphics.DrawString with XPoint and BaseLineLeft, the location passed in the XPoint is where the baseline of the font starts. So if I wanted to create a clip region, I somehow would need to create an XRect such that XRect.Bottom of the clip region is at least the XPoint.Y + XFont.CellDescent. But I have no idea what CellDescent represents, or why it is an Integer when all the other location data uses doubles.

Thanks

Author:  TH-Soft [ Mon Jan 09, 2023 11:38 am ]
Post subject:  Re: XFont Metrics

I cannot answer the question, but why not call MeasureString to get the clipping region?

Author:  jmucchiello [ Wed Jan 11, 2023 8:00 pm ]
Post subject:  Re: XFont Metrics

TH-Soft wrote:
I cannot answer the question, but why not call MeasureString to get the clipping region?


That doesn't line up the baseline of one line of text with another. Some fonts are weird and have descenders that vary by glyph.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/