Page 1 of 1
PRow, PCol positon of prinetr head
Posted: Tue Jul 07, 2009 3:16 pm
by sudip
Hi All,
Is there any way to know:
1. Prow() and Pcol() ie, co-ordinate of printer head.
2. Height and width of a particular piece of text for a specific font.
Thanks in advance.
With best regards.
Sudip
Re: PRow, PCol positon of prinetr head
Posted: Tue Jul 07, 2009 6:02 pm
by Rathinagiri
Regarding the first question, I don't know.
For the second question, there is a way. I had already mentioned
here.
A font's size is specified in units called points. A point is .013837 of an inch. Following the point system devised by Pierre Simon Fournier, it is common practice to approximate a point as 1/72 inch. So, the height of a font of 12 points is 12/72*25.4 mm.
Regarding the length, I had used a handy function in grid2print utility. Even though it is an approximation, it works at 99% accuracy.
Code: Select all
function printLen( cString,nFontsize,cFontname)
return round(gettextwidth(Nil,cString,cFontname)*0.0254*nFontsize,2)
This function returns the width of a given text in mm once you pass on the parameters string, fontsize and fontname.
Re: PRow, PCol positon of prinetr head
Posted: Wed Jul 08, 2009 12:30 pm
by sudip
Hello Rahi,
Oh, yes! I forgot it.
Sorry for for repeating query
I hope following functions (created by you) will be helpful regarding prow(), pcol()
Code: Select all
unction c2mm(ncol)
return (ncol/80 * 210) // 80 is the number of columns in your old dos application. 210 is the width of the paper in windows.
Function R2mm(nRow)
return (nRow/66 * 297) // 66 is the number of rows in the old dos app. 297 is the height of paper
(Esgici, my brother, you guess the reason of my forgetfulness. Yes, using 3/4 watches

So, I can't tell the exact time. But, believe me I am using my favorite watch only for checking time

)
Thank you all.
Regards.
Sudip