HP 4 FAMILY User Manual

Page 90

Advertising
background image

#include <stdio.h>

#include <fcntl.h>

#define MONTH "\202P\202P\214\216"

#define DAY1 "\202P\202U\223\372"

#define TILDE "\201\140"

#define DAY2 "\202P\202V\223\372"

#define KANJITXT MONTH DAY1 TILDE MONTH DAY2

FILE *prn;

main()

{

int point_size=24;

prn = fopen("lpt1","wb"); /* open lpt1 for writing */

fprintf(prn,"\33%%-12345X"); /* send UEL to get to PJL */

fprintf(prn,"@PJL ENTER LANGUAGE=PCL\n"); /* Enter PCL */

fprintf(prn,"\33E"); /* send an esc E to reset printer */

fprintf(prn,"\33&a4L"); /* left margin */

fprintf(prn,"\33&t31P"); /* text parsing = Shift-JIS */

fprintf(prn,"\33(19K"); /* symbol set = Win3.1J */

fprintf(prn,"\33(s1p%dv0s0b28752T",point_size); /* MS-Mincho */

fprintf(prn,"\n\n\n\r" KANJITXT); /* print horizontal version */

fprintf(prn,"\33&c-1T"); /* select vertical writing */

fprintf(prn,"\n\n\n\r" KANJITXT); /* print vertical version */

fprintf(prn,"\f"); /* formfeed */

fprintf(prn,"\33%%-12345X"); /* send UEL to get to PJL */

}

Printing Ruby Characters (Furigana)

Ruby characters, also known in Japanese as furigana,
are small characters typically used as an aid in kanji
pronunciation. Ruby characters are usually (but not
always) hiragana. They are generally placed above the
corresponding kanji in horizontal writing and to the right
in vertical writing. Ruby characters can be generated using
font scaling and cursor positioning commands.

An example of ruby characters is shown below. In this
example, the ruby characters are printed at one-third the
size of the kanji. The C program that follows was used to
generate the PCL commands for this example.

2-54 Printer-Specific Differences

Advertising