Back to index

tetex-bin  3.0
print_routines.c
Go to the documentation of this file.
00001 /* print_routines.c: higher-level routines for printing OPL and OVP files.
00002 
00003 This file is part of Omega,
00004 which is based on the web2c distribution of TeX,
00005 
00006 Copyright (c) 1994--2001 John Plaice and Yannis Haralambous
00007 
00008 Omega is free software; you can redistribute it and/or modify
00009 it under the terms of the GNU General Public License as published by
00010 the Free Software Foundation; either version 2 of the License, or
00011 (at your option) any later version.
00012 
00013 Omega is distributed in the hope that it will be useful,
00014 but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 GNU General Public License for more details.
00017 
00018 You should have received a copy of the GNU General Public License
00019 along with Omega; if not, write to the Free Software Foundation, Inc.,
00020 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00021 
00022 */
00023 
00024 #include "cpascal.h"
00025 #include "list_routines.h"
00026 #include "manifests.h"
00027 #include "print_routines.h"
00028 #include "header_routines.h"
00029 #include "out_routines.h"
00030 #include "error_routines.h"
00031 #include "omfonts.h"
00032 
00033 void
00034 print_check_sum(void)
00035 {
00036     left();
00037     out("CHECKSUM");
00038     out(" "); out_num(check_sum);
00039     right();
00040 }
00041 
00042 void
00043 print_design_size(void)
00044 {
00045     left();
00046     out("DESIGNSIZE");
00047     out(" "); out_fix(design_size);
00048     right();
00049 }
00050 
00051 void
00052 print_design_units(void)
00053 {
00054     left();
00055     out("DESIGNUNITS");
00056     out(" "); out_fix(design_units);
00057     right();
00058 }
00059 
00060 void
00061 print_coding_scheme(void)
00062 {
00063     left();
00064     out("CODINGSCHEME");
00065     out(" "); out(coding_scheme);
00066     right();
00067 }
00068 
00069 void
00070 print_family(void)
00071 {
00072     left();
00073     out("FAMILY");
00074     out(" "); out(family);
00075     right();
00076 }
00077 
00078 void
00079 print_face(void)
00080 {
00081     left();
00082     out("FACE");
00083     out(" ");
00084     if ((face >= F_MIN) && (face <= F_MAX)) print_xerox_face(face);
00085     else out_num(face);
00086     right();
00087 }
00088 
00089 void
00090 print_seven_bit_safe_flag(void)
00091 {
00092     left();
00093     out("SEVENBITSAFEFLAG"); out(" ");
00094     if (seven_bit == 1) out("TRUE");
00095     else if (seven_bit == 0) out("FALSE");
00096     else internal_error_1("print_seven_bit_safe_flag (seven_bit=%d)", seven_bit);
00097     right();
00098     
00099 }
00100 
00101 void
00102 print_header_word(unsigned val1, unsigned val2)
00103 {
00104     left();
00105     out("HEADER");
00106     out(" "); out_int(val1,10);
00107     out(" "); out_num(val2);
00108     right();
00109 }
00110 
00111 void
00112 print_font_dimension(void)
00113 {
00114     left();
00115     out("FONTDIMEN"); out_ln();
00116 }
00117 
00118 void
00119 print_ligature_table(void)
00120 {
00121     left();
00122     out("LIGTABLE"); out_ln();
00123 }
00124 
00125 void
00126 print_boundary_character(unsigned val)
00127 {
00128     left();
00129     out("BOUNDARYCHAR");
00130     out(" "); out_num(val);
00131     right();
00132 }
00133 
00134 void
00135 print_character(unsigned val)
00136 {
00137     left();
00138     out("CHARACTER");
00139     out(" "); out_char(val); out_ln();
00140 }
00141 
00142 void
00143 print_parameter(unsigned parameter, fix fval)
00144 {
00145     left();
00146     if ((font_type==FT_MATHSY) &&
00147         (parameter>=P_MATHSY_MIN) &&
00148         (parameter<=P_MATHSY_MAX)) {
00149          out_named_mathsy_parameter(parameter);
00150     } else if ((font_type==FT_MATHEX) &&
00151         (parameter>=P_MATHEX_MIN) &&
00152         (parameter<=P_MATHEX_MAX)) {
00153          out_named_mathex_parameter(parameter);
00154     } else if (parameter<=P_MAX) {
00155          out_named_parameter(parameter);
00156     } else {
00157          out("PARAMETER"); out(" "); out_int(parameter,10);
00158     }
00159     out(" "); out_fix(fval);
00160     right();
00161 }
00162 
00163 void
00164 print_label_command(unsigned val)
00165 {
00166     left();
00167     out("LABEL"); out(" ");
00168     if (val == -1) out("BOUNDARYCHAR");
00169     else out_char(val);
00170     right();
00171 }
00172 
00173 void
00174 print_ligature_command(unsigned command, unsigned val1, unsigned val2)
00175 {
00176     left();
00177     out_ligature_command(command);
00178     out(" "); out_char(val1);
00179     out(" "); out_char(val2);
00180     right();
00181 }
00182 
00183 void
00184 print_kerning_command(unsigned val, fix fval)
00185 {
00186     left();
00187     out("KRN");
00188     out(" "); out_char(val);
00189     out(" "); out_fix(fval);
00190     right();
00191 }
00192 
00193 void
00194 print_stop_command(void)
00195 {
00196     left();
00197     out("STOP");
00198     right();
00199 }
00200 
00201 void
00202 print_skip_command(unsigned val)
00203 {
00204     left();
00205     out("SKIP");
00206     out(" "); out_int(val,10);
00207     right();
00208 }
00209 
00210 void
00211 print_character_measure(unsigned measure, fix fval)
00212 {
00213     left();
00214     out_character_measure(measure);
00215     out(" "); out_fix(fval);
00216     right();
00217 }
00218 
00219 void
00220 print_next_larger(unsigned val)
00221 {
00222     left();
00223     out("NEXTLARGER");
00224     out(" "); out_char(val);
00225     right();
00226 }
00227 
00228 void
00229 print_var_character(void)
00230 {
00231     left(); out("VARCHAR"); out_ln();
00232 }
00233 
00234 void
00235 print_extensible_piece(unsigned piece, unsigned val)
00236 {
00237     left();
00238     out_extensible_piece(piece);
00239     out(" "); out_char(val);
00240     right();
00241 }
00242 
00243 /* Primitives used in VF and OVF files */
00244 
00245 void
00246 print_vtitle(string sval)
00247 {
00248     left();
00249     out("VTITLE");
00250     out(" "); out(sval);
00251     right();
00252 }
00253 
00254 void
00255 print_map_font(unsigned val)
00256 {
00257     left();
00258     out("MAPFONT");
00259     out(" "); out_int(val,10); out_ln();
00260 }
00261 
00262 void
00263 print_font_name(string sval)
00264 {
00265     left();
00266     out("FONTNAME");
00267     out(" "); out(sval);
00268     right();
00269 }
00270 
00271 void
00272 print_font_area(string sval)
00273 {
00274     left();
00275     out("FONTAREA");
00276     out(" "); out(sval);
00277     right();
00278 }
00279 
00280 void
00281 print_font_check_sum(unsigned val)
00282 {
00283     left();
00284     out("FONTCHECKSUM");
00285     out(" "); out_num(val);
00286     right();
00287 }
00288 
00289 void
00290 print_font_at(fix fval)
00291 {
00292     left();
00293     out("FONTAT");
00294     out(" "); out_fix(fval);
00295     right();
00296 }
00297 
00298 void
00299 print_font_design_size(fix fval)
00300 {
00301     left();
00302     out("FONTDSIZE");
00303     out(" "); out_fix(fval);
00304     right();
00305 }
00306 
00307 void
00308 print_map(void)
00309 {
00310     left(); out("MAP"); out_ln();
00311 }
00312 
00313 void
00314 print_select_font(unsigned val)
00315 {
00316     left();
00317     out("SELECTFONT");
00318     out(" "); out_int(val,10);
00319     right();
00320 }
00321 
00322 void
00323 print_set_char(unsigned val)
00324 {
00325     left();
00326     out("SETCHAR");
00327     out(" "); out_char(val);
00328     right();
00329 }
00330 
00331 void
00332 print_put_char(unsigned val)
00333 {
00334     left();
00335     out("PUTCHAR");
00336     out(" "); out_char(val);
00337     right();
00338 }
00339 
00340 void
00341 print_set_rule(fix fval1, fix fval2)
00342 {
00343     left();
00344     out("SETRULE");
00345     out(" "); out_fix(fval1);
00346     out(" "); out_fix(fval2);
00347     right();
00348 }
00349 
00350 void
00351 print_put_rule(fix fval1, fix fval2)
00352 {
00353     left();
00354     out("PUTRULE");
00355     out(" "); out_fix(fval1);
00356     out(" "); out_fix(fval2);
00357     right();
00358 }
00359 
00360 void
00361 print_push(void)
00362 {
00363     left(); out("PUSH"); right();
00364 }
00365 
00366 void
00367 print_pop(void)
00368 {
00369     left(); out("POP"); right();
00370 }
00371 
00372 void
00373 print_move(unsigned direction, fix fval)
00374 {
00375     left();
00376     out_move_direction(direction);
00377     out(" "); out_fix(fval);
00378     right();
00379 }
00380 
00381 void
00382 print_special(string sval)
00383 {
00384     left();
00385     out("SPECIAL");
00386     out(" "); out(sval);
00387     right();
00388 }
00389 
00390 void
00391 print_special_hex(string sval)
00392 {
00393     left();
00394     out("SPECIALHEX");
00395     out(" "); out(sval);
00396     right();
00397 }
00398 
00399 /* Primitives used in OPL and OVF files */
00400 
00401 void
00402 print_character_repeat(unsigned val1, unsigned val2)
00403 {
00404     left();
00405     out("CHARREPEAT");
00406     out(" "); out_char(val1);
00407     out(" "); out_char(val2); out_ln();
00408 }
00409 
00410 void
00411 print_font_ivalue(unsigned val)
00412 {
00413     left();
00414     out("FONTIVALUE");
00415     out(" "); out_int(val,10); out_ln();
00416 }
00417 
00418 void
00419 print_font_mvalue(unsigned val)
00420 {
00421     left();
00422     out("FONTMVALUE");
00423     out(" "); out_int(val,10); out_ln();
00424 }
00425 
00426 void
00427 print_font_fvalue(unsigned val)
00428 {
00429     left();
00430     out("FONTFVALUE");
00431     out(" "); out_int(val,10); out_ln();
00432 }
00433 
00434 void
00435 print_font_penalty(unsigned val)
00436 {
00437     left();
00438     out("FONTPENALTY");
00439     out(" "); out_int(val,10); out_ln();
00440 }
00441 
00442 void
00443 print_font_rule(unsigned val)
00444 {
00445     left();
00446     out("FONTRULE");
00447     out(" "); out_int(val,10); out_ln();
00448 }
00449 
00450 void
00451 print_font_glue(unsigned val)
00452 {
00453     left();
00454     out("FONTGLUE");
00455     out(" "); out_int(val,10); out_ln();
00456 }
00457 
00458 void
00459 print_c_label_command(unsigned val)
00460 {
00461     left();
00462     out("CLABEL"); out(" "); out_int(val,10);
00463     right();
00464 }
00465 
00466 void
00467 print_c_kerning_command(unsigned val1, unsigned val2)
00468 {
00469     left();
00470     out("CKRN"); out(" "); out_int(val1,10);
00471     out(" "); out_int(val2,10);
00472     right();
00473 }
00474 
00475 void
00476 print_c_glue_command(unsigned val1, unsigned val2)
00477 {
00478     left();
00479     out("CGLUE"); out(" "); out_int(val1,10);
00480     out(" "); out_int(val2,10);
00481     right();
00482 }
00483 
00484 void
00485 print_c_penalty_command(unsigned val1, unsigned val2)
00486 {
00487     left();
00488     out("CPENALTY"); out(" "); out_int(val1,10);
00489     out(" "); out_int(val2,10);
00490     right();
00491 }
00492 
00493 void
00494 print_c_penglue_command(unsigned val1, unsigned val2, unsigned val3)
00495 {
00496     left();
00497     out("CPENGLUE"); out(" "); out_int(val1,10);
00498     out(" "); out_int(val2,10);
00499     out(" "); out_int(val3,10);
00500     right();
00501 }
00502 
00503 void
00504 print_character_ivalue(unsigned val1, unsigned val2)
00505 {
00506     left();
00507     out("CHARIVALUE");
00508     out(" "); out_int(val1,10);
00509     out(" "); out_int(val2,10);
00510     right();
00511 }
00512 
00513 void
00514 print_character_mvalue(unsigned val1, unsigned val2)
00515 {
00516     left();
00517     out("CHARMVALUE");
00518     out(" "); out_int(val1,10);
00519     out(" "); out_int(val2,10);
00520     right();
00521 }
00522 
00523 void
00524 print_character_fvalue(unsigned val1, unsigned val2)
00525 {
00526     left();
00527     out("CHARFVALUE");
00528     out(" "); out_int(val1,10);
00529     out(" "); out_int(val2,10);
00530     right();
00531 }
00532 
00533 void
00534 print_character_penalty(unsigned val1, unsigned val2)
00535 {
00536     left();
00537     out("CHARPENALTY");
00538     out(" "); out_int(val1,10);
00539     out(" "); out_int(val2,10);
00540     right();
00541 }
00542 
00543 void
00544 print_character_rule(unsigned val1, unsigned val2)
00545 {
00546     left();
00547     out("CHARRULE");
00548     out(" "); out_int(val1,10);
00549     out(" "); out_int(val2,10);
00550     right();
00551 }
00552 
00553 void
00554 print_character_glue(unsigned val1, unsigned val2)
00555 {
00556     left();
00557     out("CHARGLUE");
00558     out(" "); out_int(val1,10);
00559     out(" "); out_int(val2,10);
00560     right();
00561 }
00562 
00563 void
00564 print_font_ivalue_entry(unsigned val)
00565 {
00566     left();
00567     out("IVALUE");
00568     out(" "); out_int(val,10); out_ln();
00569 }
00570 
00571 void
00572 print_font_ivalue_definition(unsigned val)
00573 {
00574     left();
00575     out("IVALUEVAL");
00576     out(" "); out_int(val,10);
00577     right();
00578 }
00579 
00580 void
00581 print_font_mvalue_entry(unsigned val)
00582 {
00583     left();
00584     out("MVALUE");
00585     out(" "); out_int(val,10); out_ln();
00586 }
00587 
00588 void
00589 print_font_mvalue_definition(fix fval)
00590 {
00591     left();
00592     out("MVALUEVAL");
00593     out(" "); out_fix(fval);
00594     right();
00595 }
00596 
00597 void
00598 print_font_fvalue_entry(unsigned val)
00599 {
00600     left();
00601     out("FVALUE");
00602     out(" "); out_int(val,10); out_ln();
00603 }
00604 
00605 void
00606 print_font_fvalue_definition(fix fval)
00607 {
00608     left();
00609     out("FVALUEVAL");
00610     out(" "); out_fix(fval);
00611     right();
00612 }
00613 
00614 void
00615 print_font_penalty_entry(unsigned val)
00616 {
00617     left();
00618     out("PENALTY");
00619     out(" "); out_int(val,10); out_ln();
00620 }
00621 
00622 void
00623 print_font_penalty_definition(unsigned val)
00624 {
00625     left();
00626     out("PENALTYVAL");
00627     out(" "); out_int(val,10);
00628     right();
00629 }
00630 
00631 void
00632 print_font_rule_entry(unsigned val)
00633 {
00634     left();
00635     out("RULE");
00636     out(" "); out_int(val,10); out_ln();
00637 }
00638 
00639 void
00640 print_font_rule_measure(unsigned val, fix fval)
00641 {
00642     left();
00643     out_rule_measure(val);
00644     out(" "); out_fix(fval);
00645     right();
00646 }
00647 
00648 void
00649 print_font_glue_entry(unsigned val)
00650 {
00651     left();
00652     out("GLUE");
00653     out(" "); out_int(val,10); out_ln();
00654 }
00655 
00656 void
00657 print_font_glue_type(unsigned val)
00658 {
00659     left();
00660     out("GLUETYPE");
00661     out(" "); out_glue_kind(val);
00662     right();
00663 }
00664 
00665 void
00666 print_font_glue_width(fix fval)
00667 {
00668     left();
00669     out("GLUEWD");
00670     out(" "); out_fix(fval);
00671     right();
00672 }
00673 
00674 void
00675 print_font_glue_character(unsigned val)
00676 {
00677     left();
00678     out("GLUECHAR");
00679     out(" "); out_char(val);
00680     right();
00681 }
00682 
00683 void
00684 print_font_glue_rule(unsigned val1, unsigned val2)
00685 {
00686     left();
00687     out("GLUERULE");
00688     out(" "); out_int(val1,10);
00689     out(" "); out_int(val2,10);
00690     right();
00691 }
00692 
00693 void
00694 print_font_glue_shrink_stretch(unsigned val1, fix fval, unsigned val2)
00695 {
00696     left();
00697     out_shrink_stretch(val1);
00698     out(" "); out_fix(fval);
00699     out(" "); out_glue_order(val2);
00700     right();
00701 }
00702 
00703 void
00704 print_ofm_level(unsigned val)
00705 {
00706     left();
00707     out("OFMLEVEL");
00708     out(" "); out_int(val,10);
00709     right();
00710 }
00711 
00712 void
00713 print_font_dir(unsigned val)
00714 {
00715     left();
00716     out_type_direction(val);
00717     right();
00718 }
00719 
00720 void
00721 print_accent(unsigned val)
00722 {
00723     left();
00724     out_accent_kind(val);
00725     right();
00726 }
00727