PRow, PCol positon of prinetr head

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

PRow, PCol positon of prinetr head

Post 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
With best regards,
Sudip
User avatar
Rathinagiri
Posts: 5471
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Contact:

Re: PRow, PCol positon of prinetr head

Post 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.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
User avatar
sudip
Posts: 1454
Joined: Sat Mar 07, 2009 11:52 am
Location: Kolkata, WB, India

Re: PRow, PCol positon of prinetr head

Post 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 :lol: So, I can't tell the exact time. But, believe me I am using my favorite watch only for checking time :lol: )

Thank you all.

Regards.

Sudip
With best regards,
Sudip
Post Reply