~ubuntu-branches/ubuntu/lucid/lcdf-typetools/lucid

« back to all changes in this revision

Viewing changes to otftotfm/metrics.hh

  • Committer: Bazaar Package Importer
  • Author(s): C.M. Connelly
  • Date: 2010-01-20 01:19:30 UTC
  • mfrom: (1.2.11 upstream) (3.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100120011930-l2gn28dmguk4zgb5
Tags: 2.82-1
* New upstream release.
* otftotfm: Fixes em and ex measurements with TrueType fonts (from 2.81).
* otftotfm: Fixes handling of multiply encoded glyphs (glyphs in more
  than one slot).

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    PermString code_name(Code) const;
55
55
    inline const char *code_str(Code) const;
56
56
 
57
 
    inline Glyph glyph(Code) const;
58
 
    inline uint32_t unicode(Code) const;
59
 
    inline Code encoding(Glyph) const;
60
 
    Code unicode_encoding(uint32_t) const;
61
 
    Code force_encoding(Glyph, int lookup_source = -1);
62
 
    void encode(Code, uint32_t uni, Glyph);
 
57
    inline Glyph glyph(Code code) const;
 
58
    inline uint32_t unicode(Code code) const;
 
59
    inline Code encoding(Glyph g, Code after) const;
 
60
    Code unicode_encoding(uint32_t uni) const;
 
61
    Code force_encoding(Glyph g, int lookup_source = -1);
 
62
    void encode(Code code, uint32_t uni, Glyph g);
63
63
    void encode_virtual(Code, PermString, uint32_t uni, const Vector<Setting> &, bool base_char);
64
64
 
65
65
    void add_altselector_code(Code, int altselector_type);
174
174
    Metrics &operator=(const Metrics &); // does not exist
175
175
 
176
176
    inline void assign_emap(Glyph, Code);
177
 
    Code hard_encoding(Glyph) const;
 
177
    Code hard_encoding(Glyph, Code) const;
 
178
    bool next_encoding(Vector<Code> &codes, const Vector<Glyph> &glyphs) const;
178
179
 
179
180
    Ligature *ligature_obj(Code, Code);
180
181
    Kern *kern_obj(Code, Code);
186
187
    void mark_liveness(int size, const Vector<Ligature3> * = 0);
187
188
    void reencode(const Vector<Code> &);
188
189
 
 
190
    class ChangedContext;
189
191
    void apply_ligature(const Vector<Code> &, const Substitution *, int lookup);
 
192
    void apply_single(Code cin, const Substitution *s, int lookup,
 
193
                ChangedContext &ctx, const GlyphFilter &glyph_filter,
 
194
                const Vector<PermString> &glyph_names);
 
195
    void apply_simple_context_ligature(const Vector<Code> &codes,
 
196
                const Substitution *s, int lookup, ChangedContext &ctx);
 
197
    void apply_alternates_single(Code cin, const Substitution *s, int lookup,
 
198
                const GlyphFilter &glyph_filter,
 
199
                const Vector<PermString> &glyph_names);
 
200
    void apply_alternates_ligature(const Vector<Code> &codes,
 
201
                const Substitution *s, int lookup,
 
202
                const GlyphFilter &glyph_filter,
 
203
                const Vector<PermString> &glyph_names);
190
204
 
191
205
    void unparse(const Char *) const;
192
206
 
242
256
}
243
257
 
244
258
inline Metrics::Code
245
 
Metrics::encoding(Glyph g) const
 
259
Metrics::encoding(Glyph g, Code after) const
246
260
{
247
 
    if (g >= 0 && g < _emap.size() && _emap.at_u(g) >= -1)
248
 
        return _emap.at_u(g);
 
261
    Code c;
 
262
    if (g >= 0 && g < _emap.size() && (c = _emap.at_u(g)) >= -1)
 
263
        return c < 0 || c >= after ? c : -1;
249
264
    else
250
 
        return hard_encoding(g);
 
265
        return hard_encoding(g, after);
251
266
}
252
267
 
253
268
inline void