About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

pkfont.c File Reference
#include <stdio.h>
#include "system.h"
#include "mem.h"
#include "error.h"
#include "mfileio.h"
#include "numbers.h"
#include "pkfont.h"
#include "pdfobj.h"
#include "pdflimits.h"
#include "tfm.h"
#include "ctype.h"
Include dependency graph for pkfont.c:

Go to the source code of this file.


struct  a_pk_font


#define PKFONT_DPI_DEFAULT   600u
#define advance_nybble()
#define current_nybble()   (partial_byte? (*pk_data%16): (*pk_data/16))
#define set_bits(n)
#define skip_bits(n)
#define get_bit(p, n)   (p[(n)/8] & (128u>>((n)%8)))
#define SHORT_FORM   1
#define MED_FORM   2
#define LONG_FORM   3
#define PK_XXX1   240
#define PK_XXX2   241
#define PK_XXX3   242
#define PK_XXX4   243
#define PK_YYY   244
#define PK_POST   245
#define PK_NO_OP   246
#define PK_PRE   247


void pk_set_verbose (void)
void pk_set_dpi (int dpi)
void init_pk_record (struct a_pk_font *p)
static int pk_char2name (char *charname, unsigned char code)
int pk_font (const char *tex_name, double ptsize, int tfm_font_id, char *res_name)
pdf_objpk_font_resource (int pk_id)
char * pk_font_used (int pk_id)
static void do_skip (FILE *fp, unsigned long length)
static void add_raster_data (pdf_obj *glyph, long w, long h, int dyn_f, int run_color, unsigned char *pk_data, unsigned char *eod)
static void do_preamble (FILE *fp)
static void do_character (FILE *fp, unsigned char flag, char *used_chars, double pix2charu, pdf_obj *char_procs, double *widths, long *bbox)
static void do_pk_font (int pk_id)
void pk_close_all (void)


static int verbose = 0
static unsigned font_dpi = 600u
struct a_pk_fontpk_fonts
int num_pk_fonts = 0
int max_pk_fonts = 0

Macro Definition Documentation

◆ advance_nybble

#define advance_nybble ( )
{ \
if (partial_byte) { \
partial_byte=0; \
pk_data++; \
} else \
partial_byte=1; \

◆ current_nybble

#define current_nybble ( )    (partial_byte? (*pk_data%16): (*pk_data/16))

◆ get_bit

#define get_bit (   p,
)    (p[(n)/8] & (128u>>((n)%8)))


#define LONG_FORM   3

Definition at line 330 of file pkfont.c.


#define MED_FORM   2

Definition at line 329 of file pkfont.c.


#define PK_NO_OP   246

Definition at line 464 of file pkfont.c.


#define PK_POST   245

Definition at line 463 of file pkfont.c.


#define PK_PRE   247

Definition at line 465 of file pkfont.c.


#define PK_XXX1   240

Definition at line 458 of file pkfont.c.


#define PK_XXX2   241

Definition at line 459 of file pkfont.c.


#define PK_XXX3   242

Definition at line 460 of file pkfont.c.


#define PK_XXX4   243

Definition at line 461 of file pkfont.c.


#define PK_YYY   244

Definition at line 462 of file pkfont.c.


#define PKFONT_DPI_DEFAULT   600u

Definition at line 39 of file pkfont.c.

◆ set_bits

#define set_bits (   n)
int i; \
for (i=0; i<(n); i++) { \
row[next_col] |= (128u>>next_bit++); \
if (next_bit > 7) { \
next_bit = 0; \
next_col += 1; \
} \
} \
#define n
Definition: t4ht.c:1290
small capitals from c petite p scientific i
Definition: afcover.h:80


#define SHORT_FORM   1

Definition at line 328 of file pkfont.c.

◆ skip_bits

#define skip_bits (   n)
next_col += (n)/8; \
next_bit += (n)%8; \
if (next_bit > 7) { \
next_bit -= 8; \
next_col += 1; \
} \

Function Documentation

◆ add_raster_data()

static void add_raster_data ( pdf_obj glyph,
long  w,
long  h,
int  dyn_f,
int  run_color,
unsigned char *  pk_data,
unsigned char *  eod 

Definition at line 158 of file pkfont.c.

References advance_nybble, current_nybble, dyn_f, get_bit, h, i, j, memset(), MIN, nbits, NEW, pdf_add_stream(), RELEASE, row, set_bits, skip_bits, and w.

Referenced by do_character().

◆ do_character()

◆ do_pk_font()

◆ do_preamble()

static void do_preamble ( FILE fp)

Definition at line 313 of file pkfont.c.

References do_skip(), fgetc, fp, fprintf, and get_unsigned_byte().

Referenced by do_pk_font().

◆ do_skip()

static void do_skip ( FILE fp,
unsigned long  length 

Definition at line 152 of file pkfont.c.

References fgetc, fp, and length.

Referenced by do_character(), do_pk_font(), do_preamble(), and LBMRead::doit().

◆ init_pk_record()

void init_pk_record ( struct a_pk_font p)

Definition at line 65 of file pkfont.c.

References memset(), NEW, NULL, and p.

Referenced by pk_font().

◆ pk_char2name()

static int pk_char2name ( char *  charname,
unsigned char  code 

Definition at line 77 of file pkfont.c.

References sprintf.

Referenced by do_character(), and do_pk_font().

◆ pk_close_all()

void pk_close_all ( void  )

Definition at line 603 of file pkfont.c.

References do_pk_font(), filename, i, num_pk_fonts, pdf_release_obj(), pk_fonts, and RELEASE.

Referenced by dev_close_all_fonts().

◆ pk_font()

◆ pk_font_resource()

pdf_obj* pk_font_resource ( int  pk_id)

Definition at line 133 of file pkfont.c.

References fprintf, a_pk_font::indirect, num_pk_fonts, pdf_link_obj(), pdf_ref_obj(), and pk_fonts.

Referenced by dev_locate_font().

◆ pk_font_used()

char* pk_font_used ( int  pk_id)

Definition at line 144 of file pkfont.c.

References fprintf, num_pk_fonts, pk_fonts, and a_pk_font::used_chars.

Referenced by dev_locate_font().

◆ pk_set_dpi()

void pk_set_dpi ( int  dpi)

Definition at line 50 of file pkfont.c.

References dpi, font_dpi, and fprintf.

Referenced by main().

◆ pk_set_verbose()

void pk_set_verbose ( void  )

Definition at line 45 of file pkfont.c.

References verbose.

Referenced by do_args().

Variable Documentation

◆ font_dpi

unsigned font_dpi = 600u

Definition at line 43 of file pkfont.c.

Referenced by do_pk_font(), pk_font(), and pk_set_dpi().

◆ max_pk_fonts

int max_pk_fonts = 0

Definition at line 82 of file pkfont.c.

Referenced by pk_font().

◆ num_pk_fonts

int num_pk_fonts = 0

Definition at line 82 of file pkfont.c.

Referenced by pk_close_all(), pk_font(), pk_font_resource(), and pk_font_used().

◆ pk_fonts

◆ verbose

int verbose = 0

Definition at line 42 of file pkfont.c.

Referenced by do_pk_font(), and pk_set_verbose().