PDFsharp & MigraDoc Foundation

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

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
PostPosted: Thu Jul 26, 2007 12:04 am 
Offline

Joined: Fri Jul 20, 2007 8:41 pm
Posts: 5
This code:

Code:
Paragraph p = row.Cells[1].AddParagraph(signee);
p.Format.Font.Name = "Monotype Corsiva";


Throws the following exception when rendered:
Quote:
"Font 'Monotype Corsiva' does not support style 'Regular'."


And the stacktrace:
Quote:
at System.Drawing.Font.CreateNativeFont()
at System.Drawing.Font.Initialize(FontFamily family, Single emSize, FontStyle style, GraphicsUnit unit, Byte gdiCharSet, Boolean gdiVerticalFont)
at System.Drawing.Font..ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit)
at PdfSharp.Drawing.XFont.Initialize()
at PdfSharp.Drawing.XFont..ctor(String familyName, Double emSize, XFontStyle style, XPdfFontOptions pdfOptions)
at MigraDoc.Rendering.FontHandler.FontToXFont(Font font, PdfFontEncoding encoding, PdfFontEmbedding fontEmbedding)
at MigraDoc.Rendering.ParagraphRenderer.get_CurrentFont()
at MigraDoc.Rendering.ParagraphRenderer.CalcCurrentVerticalInfo()
at MigraDoc.Rendering.ParagraphRenderer.InitFormat(Area area, FormatInfo previousFormatInfo)
at MigraDoc.Rendering.ParagraphRenderer.Format(Area area, FormatInfo previousFormatInfo)
at MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
at MigraDoc.Rendering.FormattedCell.Format(XGraphics gfx)
at MigraDoc.Rendering.TableRenderer.FormatCells()
at MigraDoc.Rendering.TableRenderer.InitFormat(Area area, FormatInfo previousFormatInfo)
at MigraDoc.Rendering.TableRenderer.Format(Area area, FormatInfo previousFormatInfo)
at MigraDoc.Rendering.TopDownFormatter.FormatOnAreas(XGraphics gfx, Boolean topLevel)
at MigraDoc.Rendering.FormattedDocument.Format(XGraphics gfx)
at MigraDoc.Rendering.DocumentRenderer.PrepareDocument()
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareDocumentRenderer(Boolean prepareCompletely)
at MigraDoc.Rendering.PdfDocumentRenderer.PrepareRenderPages()
at MigraDoc.Rendering.PdfDocumentRenderer.RenderDocument()
at PMD.ManufacturingStudio.ProductionBuildModule.MSDocumentBase.RenderAndSaveDocument(String filename)
at PMD.ManufacturingStudio.ProductionBuildModule.BuildOrderDocument.CreateDocument(String filename)
at PMD.ManufacturingStudio.ProductionBuildModule.BuildOrdersViewPresenter.PrintOrder(BuildOrder buildOrder)


Anyone have any ideas for me? Am I doing this wrong?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu Jul 26, 2007 8:03 am 
Offline
PDFsharp Guru
User avatar

Joined: Mon Oct 16, 2006 8:16 am
Posts: 3095
Location: Cologne, Germany
I had no problem when I chose that font in our application today.
I selected the font in our GUI - and there really is no regular style available, so I could only choose "italic" or "bold italic".

It should work if you set "Italic = true".

I think the exception is a bug that needs to be fixed; use "Italic = true" as a workaround.

_________________
Regards
Thomas Hoevel
PDFsharp Team


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri Jul 27, 2007 3:25 pm 
Offline

Joined: Fri Jul 20, 2007 8:41 pm
Posts: 5
Thomas,

Thank you for the reply. You are correct, changing Italic = true solved the problem. Looking back now it makes sense, it Word the only option was Italic.

Thanks for the hlp,
Steve


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: Google [Bot] and 147 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