Back to index

tetex-bin  3.0
Defines | Functions | Variables
out_ofm.c File Reference
#include "cpascal.h"
#include "list_routines.h"
#include "header_routines.h"
#include "manifests.h"
#include "char_routines.h"
#include "ligkern_routines.h"
#include "out_ofm.h"
#include "extra_routines.h"
#include "param_routines.h"
#include "dimen_routines.h"
#include "error_routines.h"
#include "parse_ofm.h"

Go to the source code of this file.

Defines

#define dabs(x)   ((x)>=0?(x):-(x))

Functions

void output_ofm_file (void)
void compute_ofm_subsizes (void)
void output_ofm_subsizes (void)
void out_ofm (unsigned i)
void out_ofm_2 (unsigned i)
void out_ofm_4 (unsigned i)
void out_ofm_char (unsigned i)
void out_ofm_scaled (fix fval)

Variables

unsigned header_ptr
unsigned mw
unsigned mh
unsigned md
unsigned mi
FILEfile_ofm
unsigned file_ofm_count = 0

Define Documentation

#define dabs (   x)    ((x)>=0?(x):-(x))

Definition at line 185 of file out_ofm.c.


Function Documentation

Definition at line 58 of file out_ofm.c.

{
    switch(ofm_level) {
        case OFM_TFM: {
            lh = header_max + 1;
            if (bc > ec) bc = 1;
            if (ec>255)
                fatal_error_1(
                   "Char (%x) too big for TFM (max ff); use OFM file",ec);
            nw++; nh++; nd++; ni++;
            compute_ligkern_offset();
            lf = 6+lh+(ec-bc+1)+nw+nh+nd+ni+nl+lk_offset+nk+ne+np;
            /*lf = 6+lh+(ec-bc+1)+nw+nh+nd+ni+nl-1+lk_offset+nk+ne+np;*/
            break;
        }
        case OFM_LEVEL0: {
            lh = header_max + 1;
            if (ec>65535)
                fatal_error_1(
                "Char (%x) too big for OFM level-0 (max ffff); use level-2",
                ec);
            if (bc > ec) bc = 1;
            nw++; nh++; nd++; ni++;
            compute_ligkern_offset();
            lf = 14+lh+2*(ec-bc+1)+nw+nh+nd+ni+2*(nl+lk_offset)+nk+2*ne+np;
            break;
        }
        case OFM_LEVEL1: {
            lh = header_max + 1;
            if (ec>65535)
                fatal_error_1(
                "Char (%x) too big for OFM level-1 (max ffff); use level-2",
                ec);
            if (bc > ec) bc = 1;
            nw++; nh++; nd++; ni++;
            compute_ligkern_offset();
            lf = 29+lh+ncw+nw+nh+nd+ni+2*(nl+lk_offset)+nk+2*ne+np+
                 nki+nwi+nkf+nwf+nkm+nwm+nkr+nwr+nkg+nwg+nkp+nwp;
            nco = 29+lh+nki+nwi+nkf+nwf+nkm+nwm+nkr+nwr+nkg+nwg+nkp+nwp;
            break;
        }
        default: { internal_error_0("output_ofm_subfiles"); }
    }   
}

Here is the call graph for this function:

Here is the caller graph for this function:

void out_ofm ( unsigned  i)

Definition at line 145 of file out_ofm.c.

{
    fputc(i,file_ofm);
    file_ofm_count++;
}

Here is the caller graph for this function:

void out_ofm_2 ( unsigned  i)

Definition at line 152 of file out_ofm.c.

{
 
    fputc((i>>8)&0xff,  file_ofm);
    fputc(i&0xff,       file_ofm);
    file_ofm_count += 2;
}

Here is the caller graph for this function:

void out_ofm_4 ( unsigned  i)

Definition at line 161 of file out_ofm.c.

{
    fputc((i>>24)&0xff, file_ofm);
    fputc((i>>16)&0xff, file_ofm);
    fputc((i>>8)&0xff,  file_ofm);
    fputc(i&0xff,       file_ofm);
    file_ofm_count += 4;
}

Here is the caller graph for this function:

void out_ofm_char ( unsigned  i)

Definition at line 171 of file out_ofm.c.

{
    if (ofm_level == OFM_NOLEVEL) {
        internal_error_1("out_ofm_char.1 (ofm_level=%d)", ofm_level);
    }
    if (ofm_level == OFM_TFM) {
        if (i>=0x100) internal_error_1("out_ofm_char.2 (i=%x)", i);
        out_ofm(i);
    } else {
        if (i>=0x10000) internal_error_1("out_ofm_char.3 (i=%x)", i);
        out_ofm_2(i);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void out_ofm_scaled ( fix  fval)

Definition at line 188 of file out_ofm.c.

{
    if (dabs((double)fval/(double)design_units) >= 16.0) {
        warning_2("The relative dimension %d is too large.\n"
                  "Must be less than 16*designsize = %d designunits",
                  fval/0x100000, design_units/0x10000);
        fval = 0;
    }
    if (design_units != UNITY) {
        fval = zround(((double)fval/(double)design_units) * 1048576.0);
    }
    if (fval < 0) {
        out_ofm(255); fval = fval + 0x1000000;
        if (fval <= 0) fval = 1;
    } else {
        out_ofm(0);
        if (fval >= 0x1000000) fval = 0xffffff;
    }
    out_ofm((fval >> 16) & 0xff);
    out_ofm((fval >> 8) & 0xff);
    out_ofm(fval & 0xff);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 64 of file omfonts.c.

unsigned file_ofm_count = 0

Definition at line 142 of file out_ofm.c.

unsigned header_ptr
unsigned md
unsigned mh
unsigned mi
unsigned mw