w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

dvipsencoding.hh
Go to the documentation of this file.
1 #ifndef OTFTOTFM_DVIPSENCODING_HH
2 #define OTFTOTFM_DVIPSENCODING_HH
3 #include <efont/otfcmap.hh>
4 #include <efont/cff.hh>
5 #include <lcdf/hashmap.hh>
6 class Metrics;
7 class Secondary;
8 class FontInfo;
9 
10 class DvipsEncoding { public:
11 
12  DvipsEncoding();
13 
14  static void add_glyphlist(String);
15 
16  operator bool() const { return _e.size() > 0; }
17  const String &name() const { return _name; }
18  const String &filename() const { return _filename; }
19  int boundary_char() const { return _boundary_char; }
20  const String &coding_scheme() const { return _coding_scheme; }
22  void set_warn_missing(bool wm) { _warn_missing = wm; }
23 
24  void encode(int, PermString);
25  inline int encoding_of(PermString) const;
26  int encoding_of(PermString, bool encode);
27  inline bool encoded(int e) const;
28  inline PermString encoding(int e) const;
29  int encoding_size() const { return _e.size(); }
30 
31  int parse(String filename, bool ignore_ligkern, bool ignore_other, ErrorHandler *);
32  int parse_ligkern(const String &ligkern_text, int override, ErrorHandler *);
33  int parse_position(const String &ligkern_text, int override, ErrorHandler *);
34  int parse_unicoding(const String &unicoding_text, int override, ErrorHandler *);
35 
36  bool file_had_ligkern() const { return _file_had_ligkern; }
37 
38  // also modifies 'this':
39  void make_metrics(Metrics &, const FontInfo &, Secondary *, bool literal, ErrorHandler *);
40  void make_base_mappings(Vector<int> &mappings, const FontInfo &);
41 
42  void apply_ligkern_lig(Metrics &, ErrorHandler *) const;
43  void apply_ligkern_kern(Metrics &, ErrorHandler *) const;
44  void apply_position(Metrics &, ErrorHandler *) const;
45 
46  enum { JT_KERN = 32, JT_LIG = 64, JT_ADDLIG = 128, JT_LIGALL = 199,
52  J_ALL = 0x7FFFFFFF }; // also see nokern_names in dvipsencoding.cc
53 
54  private:
55 
56  struct Ligature {
57  int c1, c2, join, k, d;
58  };
59 
64 
69 
71 
80 
81  struct WordType {
82  const char *name;
84  };
85  static const WordType word_types[];
87 
88  void add_ligkern(const Ligature &, int override);
89  enum { EPARSE = 90000 };
90  int parse_ligkern_words(Vector<String> &, int override, ErrorHandler *);
91  int parse_position_words(Vector<String> &, int override, ErrorHandler *);
92  int parse_unicoding_words(Vector<String> &, int override, ErrorHandler *);
93  void parse_word_group(Vector<String> &, int override, int wt, ErrorHandler *);
94  int parse_words(const String &, int override, int wt, ErrorHandler *);
95  void bad_codepoint(int, Metrics &, HashMap<PermString, int> &bad_unicodes);
96  bool x_unicodes(PermString chname, Vector<uint32_t> &unicodes) const;
97  String landmark(int line) const;
98 
100 
101  static bool glyphname_unicode(String, Vector<uint32_t> &);
102 
103  friend inline bool operator==(const Ligature&, const Ligature&);
104 
105 };
106 
107 inline bool
109 {
110  return e >= 0 && e < _e.size() && _e[e] != dot_notdef;
111 }
112 
113 inline PermString
115 {
116  if (encoded(e))
117  return _e[e];
118  else
119  return PermString();
120 }
121 
122 inline int
124 {
125  return const_cast<DvipsEncoding *>(this)->encoding_of(what, false);
126 }
127 
128 #endif
#define bool
Definition: autosp.c:101
int parse_ligkern(const String &ligkern_text, int override, ErrorHandler *)
void add_ligkern(const Ligature &, int override)
Vector< uint32_t > _unicodes
void bad_codepoint(int, Metrics &, HashMap< PermString, int > &bad_unicodes)
HashMap< PermString, int > _unicoding_map
const String & coding_scheme() const
int parse_ligkern_words(Vector< String > &, int override, ErrorHandler *)
int encoding_of(PermString) const
void apply_ligkern_kern(Metrics &, ErrorHandler *) const
void set_coding_scheme(const String &s)
Vector< Ligature > _lig
String _coding_scheme
void parse_word_group(Vector< String > &, int override, int wt, ErrorHandler *)
static bool glyphname_unicode(String, Vector< uint32_t > &)
const String & name() const
void apply_position(Metrics &, ErrorHandler *) const
bool x_unicodes(PermString chname, Vector< uint32_t > &unicodes) const
bool _file_had_ligkern
void make_metrics(Metrics &, const FontInfo &, Secondary *, bool literal, ErrorHandler *)
int parse_position(const String &ligkern_text, int override, ErrorHandler *)
const String & filename() const
PermString encoding(int e) const
static void add_glyphlist(String)
void set_warn_missing(bool wm)
int boundary_char() const
Vector< bool > _encoding_required
int parse(String filename, bool ignore_ligkern, bool ignore_other, ErrorHandler *)
static const WordType word_types[]
void make_base_mappings(Vector< int > &mappings, const FontInfo &)
int parse_unicoding(const String &unicoding_text, int override, ErrorHandler *)
int parse_unicoding_words(Vector< String > &, int override, ErrorHandler *)
static PermString dot_notdef
bool file_had_ligkern() const
int parse_words(const String &, int override, int wt, ErrorHandler *)
String _printable_filename
String _final_text
void apply_ligkern_lig(Metrics &, ErrorHandler *) const
void encode(int, PermString)
String _initial_comment
Vector< PermString > _e
String landmark(int line) const
Vector< Ligature > _pos
int encoding_size() const
friend bool operator==(const Ligature &, const Ligature &)
Vector< uint32_t > _unicoding
int parse_position_words(Vector< String > &, int override, ErrorHandler *)
bool encoded(int e) const
Error reporting class.
Definition: error.hh:86
Definition: vector.hh:17
#define s
Definition: afcover.h:80
ShellFileEnvironment e
Definition: sh6.c:388
int(DvipsEncoding::* parsefunc)(Vector< String > &, int, ErrorHandler *)
Definition: gsub.h:72
A string of characters.
Definition: t1part.c:49
Definition: bdf.c:133
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)