escpos-php icon indicating copy to clipboard operation
escpos-php copied to clipboard

escpos custom font error

Open keophilavanh opened this issue 2 years ago • 1 comments
trafficstars

help me how i can do

` $profile = CapabilityProfile::load("default"); $buffer = new ImagePrintBuffer(); $buffer -> setFont(DIR . '/../../phetsarath_ot.ttf'); $buffer -> setFontSize(12);

$printer = new Printer($connector);

$printer -> setPrintBuffer($buffer); $printer -> text("ລະບົບຮ້ານອາຫານ\n");`

image

keophilavanh avatar Jun 14 '23 11:06 keophilavanh

HI Please try modifying ImagePrintBuffer.php line 95 $image -> newImage($metrics['textWidth'], $metrics['textHeight'], $background); change to $image -> newImage( (int) $metrics['textWidth'], (int) $metrics['textHeight'], $background);

sailboat0820 avatar Jan 23 '24 03:01 sailboat0820