File: FTFace.h

package info (click to toggle)
gltt 2.5-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 880 kB
  • ctags: 515
  • sloc: sh: 7,193; cpp: 4,853; makefile: 173
file content (76 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (2)
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * gltt graphics library
 * Copyright (C) 1998-1999 Stephane Rehel
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef __FTFace_h
#define __FTFace_h

#ifndef __GLTTboolean_h
#include "GLTTboolean.h"
#endif

struct TT_Face_;
typedef struct TT_Face_ TT_Face;

class FTEngine;

/////////////////////////////////////////////////////////////////////////////

class FTFace
{
protected:
  FTEngine* engine;
  TT_Face* face;
  int indices[256];
  int* CP_table;

public:
  FTFace( FTEngine* _engine = 0 );

  virtual ~FTFace();

  GLTTboolean open( const char* filename );

  int CP_Translate( int code ) const;

private:
  GLTTboolean makeIndicesTable();

public:
  FTEngine* getEngine() const
    {
    return engine;
    }

  TT_Face* getFace() const
    {
    return face;
    }

  int getGlyphIndex( int ascii_code ) const
    {
    if( ascii_code < 0 || ascii_code > 255 )
      ascii_code= 0;

    return indices[ascii_code];
    }
};

/////////////////////////////////////////////////////////////////////////////

#endif // ifndef __FTFace_h