PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The Unit of Font

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
ridaria



Joined: 03 Nov 2008
Posts: 8

PostPosted: Mon Nov 17, 2008 9:46 am    Post subject: The Unit of Font Reply with quote

Hi,

i'm tring to use the unit of font as Point but the systeme give me an error:

Must use "GraphicsUnit.World".

Why a can't use GraphicsUnit.Point???????



Thank you

Riccardo
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon Nov 17, 2008 12:38 pm    Post subject: Reply with quote

Hi!

I don't know - that code is not executed in our application.
I'd expect font sizes to be in Points anyway.

You could replace the code (in XFont.cs)
Code:
if (font.Unit != GraphicsUnit.World)
  throw new ArgumentException("Font must use GraphicsUnit.World.");

with the following
Code:
if (font.Unit != GraphicsUnit.World && font.Unit != GraphicsUnit.Point)
  throw new ArgumentException("Font must use GraphicsUnit.World or GraphicsUnit.Point.");

and see what happens.
Maybe it'll work, maybe the line
Code:
this.size = font.Size;

requires some modification.

I think it'll work.
Please let us know whether it works or not (if it does, this change will be included with the next release).
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
ridaria



Joined: 03 Nov 2008
Posts: 8

PostPosted: Mon Nov 17, 2008 2:59 pm    Post subject: i was tolking about ..... Reply with quote

i was tolking about:

Dim fontArialNARROW8_BOLD As New System.Drawing.Font("Arial Narrow", ConvertiPuntiInMillimetri(Cool, FontStyle.Bold, GraphicsUnit.Point)



on it i get the error.
)
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Mon Nov 17, 2008 3:28 pm    Post subject: Reply with quote

Yep.
With a li'l change in XFont.cs (as described above) you won't get that error.

Or create the font as
Code:
Dim fontArialNARROW8_BOLD As New System.Drawing.Font("Arial Narrow", 8, FontStyle.Bold, GraphicsUnit.World)

and see if it works.

BTW: Why do you call "ConvertiPuntiInMillimetri" if you specify "GraphicsUnit.Point"?
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
ridaria



Joined: 03 Nov 2008
Posts: 8

PostPosted: Mon Nov 17, 2008 5:27 pm    Post subject: I use a function Reply with quote

I use the function ConvertiPuntiInMillimetri because of the unit in font!!!!!

Using GraficUnit.World the routine use millimetres because in the begin of routine i have setted page unit in Millimetres!!!
Dim gfx As XGraphics = XGraphics.FromPdfPage(page, XGraphicsUnit.Millimeter) as you suggest me!

I hope you understand, il you speack italian I could explain you, or in Deutche when my wife will be Here!


Thanks!

But:

Dim fontArial8 As New System.Drawing.Font("Arial", 8, FontStyle.Regular, GraphicsUnit.Point)
DOESN't WORK!!!!!

He said Must Use GraphicsUnit.World WHYYYYY!!!!!!!!!!
Back to top
View user's profile Send private message
Thomas Hoevel



Joined: 16 Oct 2006
Posts: 387
Location: Cologne, Germany

PostPosted: Tue Nov 18, 2008 9:45 am    Post subject: Re: I use a function Reply with quote

ridaria wrote:
Dim fontArial8 As New System.Drawing.Font("Arial", 8, FontStyle.Regular, GraphicsUnit.Point)
DOESN't WORK!!!!!

No need to shout!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

This is not the code snippet I suggested.

ConvertiPuntiInMillimetri sounds like "ConvertPointsToMillimetres" to me. Right?
If so, specifying "GraphicsUnit.Point" makes no sense!

Using GraphicsUnit.World you won't get an error.
_________________
Regards
Thomas Hoevel
PDFsharp Team
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com