summaryrefslogtreecommitdiffstats
path: root/kdvi/TeXFont_TFM.h
blob: 5c86aaf98de4f0717c6be6da3381e6b062ce55e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// TeXFont_TFM.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt 
//
// (C) 2003 Stefan Kebekus
// Distributed under the GPL

#ifndef _TEXFONT_TFM_H
#define _TEXFONT_TFM_H

#include "TeXFont.h"


class fix_word {
 public:
  void fromINT32(TQ_INT32 val) {value = val;} 
  void fromDouble(double val) {value = (TQ_INT32)(val * (1<<20) + 0.5);}
  double toDouble() {return (double(value)) / (double(1<<20));}

  TQ_INT32 value;
};

class TeXFont_TFM : public TeXFont {
 public:
  TeXFont_TFM(TeXFontDefinition *parent);
  ~TeXFont_TFM();
  
  glyph* getGlyph(TQ_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=TQt::black);

 private:
  fix_word characterWidth_in_units_of_design_size[256];
  fix_word characterHeight_in_units_of_design_size[256];

  fix_word design_size_in_TeX_points;
};

#endif