PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Thu Mar 28, 2024 10:48 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: XFont Metrics
PostPosted: Fri Jan 06, 2023 4:39 pm 
Offline

Joined: Thu Jan 05, 2023 12:46 pm
Posts: 2
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


Top
 Profile  
Reply with quote  
 Post subject: Re: XFont Metrics
PostPosted: Mon Jan 09, 2023 11:38 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 909
Location: CCAA
I cannot answer the question, but why not call MeasureString to get the clipping region?

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: XFont Metrics
PostPosted: Wed Jan 11, 2023 8:00 pm 
Offline

Joined: Thu Jan 05, 2023 12:46 pm
Posts: 2
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 179 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group