On 29-Aug-06 Jeff Conrad wrote: > Himanshu, > >> ... i have a project in whcih i need to get the width >> tables from HP laserjet fonts....ie fonts which are stored >> inside the laserjet...... > > I know of no way to query the printer about the metrics for > the built-in fonts. > [...]
Many HP laserjet models have built-in PostScript capability ("emulation"). In theory, the font metrics for built-in PS fonts can be accessed by PostScript commands. E.g. <string> charpath flattenpath pathbox will return 4 real numbers llx lly urx ury being the coordinates of the corners of the boundigbox of <string> in the current coordiante system. Since <string> can be a single character, you can get the BBox for each character in a font, and print it out in a table [formatted by groff, of course!]. There are other commands, such as 'stringwidth' which returns the movement that occurs in the currentpoint between the start and the end of printing the string -- returning Wx and Wy as the horizontal and vertical displacements in userspace coordinates. However, the 'charpath' command (which appends the character path outlines to the current path) will fail if the font outlines are "protected". While (according to the PostScript Reference Manual) protection is LanguageLevel-specific, I would expect that manufacturers might be able to "protect" any fonts they have designed themselves, for instance. So it would be a case of "suck it and see" for any specific model of HP laserjet printer. And I myself have no idea about extracting the font metrics from a non-PostScript HP printer. Best wishes, Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <[EMAIL PROTECTED]> Fax-to-email: +44 (0)870 094 0861 Date: 29-Aug-06 Time: 13:35:32 ------------------------------ XFMail ------------------------------ _______________________________________________ Groff mailing list Groff@gnu.org http://lists.gnu.org/mailman/listinfo/groff