| 1 |
#ifndef T1REWRIT_HH |
| 2 |
#define T1REWRIT_HH |
| 3 |
#include <efont/t1interp.hh> |
| 4 |
#include <efont/t1font.hh> |
| 5 |
#include <lcdf/straccum.hh> |
| 6 |
|
| 7 |
class Type1MMRemover { public: |
| 8 |
|
| 9 |
Type1MMRemover(Efont::Type1Font *, const Vector<double> &weight_vec, int, ErrorHandler *); |
| 10 |
~Type1MMRemover(); |
| 11 |
|
| 12 |
Efont::CharstringProgram *program() const { return _font; } |
| 13 |
const Vector<double> &weight_vector() const { return _weight_vector; } |
| 14 |
int nmasters() const { return _weight_vector.size(); } |
| 15 |
int precision() const { return _precision; } |
| 16 |
|
| 17 |
Efont::Type1Charstring *subr_prefix(int); |
| 18 |
Efont::Type1Charstring *subr_expander(int); |
| 19 |
|
| 20 |
void run(); |
| 21 |
|
| 22 |
private: |
| 23 |
|
| 24 |
Efont::Type1Font *_font; |
| 25 |
Vector<double> _weight_vector; |
| 26 |
int _precision; |
| 27 |
|
| 28 |
int _nsubrs; |
| 29 |
Vector<int> _subr_done; |
| 30 |
Vector<Efont::Type1Charstring *> _subr_prefix; |
| 31 |
Vector<int> _must_expand_subr; |
| 32 |
Vector<int> _hint_replacement_subr; |
| 33 |
bool _expand_all_subrs; |
| 34 |
|
| 35 |
ErrorHandler *_errh; |
| 36 |
|
| 37 |
}; |
| 38 |
|
| 39 |
|
| 40 |
class Type1SubrRemover { public: |
| 41 |
|
| 42 |
Type1SubrRemover(Efont::Type1Font *, ErrorHandler *); |
| 43 |
~Type1SubrRemover(); |
| 44 |
|
| 45 |
Efont::CharstringProgram *program() const { return _font; } |
| 46 |
ErrorHandler *errh() const { return _errh; } |
| 47 |
|
| 48 |
int save_count() const { return _save_count; } |
| 49 |
|
| 50 |
bool run(int); |
| 51 |
|
| 52 |
private: |
| 53 |
|
| 54 |
Efont::Type1Font *_font; |
| 55 |
|
| 56 |
int _nsubrs; |
| 57 |
enum { REMOVABLE = -1, DEAD = -2 }; |
| 58 |
Vector<int> _renumbering; |
| 59 |
Vector<int> _cost; |
| 60 |
int _save_count; |
| 61 |
int _nonexist_count; |
| 62 |
|
| 63 |
ErrorHandler *_errh; |
| 64 |
|
| 65 |
}; |
| 66 |
|
| 67 |
|
| 68 |
#endif |