PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

More space is added between words - pdfsharp
https://forum.pdfsharp.net/viewtopic.php?f=2&t=4026
Page 1 of 1

Author:  NAGG123 [ Wed Oct 09, 2019 5:48 am ]
Post subject:  More space is added between words - pdfsharp

Hi ,

Currently i am using pdfSharp for creating table structure
I am using
XTextFormatter.Alignment = XParagraphAlignment.Left;
XTextFormatter.DrawString(text, XFont, XBrushes.Black, rect, XStringFormats.TopLeft);
rect has the calculated value of height and width

Now issue is "more space is added beween words for all the columns"
what could be the issue here?

Note: I am using private Fonts

please refere attached screenshot.
Thanks

Attachments:
space.png
space.png [ 2.95 KiB | Viewed 3514 times ]

Author:  Thomas Hoevel [ Wed Oct 09, 2019 8:28 am ]
Post subject:  Re: More space is added between words - pdfsharp

Hi!
NAGG123 wrote:
Note: I am using private Fonts
Not repro.
See also:
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

Maybe a different font is used for measuring and for drawing. This would explain the big spaces.

Author:  NAGG123 [ Mon Nov 04, 2019 9:14 am ]
Post subject:  Re: More space is added between words - pdfsharp

Thanks Thomas for your response.

But I dont see any space issue when i use below code with my custom fonts (refer attached image)
XGraphics.DrawString(Text, Font, XBrushes.Black, X, Y, XStringFormats.CenterLeft);

Just to crosscheck on Font, i tried using Arial font instead of my custom font
but i still see same space issue with Arial Font style when it is used with XTextFormatter.DrawString()


What could be the issue here?
Thanks

Attachments:
no_space.png
no_space.png [ 2.82 KiB | Viewed 3492 times ]
space2.png
space2.png [ 3.59 KiB | Viewed 3499 times ]

Author:  Thomas Hoevel [ Mon Nov 04, 2019 9:36 am ]
Post subject:  Re: More space is added between words - pdfsharp

NAGG123 wrote:
What could be the issue here?
Maybe a different font is used for measuring and for drawing. This would explain the big spaces.

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