| 1 |
/* print_routines.c: higher-level routines for printing OPL and OVP files. |
| 2 |
|
| 3 |
This file is part of Omega, |
| 4 |
which is based on the web2c distribution of TeX, |
| 5 |
|
| 6 |
Copyright (c) 1994--2001 John Plaice and Yannis Haralambous |
| 7 |
|
| 8 |
Omega is free software; you can redistribute it and/or modify |
| 9 |
it under the terms of the GNU General Public License as published by |
| 10 |
the Free Software Foundation; either version 2 of the License, or |
| 11 |
(at your option) any later version. |
| 12 |
|
| 13 |
Omega is distributed in the hope that it will be useful, |
| 14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 |
GNU General Public License for more details. |
| 17 |
|
| 18 |
You should have received a copy of the GNU General Public License |
| 19 |
along with Omega; if not, write to the Free Software Foundation, Inc., |
| 20 |
59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. |
| 21 |
|
| 22 |
*/ |
| 23 |
|
| 24 |
#include "cpascal.h" |
| 25 |
#include "list_routines.h" |
| 26 |
#include "manifests.h" |
| 27 |
#include "print_routines.h" |
| 28 |
#include "header_routines.h" |
| 29 |
#include "out_routines.h" |
| 30 |
#include "error_routines.h" |
| 31 |
#include "omfonts.h" |
| 32 |
|
| 33 |
void |
| 34 |
print_check_sum(void) |
| 35 |
{ |
| 36 |
left(); |
| 37 |
out("CHECKSUM"); |
| 38 |
out(" "); out_num(check_sum); |
| 39 |
right(); |
| 40 |
} |
| 41 |
|
| 42 |
void |
| 43 |
print_design_size(void) |
| 44 |
{ |
| 45 |
left(); |
| 46 |
out("DESIGNSIZE"); |
| 47 |
out(" "); out_fix(design_size); |
| 48 |
right(); |
| 49 |
} |
| 50 |
|
| 51 |
void |
| 52 |
print_coding_scheme(void) |
| 53 |
{ |
| 54 |
left(); |
| 55 |
out("CODINGSCHEME"); |
| 56 |
out(" "); out(coding_scheme); |
| 57 |
right(); |
| 58 |
} |
| 59 |
|
| 60 |
void |
| 61 |
print_family(void) |
| 62 |
{ |
| 63 |
left(); |
| 64 |
out("FAMILY"); |
| 65 |
out(" "); out(family); |
| 66 |
right(); |
| 67 |
} |
| 68 |
|
| 69 |
void |
| 70 |
print_face(void) |
| 71 |
{ |
| 72 |
left(); |
| 73 |
out("FACE"); |
| 74 |
out(" "); |
| 75 |
if ((face >= F_MIN) && (face <= F_MAX)) print_xerox_face(face); |
| 76 |
else out_num(face); |
| 77 |
right(); |
| 78 |
} |
| 79 |
|
| 80 |
void |
| 81 |
print_seven_bit_safe_flag(void) |
| 82 |
{ |
| 83 |
left(); |
| 84 |
out("SEVENBITSAFEFLAG"); out(" "); |
| 85 |
if (seven_bit == 1) out("TRUE"); |
| 86 |
else if (seven_bit == 0) out("FALSE"); |
| 87 |
else internal_error_1("print_seven_bit_safe_flag (seven_bit=%d)", seven_bit); |
| 88 |
right(); |
| 89 |
|
| 90 |
} |
| 91 |
|
| 92 |
void |
| 93 |
print_font_dimension(void) |
| 94 |
{ |
| 95 |
left(); |
| 96 |
out("FONTDIMEN"); out_ln(); |
| 97 |
} |
| 98 |
|
| 99 |
void |
| 100 |
print_boundary_char(unsigned val) |
| 101 |
{ |
| 102 |
left(); |
| 103 |
out("BOUNDARYCHAR"); |
| 104 |
out(" "); out_char(val); right(); |
| 105 |
} |
| 106 |
|
| 107 |
void |
| 108 |
print_ligature_table(void) |
| 109 |
{ |
| 110 |
left(); |
| 111 |
out("LIGTABLE"); out_ln(); |
| 112 |
} |
| 113 |
|
| 114 |
void |
| 115 |
print_character(unsigned val) |
| 116 |
{ |
| 117 |
left(); |
| 118 |
out("CHARACTER"); |
| 119 |
out(" "); out_char(val); out_ln(); |
| 120 |
} |
| 121 |
|
| 122 |
void |
| 123 |
print_parameter(unsigned parameter, fix fval) |
| 124 |
{ |
| 125 |
left(); |
| 126 |
if ((font_type==FT_MATHSY) && |
| 127 |
(parameter>=P_MATHSY_MIN) && |
| 128 |
(parameter<=P_MATHSY_MAX)) { |
| 129 |
out_named_mathsy_parameter(parameter); |
| 130 |
} else if ((font_type==FT_MATHEX) && |
| 131 |
(parameter>=P_MATHEX_MIN) && |
| 132 |
(parameter<=P_MATHEX_MAX)) { |
| 133 |
out_named_mathex_parameter(parameter); |
| 134 |
} else if (parameter<=P_MAX) { |
| 135 |
out_named_parameter(parameter); |
| 136 |
} else { |
| 137 |
out("PARAMETER"); out(" "); out_int(parameter,10); |
| 138 |
} |
| 139 |
out(" "); out_fix(fval); |
| 140 |
right(); |
| 141 |
} |
| 142 |
|
| 143 |
void |
| 144 |
print_label_command(unsigned val) |
| 145 |
{ |
| 146 |
left(); |
| 147 |
out("LABEL"); out(" "); |
| 148 |
if (val == -1) out("BOUNDARYCHAR"); |
| 149 |
else out_char(val); |
| 150 |
right(); |
| 151 |
} |
| 152 |
|
| 153 |
void |
| 154 |
print_ligature_command(unsigned command, unsigned val1, unsigned val2) |
| 155 |
{ |
| 156 |
left(); |
| 157 |
out_ligature_command(command); |
| 158 |
out(" "); out_char(val1); |
| 159 |
out(" "); out_char(val2); |
| 160 |
right(); |
| 161 |
} |
| 162 |
|
| 163 |
void |
| 164 |
print_kerning_command(unsigned val, fix fval) |
| 165 |
{ |
| 166 |
left(); |
| 167 |
out("KRN"); |
| 168 |
out(" "); out_char(val); |
| 169 |
out(" "); out_fix(fval); |
| 170 |
right(); |
| 171 |
} |
| 172 |
|
| 173 |
void |
| 174 |
print_stop_command(void) |
| 175 |
{ |
| 176 |
left(); |
| 177 |
out("STOP"); |
| 178 |
right(); |
| 179 |
} |
| 180 |
|
| 181 |
void |
| 182 |
print_skip_command(unsigned val) |
| 183 |
{ |
| 184 |
left(); |
| 185 |
out("SKIP"); |
| 186 |
out(" "); out_int(val,10); |
| 187 |
right(); |
| 188 |
} |
| 189 |
|
| 190 |
void |
| 191 |
print_character_measure(unsigned measure, fix fval) |
| 192 |
{ |
| 193 |
left(); |
| 194 |
out_character_measure(measure); |
| 195 |
out(" "); out_fix(fval); |
| 196 |
right(); |
| 197 |
} |
| 198 |
|
| 199 |
void |
| 200 |
print_next_larger(unsigned val) |
| 201 |
{ |
| 202 |
left(); |
| 203 |
out("NEXTLARGER"); |
| 204 |
out(" "); out_char(val); |
| 205 |
right(); |
| 206 |
} |
| 207 |
|
| 208 |
void |
| 209 |
print_var_character(void) |
| 210 |
{ |
| 211 |
left(); out("VARCHAR"); out_ln(); |
| 212 |
} |
| 213 |
|
| 214 |
void |
| 215 |
print_extensible_piece(unsigned piece, unsigned val) |
| 216 |
{ |
| 217 |
left(); |
| 218 |
out_extensible_piece(piece); |
| 219 |
out(" "); out_char(val); |
| 220 |
right(); |
| 221 |
} |
| 222 |
|
| 223 |
/* Primitives used in VF and OVF files */ |
| 224 |
|
| 225 |
void |
| 226 |
print_vtitle(string sval) |
| 227 |
{ |
| 228 |
left(); |
| 229 |
out("VTITLE"); |
| 230 |
out(" "); out(sval); |
| 231 |
right(); |
| 232 |
} |
| 233 |
|
| 234 |
void |
| 235 |
print_map_font(unsigned val) |
| 236 |
{ |
| 237 |
left(); |
| 238 |
out("MAPFONT"); |
| 239 |
out(" "); out_int(val,10); out_ln(); |
| 240 |
} |
| 241 |
|
| 242 |
void |
| 243 |
print_font_name(string sval) |
| 244 |
{ |
| 245 |
left(); |
| 246 |
out("FONTNAME"); |
| 247 |
out(" "); out(sval); |
| 248 |
right(); |
| 249 |
} |
| 250 |
|
| 251 |
void |
| 252 |
print_font_area(string sval) |
| 253 |
{ |
| 254 |
left(); |
| 255 |
out("FONTAREA"); |
| 256 |
out(" "); out(sval); |
| 257 |
right(); |
| 258 |
} |
| 259 |
|
| 260 |
void |
| 261 |
print_font_check_sum(unsigned val) |
| 262 |
{ |
| 263 |
left(); |
| 264 |
out("FONTCHECKSUM"); |
| 265 |
out(" "); out_num(val); |
| 266 |
right(); |
| 267 |
} |
| 268 |
|
| 269 |
void |
| 270 |
print_font_at(fix fval) |
| 271 |
{ |
| 272 |
left(); |
| 273 |
out("FONTAT"); |
| 274 |
out(" "); out_fix(fval); |
| 275 |
right(); |
| 276 |
} |
| 277 |
|
| 278 |
void |
| 279 |
print_font_design_size(fix fval) |
| 280 |
{ |
| 281 |
left(); |
| 282 |
out("FONTDSIZE"); |
| 283 |
out(" "); out_fix(fval); |
| 284 |
right(); |
| 285 |
} |
| 286 |
|
| 287 |
void |
| 288 |
print_map(void) |
| 289 |
{ |
| 290 |
left(); out("MAP"); out_ln(); |
| 291 |
} |
| 292 |
|
| 293 |
void |
| 294 |
print_select_font(unsigned val) |
| 295 |
{ |
| 296 |
left(); |
| 297 |
out("SELECTFONT"); |
| 298 |
out(" "); out_int(val,10); |
| 299 |
right(); |
| 300 |
} |
| 301 |
|
| 302 |
void |
| 303 |
print_set_char(unsigned val) |
| 304 |
{ |
| 305 |
left(); |
| 306 |
out("SETCHAR"); |
| 307 |
out(" "); out_char(val); |
| 308 |
right(); |
| 309 |
} |
| 310 |
|
| 311 |
void |
| 312 |
print_put_char(unsigned val) |
| 313 |
{ |
| 314 |
left(); |
| 315 |
out("PUTCHAR"); |
| 316 |
out(" "); out_char(val); |
| 317 |
right(); |
| 318 |
} |
| 319 |
|
| 320 |
void |
| 321 |
print_set_rule(fix fval1, fix fval2) |
| 322 |
{ |
| 323 |
left(); |
| 324 |
out("SETRULE"); |
| 325 |
out(" "); out_fix(fval1); |
| 326 |
out(" "); out_fix(fval2); |
| 327 |
right(); |
| 328 |
} |
| 329 |
|
| 330 |
void |
| 331 |
print_put_rule(fix fval1, fix fval2) |
| 332 |
{ |
| 333 |
left(); |
| 334 |
out("PUTRULE"); |
| 335 |
out(" "); out_fix(fval1); |
| 336 |
out(" "); out_fix(fval2); |
| 337 |
right(); |
| 338 |
} |
| 339 |
|
| 340 |
void |
| 341 |
print_push(void) |
| 342 |
{ |
| 343 |
left(); out("PUSH"); right(); |
| 344 |
} |
| 345 |
|
| 346 |
void |
| 347 |
print_pop(void) |
| 348 |
{ |
| 349 |
left(); out("POP"); right(); |
| 350 |
} |
| 351 |
|
| 352 |
void |
| 353 |
print_move(unsigned direction, fix fval) |
| 354 |
{ |
| 355 |
left(); |
| 356 |
out_move_direction(direction); |
| 357 |
out(" "); out_fix(fval); |
| 358 |
right(); |
| 359 |
} |
| 360 |
|
| 361 |
void |
| 362 |
print_special(string sval) |
| 363 |
{ |
| 364 |
left(); |
| 365 |
out("SPECIAL"); |
| 366 |
out(" "); out(sval); |
| 367 |
right(); |
| 368 |
} |
| 369 |
|
| 370 |
void |
| 371 |
print_special_hex(unsigned char *special, int k) |
| 372 |
{ |
| 373 |
left(); |
| 374 |
out("SPECIALHEX "); |
| 375 |
for (; k > 0; k--, special++) { |
| 376 |
if ((k & 0x1f) == 0) |
| 377 |
out_ln(); |
| 378 |
else if ((k & 0x03) == 0) |
| 379 |
out(" "); |
| 380 |
out_hex(*special); |
| 381 |
} |
| 382 |
right(); |
| 383 |
} |
| 384 |
|
| 385 |
/* Primitives used in OPL and OVF files */ |
| 386 |
|
| 387 |
void |
| 388 |
print_character_repeat(unsigned val1, unsigned val2) |
| 389 |
{ |
| 390 |
left(); |
| 391 |
out("CHARREPEAT"); |
| 392 |
out(" "); out_char(val1); |
| 393 |
out(" "); out_char(val2); out_ln(); |
| 394 |
} |
| 395 |
|
| 396 |
void |
| 397 |
print_ofm_level(unsigned val) |
| 398 |
{ |
| 399 |
left(); |
| 400 |
out("OFMLEVEL"); |
| 401 |
out(" "); out_int(val,16); |
| 402 |
right(); |
| 403 |
} |
| 404 |
|
| 405 |
void |
| 406 |
print_font_dir(unsigned val) |
| 407 |
{ |
| 408 |
left(); |
| 409 |
out_type_direction(val); |
| 410 |
right(); |
| 411 |
} |