w32tex
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)  

dvi.c File Reference
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>
#include "system.h"
#include "mem.h"
#include "error.h"
#include "mfileio.h"
#include "numbers.h"
#include "dpxconf.h"
#include "dpxutil.h"
#include "pdfdev.h"
#include "pdfdoc.h"
#include "pdfparse.h"
#include "pdfresource.h"
#include "pdfdraw.h"
#include "fontmap.h"
#include "dvicodes.h"
#include "tfm.h"
#include "vf.h"
#include "subfont.h"
#include "spc_util.h"
#include "specials.h"
#include "dvi.h"
#include "dvipdfmx.h"
#include "dpxfile.h"
#include "pdfximage.h"
#include "tt_aux.h"
#include "tt_table.h"
#include "t1_load.h"
#include "t1_char.h"
#include "cff_dict.h"
#include "pdfencrypt.h"
Include dependency graph for dvi.c:

Go to the source code of this file.

Classes

struct  dvi_header
 
struct  dvi_lr
 
struct  gm
 
struct  loaded_font
 
struct  font_def
 
struct  dvi_registers
 
struct  spt_coord
 

Macros

#define DVI_STACK_DEPTH_MAX   256u
 
#define TEX_FONTS_ALLOC_SIZE   16u
 
#define VF_NESTING_MAX   16u
 
#define UTF32toUTF16HS(x)   (0xd800 + (((x-0x10000) >> 10) & 0x3ff))
 
#define UTF32toUTF16LS(x)   (0xdc00 + ( x & 0x3ff))
 
#define LTYPESETTING   0 /* typesetting from left to right */
 
#define RTYPESETTING   1 /* typesetting from right to left */
 
#define SKIMMING   2 /* skimming through reflected segment measuring its width */
 
#define REVERSE(MODE)   (LTYPESETTING + RTYPESETTING - MODE)
 
#define PHYSICAL   1
 
#define VIRTUAL   2
 
#define SUBFONT   3
 
#define NATIVE   4
 
#define DVI   1
 
#define VF   2
 
#define XDV_FLAG_VERTICAL   0x0100
 
#define XDV_FLAG_COLORED   0x0200
 
#define XDV_FLAG_FEATURES   0x0400
 
#define XDV_FLAG_EXTEND   0x1000
 
#define XDV_FLAG_SLANT   0x2000
 
#define XDV_FLAG_EMBOLDEN   0x4000
 
#define DVI_PAGE_BUF_CHUNK   0x10000U /* 64K should be plenty for most pages */
 
#define skip_bufferd_bytes(n)   dvi_page_buf_index += n
 
#define range_check_loc(loc)
 
#define SIG_DVILUA_FNT_DEF   ('L' << 24|'u' << 16|'a' << 8|'F')
 
#define buf   ((char*)(dvi_page_buffer + dvi_page_buf_index))
 

Functions

double get_origin (int x)
 
static void need_more_fonts (unsigned n)
 
static int get_and_buffer_unsigned_byte (FILE *file)
 
static unsigned int get_and_buffer_unsigned_pair (FILE *file)
 
static void get_and_buffer_bytes (FILE *file, unsigned int count)
 
static int get_buffered_unsigned_byte (void)
 
static unsigned int get_buffered_unsigned_pair (void)
 
static int32_t get_buffered_signed_quad (void)
 
static int32_t get_buffered_signed_num (unsigned char num)
 
static int32_t get_buffered_unsigned_num (unsigned char num)
 
unsigned int dvi_npages (void)
 
static void check_id_bytes (void)
 
static void need_XeTeX (int c)
 
static void need_pTeX (int c)
 
static int32_t find_post (void)
 
static void get_page_info (int32_t post_location)
 
double dvi_tell_mag (void)
 
static void do_scales (double mag)
 
static void get_dvi_info (int32_t post_location)
 
static void get_preamble_dvi_info (void)
 
const char * dvi_comment (void)
 
static void proc_dvilua_font_record (int32_t tex_id, const char *font_name, uint32_t point_size, uint32_t design_size)
 
static void read_font_record (int32_t tex_id)
 
static void read_native_font_record (int32_t tex_id)
 
static void get_dvi_fonts (int32_t post_location)
 
static void get_comment (void)
 
static void clear_state (void)
 
static void dvi_mark_depth (void)
 
void dvi_tag_depth (void)
 
void dvi_untag_depth (void)
 
void dvi_compute_boxes (int flag)
 
void dvi_link_annot (int flag)
 
int dvi_is_tracking_boxes (void)
 
void dvi_set_linkmode (int mode)
 
void dvi_set_phantom_height (double height, double depth)
 
void dvi_set_compensation (double x, double y)
 
static void set_string (spt_t xpos, spt_t ypos, const void *instr_ptr, int instr_len, spt_t width, int font_id)
 
static void set_rule (spt_t xpos, spt_t ypos, spt_t width, spt_t height)
 
static void calc_rect (pdf_rect *r, spt_t xpos, spt_t ypos, spt_t width, spt_t height, spt_t depth)
 
void dvi_do_special (const void *buffer, int32_t size)
 
double dvi_unit_size (void)
 
int dvi_locate_font (const char *tfm_name, spt_t ptsize)
 
static int dvi_locate_native_font (const char *filename, uint32_t index, spt_t ptsize, int layout_dir, int extend, int slant, int embolden)
 
double dvi_dev_xpos (void)
 
double dvi_dev_ypos (void)
 
static void do_moveto (int32_t x, int32_t y)
 
void dvi_right (int32_t x)
 
void dvi_down (int32_t y)
 
void dvi_set (int32_t ch)
 
void dvi_put (int32_t ch)
 
void dvi_rule (int32_t width, int32_t height)
 
void dvi_dirchg (unsigned char dir)
 
static void do_setrule (void)
 
static void do_putrule (void)
 
void dvi_push (void)
 
void dvi_pop (void)
 
void dvi_w (int32_t ch)
 
void dvi_w0 (void)
 
void dvi_x (int32_t ch)
 
void dvi_x0 (void)
 
void dvi_y (int32_t ch)
 
void dvi_y0 (void)
 
void dvi_z (int32_t ch)
 
void dvi_z0 (void)
 
static void skip_fntdef (void)
 
static void do_fntdef (int32_t tex_id)
 
void dvi_set_font (int font_id)
 
static void do_fnt (int32_t tex_id)
 
static void do_xxx (int32_t size)
 
static void do_bop (void)
 
static void do_eop (void)
 
static void do_dir (void)
 
static void lr_width_push (void)
 
static void lr_width_pop (void)
 
static void dvi_begin_reflect (void)
 
static void dvi_end_reflect (void)
 
static void skip_native_font_def (void)
 
static void do_native_font_def (int32_t tex_id)
 
static void skip_glyphs (void)
 
static void do_glyphs (int do_actual_text)
 
static void check_postamble (void)
 
void dvi_do_page (double page_paper_height, double hmargin, double vmargin)
 
double dvi_init (char *dvi_filename, double mag)
 
void dvi_close (void)
 
void dvi_vf_init (int dev_font_id)
 
void dvi_vf_finish (void)
 
static int scan_special_encrypt (int *key_bits, int32_t *permission, char *opassword, char *upassword, const char **curptr, const char *endptr)
 
static int scan_special_trailerid (unsigned char *id1, unsigned char *id2, const char **curptr, const char *endptr)
 
static int scan_special (double *wd, double *ht, double *xo, double *yo, int *lm, int *majorversion, int *minorversion, int *enable_encryption, int *key_bits, int32_t *permission, char *opassword, char *upassword, int *has_id, unsigned char *id1, unsigned char *id2, const char *buf, uint32_t size)
 
void dvi_scan_specials (int page_no, double *page_width, double *page_height, double *x_offset, double *y_offset, int *landscape, int *majorversion, int *minorversion, int *do_enc, int *key_bits, int32_t *permission, char *owner_pw, char *user_pw, int *has_id, unsigned char *id1, unsigned char *id2)
 

Variables

static FILEdvi_file = NULL
 
static char linear = 0
 
static int32_tpage_loc = NULL
 
static unsigned int num_pages = 0
 
static uint32_t dvi_file_size = 0
 
static struct dvi_header dvi_info
 
static double dev_origin_x = 72.0
 
static double dev_origin_y = 770.0
 
static struct dvi_lr lr_state
 
static int lr_mode
 
static uint32_t lr_width
 
static uint32_t lr_width_stack [256u]
 
static unsigned lr_width_stack_depth = 0
 
static struct loaded_fontloaded_fonts = NULL
 
static int num_loaded_fonts = 0
 
static int max_loaded_fonts = 0
 
static struct font_defdef_fonts = NULL
 
static int num_def_fonts = 0
 
static int max_def_fonts = 0
 
static int compute_boxes = 0
 
static int link_annot = 1
 
static int catch_phantom = 0
 
static double phantom_height = 0.0
 
static double phantom_depth = 0.0
 
static unsigned char * dvi_page_buffer
 
static unsigned int dvi_page_buf_size
 
static unsigned int dvi_page_buf_index
 
static const char invalid_signature []
 
static int pre_id_byte
 
static int post_id_byte
 
static int is_ptex = 0
 
static int has_ptex = 0
 
static double dvi2pts = 1.52018
 
static double total_mag = 1.0
 
static struct dvi_registers dvi_state
 
static struct dvi_registers dvi_stack [256u]
 
static unsigned dvi_stack_depth = 0
 
static int current_font = -1
 
static int processing_page = 0
 
static unsigned marked_depth = 0
 
static int tagged_depth = -1
 
static struct spt_coord compensation = { 0, 0 }
 
static int saved_dvi_font [16u]
 
static int num_saved_fonts = 0
 

Macro Definition Documentation

◆ buf

#define buf   ((char*)(dvi_page_buffer + dvi_page_buf_index))

◆ DVI

#define DVI   1

Definition at line 137 of file dvi.c.

◆ DVI_PAGE_BUF_CHUNK

#define DVI_PAGE_BUF_CHUNK   0x10000U /* 64K should be plenty for most pages */

Definition at line 228 of file dvi.c.

◆ DVI_STACK_DEPTH_MAX

#define DVI_STACK_DEPTH_MAX   256u

Definition at line 75 of file dvi.c.

◆ LTYPESETTING

#define LTYPESETTING   0 /* typesetting from left to right */

Definition at line 116 of file dvi.c.

◆ NATIVE

#define NATIVE   4

Definition at line 136 of file dvi.c.

◆ PHYSICAL

#define PHYSICAL   1

Definition at line 133 of file dvi.c.

◆ range_check_loc

#define range_check_loc (   loc)
Value:
if ((loc) > dvi_file_size) {\
}
#define loc
Definition: aptex-macros.h:65
static uint32_t dvi_file_size
Definition: dvi.c:90
static const char invalid_signature[]
Definition: dvi.c:329

Definition at line 332 of file dvi.c.

◆ REVERSE

#define REVERSE (   MODE)    (LTYPESETTING + RTYPESETTING - MODE)

Definition at line 119 of file dvi.c.

◆ RTYPESETTING

#define RTYPESETTING   1 /* typesetting from right to left */

Definition at line 117 of file dvi.c.

◆ SIG_DVILUA_FNT_DEF

#define SIG_DVILUA_FNT_DEF   ('L' << 24|'u' << 16|'a' << 8|'F')

Definition at line 642 of file dvi.c.

◆ SKIMMING

#define SKIMMING   2 /* skimming through reflected segment measuring its width */

Definition at line 118 of file dvi.c.

◆ skip_bufferd_bytes

#define skip_bufferd_bytes (   n)    dvi_page_buf_index += n

Definition at line 321 of file dvi.c.

◆ SUBFONT

#define SUBFONT   3

Definition at line 135 of file dvi.c.

◆ TEX_FONTS_ALLOC_SIZE

#define TEX_FONTS_ALLOC_SIZE   16u

Definition at line 76 of file dvi.c.

◆ UTF32toUTF16HS

#define UTF32toUTF16HS (   x)    (0xd800 + (((x-0x10000) >> 10) & 0x3ff))

Definition at line 80 of file dvi.c.

◆ UTF32toUTF16LS

#define UTF32toUTF16LS (   x)    (0xdc00 + ( x & 0x3ff))

Definition at line 81 of file dvi.c.

◆ VF

#define VF   2

Definition at line 138 of file dvi.c.

◆ VF_NESTING_MAX

#define VF_NESTING_MAX   16u

Definition at line 77 of file dvi.c.

◆ VIRTUAL

#define VIRTUAL   2

Definition at line 134 of file dvi.c.

◆ XDV_FLAG_COLORED

#define XDV_FLAG_COLORED   0x0200

Definition at line 208 of file dvi.c.

◆ XDV_FLAG_EMBOLDEN

#define XDV_FLAG_EMBOLDEN   0x4000

Definition at line 212 of file dvi.c.

◆ XDV_FLAG_EXTEND

#define XDV_FLAG_EXTEND   0x1000

Definition at line 210 of file dvi.c.

◆ XDV_FLAG_FEATURES

#define XDV_FLAG_FEATURES   0x0400

Definition at line 209 of file dvi.c.

◆ XDV_FLAG_SLANT

#define XDV_FLAG_SLANT   0x2000

Definition at line 211 of file dvi.c.

◆ XDV_FLAG_VERTICAL

#define XDV_FLAG_VERTICAL   0x0100

Definition at line 207 of file dvi.c.

Function Documentation

◆ calc_rect()

static void calc_rect ( pdf_rect r,
spt_t  xpos,
spt_t  ypos,
spt_t  width,
spt_t  height,
spt_t  depth 
)
static

Definition at line 961 of file dvi.c.

References compensation, depth, height, pdf_dev_set_rect(), r, width, spt_coord::x, and spt_coord::y.

Referenced by do_glyphs(), dvi_put(), dvi_right(), and dvi_set().

◆ check_id_bytes()

static void check_id_bytes ( void  )
static

Definition at line 340 of file dvi.c.

References DVI_ID, DVIV_ID, ERROR, post_id_byte, and pre_id_byte.

Referenced by check_postamble(), and find_post().

◆ check_postamble()

◆ clear_state()

◆ do_bop()

◆ do_dir()

static void do_dir ( void  )
static

Definition at line 1895 of file dvi.c.

References dvi_registers::d, dvi_state, get_buffered_unsigned_byte(), and pdf_dev_set_dirmode().

Referenced by dvi_do_page().

◆ do_eop()

static void do_eop ( void  )
static

Definition at line 1880 of file dvi.c.

References dvi_stack_depth, ERROR, pdf_doc_end_page(), processing_page, and spc_exec_at_end_page().

Referenced by dvi_do_page().

◆ do_fnt()

◆ do_fntdef()

static void do_fntdef ( int32_t  tex_id)
static

Definition at line 1779 of file dvi.c.

References dvi_page_buf_index, linear, read_font_record(), and skip_fntdef().

Referenced by dvi_scan_specials().

◆ do_glyphs()

◆ do_moveto()

static void do_moveto ( int32_t  x,
int32_t  y 
)
static

Definition at line 1349 of file dvi.c.

References dvi_state, dvi_registers::h, dvi_registers::v, cordic::x, and y.

Referenced by dvi_pop(), and dvi_rule().

◆ do_native_font_def()

static void do_native_font_def ( int32_t  tex_id)
static

Definition at line 1980 of file dvi.c.

References dvi_page_buf_index, linear, read_native_font_record(), and skip_native_font_def().

Referenced by dvi_scan_specials().

◆ do_putrule()

static void do_putrule ( void  )
static

Definition at line 1672 of file dvi.c.

References dvi_right(), dvi_rule(), get_buffered_signed_quad(), height, lr_mode, LTYPESETTING, RTYPESETTING, and width.

Referenced by dvi_do_page().

◆ do_scales()

static void do_scales ( double  mag)
static

Definition at line 459 of file dvi.c.

References dvi2pts, dvi_info, dvi_header::mag, mag, total_mag, dvi_header::unit_den, and dvi_header::unit_num.

Referenced by dvi_init().

◆ do_setrule()

static void do_setrule ( void  )
static

Definition at line 1650 of file dvi.c.

References dvi_right(), dvi_rule(), get_buffered_signed_quad(), height, lr_mode, lr_width, LTYPESETTING, RTYPESETTING, and width.

Referenced by dvi_do_page().

◆ do_xxx()

static void do_xxx ( int32_t  size)
static

Definition at line 1847 of file dvi.c.

References dvi_do_special(), dvi_page_buf_index, dvi_page_buffer, lr_mode, size, and SKIMMING.

Referenced by dvi_do_page().

◆ dvi_begin_reflect()

static void dvi_begin_reflect ( void  )
static

◆ dvi_close()

◆ dvi_comment()

const char* dvi_comment ( void  )

Definition at line 544 of file dvi.c.

References dvi_header::comment, and dvi_info.

Referenced by main().

◆ dvi_compute_boxes()

void dvi_compute_boxes ( int  flag)

Definition at line 889 of file dvi.c.

References compute_boxes, and flag.

Referenced by dev_tag_depth(), dev_untag_depth(), dvi_tag_depth(), and dvi_untag_depth().

◆ dvi_dev_xpos()

double dvi_dev_xpos ( void  )

Definition at line 1338 of file dvi.c.

References dvi2pts, dvi_state, and dvi_registers::h.

Referenced by dev_phys_x(), spc_lookup_object(), and spc_lookup_reference().

◆ dvi_dev_ypos()

double dvi_dev_ypos ( void  )

Definition at line 1344 of file dvi.c.

References dvi2pts, dvi_state, and dvi_registers::v.

Referenced by dev_phys_y(), spc_lookup_object(), and spc_lookup_reference().

◆ dvi_dirchg()

void dvi_dirchg ( unsigned char  dir)

Definition at line 1641 of file dvi.c.

References dvi_registers::d, dir, dpx_conf, dvi_state, fprintf, pdf_dev_set_dirmode(), and _dpx_conf::verbose_level.

Referenced by vf_set_char().

◆ dvi_do_page()

◆ dvi_do_special()

◆ dvi_down()

◆ dvi_end_reflect()

◆ dvi_init()

◆ dvi_is_tracking_boxes()

int dvi_is_tracking_boxes ( void  )

◆ dvi_link_annot()

void dvi_link_annot ( int  flag)

Definition at line 895 of file dvi.c.

References flag, and link_annot.

Referenced by spc_resume_annot(), and spc_suspend_annot().

◆ dvi_locate_font()

◆ dvi_locate_native_font()

static int dvi_locate_native_font ( const char *  filename,
uint32_t  index,
spt_t  ptsize,
int  layout_dir,
int  extend,
int  slant,
int  embolden 
)
static

Definition at line 1174 of file dvi.c.

References gm::advance, advance, gm::ascent, tt_hhea_table::ascent, fontmap_opt::bold, cff_close(), cff_font::cstrings, cff_index::data, gm::descent, tt_hhea_table::descent, dfont_open(), dpx_conf, dpx_find_dfont_file(), dpx_find_opentype_file(), dpx_find_truetype_file(), dpx_find_type1_file(), DPX_RES_TYPE_T1FONT, DPXFCLOSE, DPXFOPEN, dvi2pts, loaded_font::embolden, ERROR, loaded_font::extend, fontmap_opt::extend, extend, FILE, filename, loaded_font::font_id, font_id, fp, loaded_font::gm, head, i, cff_font::is_notdef_notzero, is_pfb(), is_type1, loaded_font::layout_dir, loaded_fonts, malloc, memset(), MESG(), MFOPEN, loaded_font::minbytes, NATIVE, need_more_fonts(), NEW, NULL, cff_font::num_glyphs, loaded_font::num_glyphs, num_loaded_fonts, maxp::numGlyphs, tt_hhea_table::numOfExSideBearings, tt_vhea_table::numOfExSideBearings, tt_hhea_table::numOfLongHorMetrics, tt_vhea_table::numOfLongVerMetrics, offset, cff_index::offset, sfnt::offset, fontmap_rec::opt, pdf_dev_font_minbytes(), pdf_dev_locate_font(), pdf_insert_native_fontmap_record(), pdf_lookup_fontmap_record(), ptsize, RELEASE, sfnt_close(), sfnt_find_table_pos(), sfnt_locate_table(), sfnt_open(), sfnt_read_table_directory(), SFNT_TYPE_DFONT, SFNT_TYPE_TTC, loaded_font::shift_gid, loaded_font::size, loaded_font::slant, fontmap_opt::slant, slant, sprintf, strlen(), cff_font::subrs, t1_load_font(), t1char_get_metrics(), tt_read_head_table(), tt_read_hhea_table(), tt_read_longMetrics(), tt_read_maxp_table(), tt_read_vhea_table(), ttc_read_offset(), loaded_font::type, sfnt::type, _dpx_conf::verbose_level, and WARN().

Referenced by do_fnt().

◆ dvi_mark_depth()

static void dvi_mark_depth ( void  )
static

Definition at line 854 of file dvi.c.

References dvi_stack_depth, link_annot, marked_depth, pdf_doc_break_annot(), and tagged_depth.

Referenced by dvi_do_page().

◆ dvi_npages()

unsigned int dvi_npages ( void  )

Definition at line 324 of file dvi.c.

References num_pages.

Referenced by do_dvi_pages(), and main().

◆ dvi_pop()

◆ dvi_push()

void dvi_push ( void  )

Definition at line 1693 of file dvi.c.

References dvi_stack, dvi_stack_depth, DVI_STACK_DEPTH_MAX, dvi_state, and ERROR.

◆ dvi_put()

◆ dvi_right()

◆ dvi_rule()

void dvi_rule ( int32_t  width,
int32_t  height 
)

◆ dvi_scan_specials()

void dvi_scan_specials ( int  page_no,
double *  page_width,
double *  page_height,
double *  x_offset,
double *  y_offset,
int landscape,
int majorversion,
int minorversion,
int do_enc,
int key_bits,
int32_t permission,
char *  owner_pw,
char *  user_pw,
int has_id,
unsigned char *  id1,
unsigned char *  id2 
)

◆ dvi_set()

◆ dvi_set_compensation()

void dvi_set_compensation ( double  x,
double  y 
)

Definition at line 933 of file dvi.c.

References compensation, dvi2pts, round, cordic::x, spt_coord::x, y, and spt_coord::y.

Referenced by spc_pop_coord(), and spc_push_coord().

◆ dvi_set_font()

void dvi_set_font ( int  font_id)

Definition at line 1789 of file dvi.c.

References current_font, and font_id.

Referenced by vf_fnt().

◆ dvi_set_linkmode()

void dvi_set_linkmode ( int  mode)

Definition at line 907 of file dvi.c.

References catch_phantom, and mode.

Referenced by spc_set_linkmode().

◆ dvi_set_phantom_height()

void dvi_set_phantom_height ( double  height,
double  depth 
)

Definition at line 913 of file dvi.c.

References catch_phantom, depth, height, phantom_depth, and phantom_height.

Referenced by spc_set_phantom().

◆ dvi_tag_depth()

void dvi_tag_depth ( void  )

Definition at line 875 of file dvi.c.

References dvi_compute_boxes(), marked_depth, and tagged_depth.

Referenced by spc_begin_annot().

◆ dvi_tell_mag()

double dvi_tell_mag ( void  )

◆ dvi_unit_size()

double dvi_unit_size ( void  )

Definition at line 999 of file dvi.c.

References dvi2pts.

Referenced by do_operator(), and mp_locate_font().

◆ dvi_untag_depth()

void dvi_untag_depth ( void  )

Definition at line 882 of file dvi.c.

References dvi_compute_boxes(), and tagged_depth.

Referenced by spc_end_annot().

◆ dvi_vf_finish()

void dvi_vf_finish ( void  )

Definition at line 2474 of file dvi.c.

References current_font, dvi_pop(), ERROR, num_saved_fonts, and saved_dvi_font.

Referenced by vf_set_char().

◆ dvi_vf_init()

void dvi_vf_init ( int  dev_font_id)

◆ dvi_w()

void dvi_w ( int32_t  ch)

Definition at line 1714 of file dvi.c.

References ch, dvi_right(), dvi_state, and dvi_registers::w.

Referenced by do_w1(), do_w2(), do_w3(), do_w4(), dvi_do_page(), vf_set_char(), and vf_w().

◆ dvi_w0()

void dvi_w0 ( void  )

Definition at line 1721 of file dvi.c.

References dvi_right(), dvi_state, and dvi_registers::w.

Referenced by dvi_do_page(), vf_set_char(), and vf_w0().

◆ dvi_x()

void dvi_x ( int32_t  ch)

Definition at line 1727 of file dvi.c.

References ch, dvi_right(), dvi_state, and dvi_registers::x.

Referenced by do_x1(), do_x2(), do_x3(), do_x4(), dvi_do_page(), vf_set_char(), and vf_x().

◆ dvi_x0()

void dvi_x0 ( void  )

Definition at line 1734 of file dvi.c.

References dvi_right(), dvi_state, and dvi_registers::x.

Referenced by dvi_do_page(), vf_set_char(), and vf_x0().

◆ dvi_y()

void dvi_y ( int32_t  ch)

Definition at line 1740 of file dvi.c.

References ch, dvi_down(), dvi_state, and dvi_registers::y.

Referenced by do_y1(), do_y2(), do_y3(), do_y4(), dvi_do_page(), vf_set_char(), and vf_y().

◆ dvi_y0()

void dvi_y0 ( void  )

Definition at line 1747 of file dvi.c.

References dvi_down(), dvi_state, and dvi_registers::y.

Referenced by dvi_do_page(), vf_set_char(), and vf_y0().

◆ dvi_z()

void dvi_z ( int32_t  ch)

Definition at line 1753 of file dvi.c.

References ch, dvi_down(), dvi_state, and dvi_registers::z.

Referenced by do_z1(), do_z2(), do_z3(), do_z4(), dvi_do_page(), vf_set_char(), and vf_z().

◆ dvi_z0()

void dvi_z0 ( void  )

Definition at line 1760 of file dvi.c.

References dvi_down(), dvi_state, and dvi_registers::z.

Referenced by dvi_do_page(), vf_set_char(), and vf_z0().

◆ find_post()

◆ get_and_buffer_bytes()

static void get_and_buffer_bytes ( FILE file,
unsigned int  count 
)
static

Definition at line 255 of file dvi.c.

References count, DVI_PAGE_BUF_CHUNK, dvi_page_buf_index, dvi_page_buf_size, dvi_page_buffer, ERROR, fread, and RENEW.

Referenced by dvi_scan_specials().

◆ get_and_buffer_unsigned_byte()

static int get_and_buffer_unsigned_byte ( FILE file)
static

◆ get_and_buffer_unsigned_pair()

static unsigned int get_and_buffer_unsigned_pair ( FILE file)
static

Definition at line 248 of file dvi.c.

References get_and_buffer_unsigned_byte().

Referenced by dvi_scan_specials().

◆ get_buffered_signed_num()

static int32_t get_buffered_signed_num ( unsigned char  num)
static

Definition at line 293 of file dvi.c.

References dvi_page_buf_index, dvi_page_buffer, num, and quad.

Referenced by dvi_do_page().

◆ get_buffered_signed_quad()

static int32_t get_buffered_signed_quad ( void  )
static

Definition at line 280 of file dvi.c.

References dvi_page_buf_index, dvi_page_buffer, i, and quad.

Referenced by do_glyphs(), do_putrule(), and do_setrule().

◆ get_buffered_unsigned_byte()

static int get_buffered_unsigned_byte ( void  )
static

Definition at line 268 of file dvi.c.

References dvi_page_buf_index, and dvi_page_buffer.

Referenced by do_dir(), and dvi_do_page().

◆ get_buffered_unsigned_num()

static int32_t get_buffered_unsigned_num ( unsigned char  num)
static

Definition at line 307 of file dvi.c.

References dvi_page_buf_index, dvi_page_buffer, num, and quad.

Referenced by dvi_do_page().

◆ get_buffered_unsigned_pair()

static unsigned int get_buffered_unsigned_pair ( void  )
static

Definition at line 273 of file dvi.c.

References dvi_page_buf_index, and dvi_page_buffer.

Referenced by do_glyphs(), and skip_glyphs().

◆ get_comment()

static void get_comment ( void  )
static

Definition at line 796 of file dvi.c.

Referenced by dvi_init().

◆ get_dvi_fonts()

◆ get_dvi_info()

◆ get_origin()

double get_origin ( int  x)

Definition at line 111 of file dvi.c.

References dev_origin_x, dev_origin_y, and cordic::x.

Referenced by spc_handler_ps_tricks_bput().

◆ get_page_info()

static void get_page_info ( int32_t  post_location)
static

◆ get_preamble_dvi_info()

◆ lr_width_pop()

static void lr_width_pop ( void  )
static

Definition at line 1911 of file dvi.c.

References ERROR, lr_width, lr_width_stack, and lr_width_stack_depth.

Referenced by dvi_do_page(), and dvi_end_reflect().

◆ lr_width_push()

static void lr_width_push ( void  )
static

Definition at line 1902 of file dvi.c.

References DVI_STACK_DEPTH_MAX, ERROR, lr_width, lr_width_stack, and lr_width_stack_depth.

Referenced by dvi_do_page(), and dvi_end_reflect().

◆ need_more_fonts()

static void need_more_fonts ( unsigned  n)
static

Definition at line 179 of file dvi.c.

References loaded_fonts, max_loaded_fonts, n, num_loaded_fonts, RENEW, and TEX_FONTS_ALLOC_SIZE.

Referenced by dvi_locate_font(), and dvi_locate_native_font().

◆ need_pTeX()

static void need_pTeX ( int  c)
static

Definition at line 352 of file dvi.c.

References c, ERROR, has_ptex, and is_ptex.

Referenced by dvi_do_page(), and dvi_scan_specials().

◆ need_XeTeX()

static void need_XeTeX ( int  c)
static

Definition at line 346 of file dvi.c.

References c, _dpx_conf::compat_mode, dpx_conf, dpx_mode_xdv_mode, and ERROR.

Referenced by dvi_do_page(), dvi_scan_specials(), and get_dvi_fonts().

◆ proc_dvilua_font_record()

◆ read_font_record()

◆ read_native_font_record()

◆ scan_special()

static int scan_special ( double *  wd,
double *  ht,
double *  xo,
double *  yo,
int lm,
int majorversion,
int minorversion,
int enable_encryption,
int key_bits,
int32_t permission,
char *  opassword,
char *  upassword,
int has_id,
unsigned char *  id1,
unsigned char *  id2,
const char *  buf,
uint32_t  size 
)
static

◆ scan_special_encrypt()

static int scan_special_encrypt ( int key_bits,
int32_t permission,
char *  opassword,
char *  upassword,
const char **  curptr,
const char *  endptr 
)
static

◆ scan_special_trailerid()

static int scan_special_trailerid ( unsigned char *  id1,
unsigned char *  id2,
const char **  curptr,
const char *  endptr 
)
static

◆ set_rule()

static void set_rule ( spt_t  xpos,
spt_t  ypos,
spt_t  width,
spt_t  height 
)
static

Definition at line 953 of file dvi.c.

References compensation, height, pdf_dev_set_rule(), width, spt_coord::x, and spt_coord::y.

Referenced by dvi_rule().

◆ set_string()

static void set_string ( spt_t  xpos,
spt_t  ypos,
const void instr_ptr,
int  instr_len,
spt_t  width,
int  font_id 
)
static

Definition at line 940 of file dvi.c.

References compensation, font_id, pdf_dev_set_string(), width, spt_coord::x, and spt_coord::y.

Referenced by do_glyphs(), dvi_put(), dvi_set(), and ng_set().

◆ skip_fntdef()

static void skip_fntdef ( void  )
static

Definition at line 1766 of file dvi.c.

References dvi_file, get_unsigned_byte(), and skip_bytes().

Referenced by check_postamble(), and do_fntdef().

◆ skip_glyphs()

static void skip_glyphs ( void  )
static

Definition at line 1990 of file dvi.c.

References get_buffered_unsigned_pair(), i, int(), skip_bufferd_bytes, and slen.

Referenced by do_glyphs().

◆ skip_native_font_def()

Variable Documentation

◆ catch_phantom

int catch_phantom = 0
static

Definition at line 224 of file dvi.c.

Referenced by dvi_right(), dvi_set_linkmode(), and dvi_set_phantom_height().

◆ compensation

struct spt_coord compensation = { 0, 0 }
static

◆ compute_boxes

int compute_boxes = 0
static

Definition at line 215 of file dvi.c.

Referenced by dvi_compute_boxes(), and dvi_is_tracking_boxes().

◆ current_font

◆ def_fonts

◆ dev_origin_x

double dev_origin_x = 72.0
static

Definition at line 109 of file dvi.c.

Referenced by do_bop(), dvi_do_page(), and get_origin().

◆ dev_origin_y

double dev_origin_y = 770.0
static

Definition at line 109 of file dvi.c.

Referenced by do_bop(), dvi_do_page(), and get_origin().

◆ dvi2pts

◆ dvi_file

◆ dvi_file_size

uint32_t dvi_file_size = 0
static

Definition at line 90 of file dvi.c.

Referenced by find_post().

◆ dvi_info

struct dvi_header dvi_info
static
Initial value:
= {
25400000 ,
473628672,
1000,
0, 0,
0,
{'\0'}
}

Referenced by do_scales(), dvi_comment(), get_dvi_info(), and get_preamble_dvi_info().

◆ dvi_page_buf_index

◆ dvi_page_buf_size

unsigned int dvi_page_buf_size
static

◆ dvi_page_buffer

◆ dvi_stack

struct dvi_registers dvi_stack[256u]
static

Definition at line 796 of file dvi.c.

Referenced by dvi_pop(), and dvi_push().

◆ dvi_stack_depth

unsigned dvi_stack_depth = 0
static

Definition at line 827 of file dvi.c.

Referenced by clear_state(), do_eop(), dvi_do_page(), dvi_mark_depth(), dvi_pop(), and dvi_push().

◆ dvi_state

◆ has_ptex

int has_ptex = 0
static

Definition at line 337 of file dvi.c.

Referenced by check_postamble(), and need_pTeX().

◆ invalid_signature

const char invalid_signature[]
static
Initial value:
=
"Something is wrong. Are you sure this is a DVI file?"

Definition at line 329 of file dvi.c.

Referenced by check_postamble(), find_post(), get_dvi_fonts(), get_preamble_dvi_info(), read_font_record(), and read_native_font_record().

◆ is_ptex

int is_ptex = 0
static

Definition at line 337 of file dvi.c.

Referenced by find_post(), get_preamble_dvi_info(), and need_pTeX().

◆ linear

◆ link_annot

int link_annot = 1
static

Definition at line 215 of file dvi.c.

Referenced by dvi_is_tracking_boxes(), dvi_link_annot(), and dvi_mark_depth().

◆ loaded_fonts

◆ lr_mode

◆ lr_state

struct dvi_lr lr_state
static

Definition at line 111 of file dvi.c.

Referenced by dvi_begin_reflect(), and dvi_end_reflect().

◆ lr_width

◆ lr_width_stack

uint32_t lr_width_stack[256u]
static

Definition at line 130 of file dvi.c.

Referenced by lr_width_pop(), and lr_width_push().

◆ lr_width_stack_depth

unsigned lr_width_stack_depth = 0
static

Definition at line 131 of file dvi.c.

Referenced by lr_width_pop(), and lr_width_push().

◆ marked_depth

unsigned marked_depth = 0
static

Definition at line 850 of file dvi.c.

Referenced by dvi_is_tracking_boxes(), dvi_mark_depth(), and dvi_tag_depth().

◆ max_def_fonts

int max_def_fonts = 0
static

Definition at line 214 of file dvi.c.

Referenced by proc_dvilua_font_record(), read_font_record(), and read_native_font_record().

◆ max_loaded_fonts

int max_loaded_fonts = 0
static

Definition at line 176 of file dvi.c.

Referenced by need_more_fonts().

◆ num_def_fonts

int num_def_fonts = 0
static

◆ num_loaded_fonts

int num_loaded_fonts = 0
static

Definition at line 176 of file dvi.c.

Referenced by dvi_close(), dvi_locate_font(), dvi_locate_native_font(), dvi_right(), and need_more_fonts().

◆ num_pages

◆ num_saved_fonts

int num_saved_fonts = 0
static

Definition at line 2454 of file dvi.c.

Referenced by dvi_vf_finish(), and dvi_vf_init().

◆ page_loc

int32_t* page_loc = NULL
static

Definition at line 87 of file dvi.c.

Referenced by dvi_begin_page(), dvi_close(), dvi_scan_specials(), get_page_info(), and ship_out().

◆ phantom_depth

double phantom_depth = 0.0
static

Definition at line 226 of file dvi.c.

Referenced by dvi_right(), and dvi_set_phantom_height().

◆ phantom_height

double phantom_height = 0.0
static

Definition at line 225 of file dvi.c.

Referenced by dvi_right(), and dvi_set_phantom_height().

◆ post_id_byte

int post_id_byte
static

Definition at line 337 of file dvi.c.

Referenced by check_id_bytes(), check_postamble(), and find_post().

◆ pre_id_byte

int pre_id_byte
static

Definition at line 337 of file dvi.c.

Referenced by check_id_bytes(), find_post(), and get_preamble_dvi_info().

◆ processing_page

int processing_page = 0
static

Definition at line 829 of file dvi.c.

Referenced by do_bop(), do_eop(), and dvi_do_page().

◆ saved_dvi_font

int saved_dvi_font[16u]
static

Definition at line 2453 of file dvi.c.

Referenced by dvi_vf_finish(), and dvi_vf_init().

◆ tagged_depth

int tagged_depth = -1
static

Definition at line 851 of file dvi.c.

Referenced by dvi_is_tracking_boxes(), dvi_mark_depth(), dvi_tag_depth(), and dvi_untag_depth().

◆ total_mag

double total_mag = 1.0
static

Definition at line 450 of file dvi.c.

Referenced by do_scales(), and dvi_tell_mag().