File: afm.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 (59 lines) | stat: -rw-r--r-- 1,359 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
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
// -*- related-file-name: "../../libefont/afm.cc" -*-
#ifndef EFONT_AFM_HH
#define EFONT_AFM_HH
#include <efont/metrics.hh>
class Slurper;
class Filename;
class ErrorHandler;
namespace Efont {
class AfmParser;

struct AfmMetricsXt: public MetricsXt {

    Vector<PermString> opening_comments;
    PermString notice;
    PermString encoding_scheme;

    PermString kind() const			{ return "AFM"; }

};

class AfmReader { public:

    static Metrics *read(const Filename &, ErrorHandler *);
    static Metrics *read(Slurper &, ErrorHandler *);

  private:

    Metrics *_afm;
    AfmMetricsXt *_afm_xt;
    AfmParser &_l;
    ErrorHandler *_errh;

    mutable bool _composite_warned;
    mutable bool _metrics_sets_warned;
    mutable int _y_width_warned;

    void lwarning(const char *, ...) const;
    void lerror(const char *, ...) const;
    void composite_warning() const;
    void metrics_sets_warning() const;
    void y_width_warning() const;
    void no_match_warning(const char *context = 0) const;

    double &fd(int i)				{ return _afm->fd(i); }
    GlyphIndex find_err(PermString, const char *) const;

    void read_char_metric_data() const;
    void read_char_metrics() const;
    void read_kerns() const;
    void read_composites() const;

    bool read();

    AfmReader(AfmParser &, Metrics *, AfmMetricsXt *, ErrorHandler *);

};

}
#endif