Home  >  Article  >  Backend Development  >  php-extension - create_font method in php_printer.dll, the relationship between font width and height units and printing paper width

php-extension - create_font method in php_printer.dll, the relationship between font width and height units and printing paper width

WBOY
WBOYOriginal
2016-07-06 13:54:071144browse

Use php_printer.dll to connect to the printer, which has a method to create fonts

<code>printer_create_font ( string face, int height, int width, int font_weight, bool italic, bool underline, bool strikeout, int orientaton)</code>

What are the units of the second parameter height and the third parameter width, and what is their relationship with the width and height of the printer paper?

Because you want to center the text on the printing paper, you need to calculate the x and y coordinate values ​​when printing using the printer_draw_text method, so you need to know the width value of the printing paper relative to the width of this font size. Please advise!

Reply content:

Use php_printer.dll to connect to the printer, which has a method to create fonts

<code>printer_create_font ( string face, int height, int width, int font_weight, bool italic, bool underline, bool strikeout, int orientaton)</code>

What are the units of the second parameter height and the third parameter width, and what is their relationship with the width and height of the printer paper?

Because you want to center the text on the printing paper, you need to calculate the x and y coordinate values ​​when printing using the printer_draw_text method, so you need to know the width value of the printing paper relative to the width of this font size. Please advise!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn