0

I have problems with positioning within the DrawString method. However, only on the X axis. No matter what value I recommend for the distance from above - it fits. Therefore, I assume that I have made everything right. For example, An X in Arial with font size 10, the letter is slightly more than 0.5 mm too far right. If I try it with font size 600, it is more than 35 mm too far right. I suspect that something has to be adjusted depending on the font size and it has nothing to do with the dimensions of the Graphics object. Does anyone have ideas / experiences / a formula?

If code examples are needed, I can supply them.

  • 2
    _If code examples are needed, I can supply them._. That would go well to providing a [mcve] so please do include your code examples. – Bugs Jul 05 '17 at 13:56
  • 1
    Your code is almost always needed since only having a description usually doesn't give us the full picture. For your specific question a screenshot showing your problem along with your code _**(code posted as plain text!)**_ would be the best. – Visual Vincent Jul 05 '17 at 15:07
  • In my Sub that `handles Me.PrintPage` I set `ThisGraphics = e.Graphics` `ThisGraphics.PageUnit = GraphicsUnit.Millimeter` While Printing: `NewStartPositionX = StartPositionX - OffsetX()` `ThisGraphics.DrawString(Text, Font, Brush, NewStartPositionX, NewStartPositionY)` `OffsetX()` returns `CInt(PrintArea.X * FactorInch) \ 100 + ThisGraphics.Transform.OffsetX` That works fine with the NewStartPositionY – DerIgelJohnWo Jul 06 '17 at 09:07
  • _the letter is slightly more than 0.5 mm too far right_ - this is meaningless without some context. The letter is 0.5mm too far to the right of _what_? I cannot understand what your problem is. Also, don't add code to comments. Please _edit_ your question and supply the code there. – Chris Dunaway Jul 06 '17 at 13:55

0 Answers0