PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Fri Apr 19, 2024 11:57 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Arabic text draw problem
PostPosted: Thu Aug 05, 2010 2:14 pm 
Offline

Joined: Tue Jun 08, 2010 6:12 pm
Posts: 13
I am currently having some problems drawing with Arabic text. If I use the DrawString() approach of drawing the text then everything looks correct (I can't read Arabic but it matches the bitmap of what the client said it should look like).

However, I also have the requirement of drawing a halo behind the text. To do this I add the text to a graphics path and then use DrawPath() to render the text. When I do this, the spacing between the characters are incorrect and the text is drawn backwards.

I believe read in another post that there is some problem with Arabic text. Is this part of the problem, or am I doing something wrong in the code?

//create the font
XPdfFontOptions options = new XPdfFontOptions(PdfFontEncoding.Unicode);
XFont pdfFont = new XFont(faceName, height, fontStyle, options);

...

if (objHaloGMMPPenWrapper != null)
{
...

XGraphicsPath xgp = new XGraphicsPath();
xgp.AddString(text, pdfFont.FontFamily, pdfFont.Style, height, haloPoint, XStringFormats.Default);
xgp.FillMode = XFillMode.Winding;

//draw the halo
if (orientation != 0)
{
gfx.RotateAtTransform(orientation, pdfPoint);
gfx.DrawPath(haloPen, haloBrush, xgp);
//we will also have to take a glyph approach to drawing the actual text
//the PDF Text Rendering and Path Rending do not match if the text has a style
gfx.DrawPath(textPen, pdfBrush, xgp);
gfx.RotateAtTransform(-orientation, pdfPoint);
}
else
{
...
}
}

Thanks
Craig


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 08, 2010 8:52 am 
Offline
PDFsharp Expert
User avatar

Joined: Wed Dec 09, 2009 8:59 am
Posts: 340
jccapps wrote:
I believe read in another post that there is some problem with Arabic text.

That's not my area of expertise.
PDFsharp doesn't yet support right-to-left character sets.

_________________
Öhmesh Volta ("() => true")
PDFsharp Team Holiday Substitute


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 208 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