File: encoding.hh

package info (click to toggle)
lcdf-typetools 2.92%2Bdfsg1-0.1
  • links: PTS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 2,884 kB
  • sloc: cpp: 34,407; ansic: 2,106; sh: 1,032; makefile: 306
file content (27 lines) | stat: -rw-r--r-- 545 bytes parent folder | download | duplicates (8)
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
// -*- related-file-name: "../../libefont/encoding.cc" -*-
#ifndef EFONT_ENCODING_HH
#define EFONT_ENCODING_HH
#include <lcdf/vector.hh>
namespace Efont {
typedef int GlyphIndex;

class Encoding8 {

  Vector<GlyphIndex> _codes;
  Vector<int> _code_map;

 public:

  Encoding8()				: _code_map(256, -1) { }

  void reserve_glyphs(int);

  int code(GlyphIndex gi) const		{ return _codes[gi]; }
  GlyphIndex find_code(int c) const	{ return _code_map[c]; }

  void set_code(GlyphIndex gi, int c)	{ _codes[gi] = c; _code_map[c] = gi; }

};

}
#endif