3 #ifndef DVI_FILE_HEADER_READ
4 #define DVI_FILE_HEADER_READ 1
8 #ifdef HAVE_CSTD_INCLUDE
36 #ifndef HOMEMADE_POSSTATESTACK
37 #define HOMEMADE_POSSTATESTACK 0
56 bool read_postamble=
true,
165 r = (netmag_ == 1.0 ? h_ :
static_cast<int>(h_*netmag_));
168 throw DviError(
"Bad unit in currH");
187 r = (netmag_ == 1.0 ? v_ :
static_cast<int>(v_*netmag_));
190 throw DviError(
"Bad unit in currV");
223 return static_cast<int>
224 (npt * dviu_per_pt_ / dviu_per_px_ + 0.5);
230 const string *
filename ()
const {
return &fileName_; }
253 int h_, v_, w_, x_, y_, z_;
259 int pending_hupdate_;
261 int pending_hhupdate_;
296 const double extmag_;
326 signed int getSIU(
int), getSIS(
int);
327 unsigned int getUIU(
int);
335 void read_postamble()
337 bool have_preread_postamble_;
338 bool have_read_to_postamble_;
340 void fnt_def_(
double fontmag,
int nbytes);
341 void check_duplicate_font(
int);
342 int pixel_round(
int);
343 int charWidth_ (
int charno);
344 int charEscapement_ (
int charno);
346 void updateH_ (
int hup,
int hhup);
347 void updateV_ (
int y);
349 const int h, v, w, x, y, z, hh, vv;
350 PosState(
int h,
int v,
int w,
int x,
int y,
int z,
int hh,
int vv)
351 : h(h),v(v),w(w),x(x),y(y),z(z),hh(hh),vv(vv) { }
353 #if HOMEMADE_POSSTATESTACK
354 class PosStateStack {
361 PosStateStack(
int size);
362 void push(
const PosState *p);
363 const PosState *pop();
364 bool empty()
const {
return i == 0; }
367 unsigned int size,
i;
370 PosStateStack *posStack_;
372 STD::stack<PosState> posStack_;
384 void add(
int fnt_num,
PkFont* newfont);
387 typedef STD::map<int,PkFont*> FontMap;
394 bool empty()
const {
return fontMap_.empty(); }
399 size_t size()
const {
return fontMap_.size(); }
415 STD::list<PkFont*> fontlist_;
440 class const_iterator {
443 const_iterator& operator++();
444 bool operator==(const const_iterator& it) const;
445 bool operator!=(const const_iterator& it) const;
447 bool operator==(
const const_iterator& it)
const
448 {
return finished_ == it.finished_; }
449 bool operator!=(
const const_iterator& it)
const
450 {
return finished_ != it.finished_; }
456 const_iterator(FontMap::const_iterator m,
457 FontMap::const_iterator me) {
462 const_iterator() : finished_(true) { }
463 FontMap::const_iterator mapiter_;
464 FontMap::const_iterator endmapiter_;
475 const_iterator begin() {
476 return const_iterator(fontMap_.begin(), fontMap_.end());
484 const_iterator end()
const {
return const_iterator(); };
485 friend class const_iterator;
524 virtual void debug()
const;
540 const unsigned char opcode()
const {
return opcode_; }
551 const unsigned char opcode_;
573 const int charno()
const {
return charno_; }
679 #endif //#ifndef DVI_FILE_HEADER_READ