View previous topic :: View next topic |
Author |
Message |
ridaria
Joined: 03 Nov 2008 Posts: 8
|
Posted: Mon Nov 17, 2008 9:46 am Post subject: The Unit of Font |
|
|
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 |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Mon Nov 17, 2008 12:38 pm Post subject: |
|
|
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 |
|
|
ridaria
Joined: 03 Nov 2008 Posts: 8
|
Posted: Mon Nov 17, 2008 2:59 pm Post subject: i was tolking about ..... |
|
|
i was tolking about:
Dim fontArialNARROW8_BOLD As New System.Drawing.Font("Arial Narrow", ConvertiPuntiInMillimetri(, FontStyle.Bold, GraphicsUnit.Point)
on it i get the error.
) |
|
Back to top |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Mon Nov 17, 2008 3:28 pm Post subject: |
|
|
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 |
|
|
ridaria
Joined: 03 Nov 2008 Posts: 8
|
Posted: Mon Nov 17, 2008 5:27 pm Post subject: I use a function |
|
|
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 |
|
|
Thomas Hoevel
Joined: 16 Oct 2006 Posts: 387 Location: Cologne, Germany
|
Posted: Tue Nov 18, 2008 9:45 am Post subject: Re: I use a function |
|
|
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 |
|
|
|