S D

S D

  • 2.1k
  • 71
  • 2.9k

How to Calculate the Space between two Characters in GDI + ?

Mar 3 2015 6:08 AM

I am Drawing the set of characters in Graphics, by Calculating the points using GraphicsPath for each Character. I Need to know how to calculate the distance should be given between the two characters?

I am using this code to generate points

PointF [] pnts;

var p=new GraphicsPath();

path.AddString("A","Arial",(int)FontStyle.Regular,50,new pointF(0f,0f),StringFormat.GenericDefault);

Matrix m=new Matric(1,0,0,1,0,0);

path.Flatten(m,1,0f);

pnts=path.pathpoints;

i am getting the points for all characters using the above code.

Now i am combining the two character Using the points generated by the above code. Eg "AB"

Help me to calculate the the character space should be given between two characters?