summaryrefslogtreecommitdiffstats
path: root/kdvi/TeXFont.h
blob: 77923f12033771c6a81964c24ca5439b692aef7f (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
38
39
40
41
42
43
44
45
46
47
// TeXFont.h
//
// Part of KDVI - A DVI previewer for the KDE desktop environemt 
//
// (C) 2003 Stefan Kebekus
// Distributed under the GPL

#ifndef _TEXFONT_H
#define _TEXFONT_H

#include "TeXFontDefinition.h"
#include "glyph.h"


class TeXFont {
 public:
  TeXFont(TeXFontDefinition *_parent)
    {
      parent       = _parent;
      errorMessage = TQString();
    };
  
  virtual ~TeXFont();
  
  void setDisplayResolution()
    {
      for(unsigned int i=0; i<TeXFontDefinition::max_num_of_chars_in_font; i++)
	glyphtable[i].shrunkenCharacter.resize(0, 0);
    };
  
  virtual glyph* getGlyph(TQ_UINT16 character, bool generateCharacterPixmap=false, const TQColor& color=TQt::black) = 0;

  // Checksum of the font. Used e.g. by PK fonts. This field is filled
  // in by the constructor, or set to 0.0, if the font format does not
  // contain checksums.
  TQ_UINT32           checksum;

  // If the font or if some glyphs could not be loaded, error messages
  // will be put here.
  TQString            errorMessage;
   
 protected:
  glyph              glyphtable[TeXFontDefinition::max_num_of_chars_in_font];
  TeXFontDefinition *parent;
};

#endif