point of sale - Verifone vx520 change printer font -
i want change verifone vx520 internal printer font. have written program in c , used font designer tool creating printer font. have used <esc>m<s><t>
command download font table still can't change printer's font. how can it?
rather using straight escape sequences, may consider using "p3700_" functions on 520. specifically, want p3700_dnld_font_file() , p3700_select_font().
according documentation:
#include <printer.h> short p3700_dnld_font_file(short handle, //the open printer handle short h_font_file, //the open file handle short font_table //font table select ); short p3700_select_font(short h_comm_port, // open printer handle short font_size, // size of font short font_table // font table select );
the documentation has part of example program (modified slightly):
//variable declarations int handle; // file handle printer open_block_t parm; // structure fill comm parameters com port int h_font_file; // handle font file //open printer handle = open("/dev/com4", 0); //initialize printer memset(&parm,0,sizeof(parm)); parm.rate = rt_19200; // itp set 19200 baud parm.format = fmt_a8n1 | fmt_auto |fmt_rts; // itp set @ 8n1 parm.protocol = p_char_mode; parm.parameter = 0; set_opn_blk(handle, &parm); svc_wait(200); p3700_init(handle, 6); svc_wait(100); // download 16x16 printer font file containing 128 chars offset 0 127 h_font_file = open("16x16.pft", o_rdonly); // download printer font file @ font table 1 p3700_dnld_font_file (handle, h_font_file, 1); strcpy((char *)printbuf,(const char *)"printing 16x16 font\n\n"); p3700_print(handle, printbuf); p3700_select_font(handle, 0x01, 1); // 0x01 corresponds 16x16 font size p3700_print(handle, printbuf);
i have tested both p3700_ print functions , p3300_ functions , both seem work fine. few notes troubleshooting:
- make sure have
#include <printer.h>
in code - when saving font file, select correct printer type. if using
p3700
function calls, save "verix 37xx" printer type. if usingp3300
calls, save "verix 33xx". - if copying example code, you'll need make sure custom font size 16x16 , save font table 1 (select font table on same dialog select printer type). if different, you'll need change
p3700_select_font
accordingly. - be sure remember download font terminal.
- check return values of function. example,
open
should return positive file handle number ,p3700_dnld_font_file
should return number of font characters downloaded, etc.
here similar question , answer regarding printing graphics.
if want stick escape sequences, i'm not sure getting <esc>m<s><t>
from. 23230_verix_v_operating_system_programmers_manual shows:
<esc>m<c><r1>...<rn>; downloads fonts memory.
and then
<esc>l<s><t>; selects font table printing , downloading.
personally, tend avoid escape sequences other toggling double wide, double height , inverse.
Comments
Post a Comment