diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-07-08 06:44:39 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-07-08 06:44:39 +0000 |
commit | eadda9e7616e95abf27cb9c9c208db41371a6cf5 (patch) | |
tree | 909828105d8a9c05d6af749aefbe39f117bbfa7d /Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/efont/otfpost.hh | |
parent | 0b34c5e54c8d047aa6a34af8ced91b29c5e7ad46 (diff) |
lcdf-typetools 2.104
git-svn-id: svn://tug.org/texlive/trunk@34550 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/efont/otfpost.hh')
-rw-r--r-- | Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/efont/otfpost.hh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/efont/otfpost.hh b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/efont/otfpost.hh new file mode 100644 index 00000000000..58651583fcb --- /dev/null +++ b/Build/source/texk/lcdf-typetools/lcdf-typetools-2.104/include/efont/otfpost.hh @@ -0,0 +1,62 @@ +// -*- related-file-name: "../../libefont/otfpost.cc" -*- +#ifndef EFONT_OTFPOST_HH +#define EFONT_OTFPOST_HH +#include <efont/otfdata.hh> +#include <lcdf/error.hh> +namespace Efont { namespace OpenType { + +class Post { public: + + Post(const String &, ErrorHandler * = 0); + // default destructor + + bool ok() const { return _error >= 0; } + int error() const { return _error; } + + double italic_angle() const; + bool is_fixed_pitch() const; + inline int underline_position() const; + inline int underline_thickness() const; + inline uint32_t mem_type42(bool ismax) const; + int nglyphs() const { return _nglyphs; } + bool glyph_names(Vector<PermString> &gnames) const; + + private: + + Data _str; + int _error; + uint32_t _version; + int _nglyphs; + Vector<int> _extend_glyph_names; + + enum { HEADER_SIZE = 32, N_MAC_GLYPHS = 258 }; + int parse_header(ErrorHandler *); + +}; + +inline int +Post::underline_position() const +{ + // NB: "This is the suggested distance of the top of the underline from + // the baseline (negative values indicate below baseline). The PostScript + // definition of this FontInfo dictionary key (the y coordinate of the + // center of the stroke) is not used for historical reasons. The value of + // the PostScript key may be calculated by subtracting half the + // underlineThickness from the value of this field." -- OpenType spec + return ok() ? _str.s16(8) : 0; +} + +inline int +Post::underline_thickness() const +{ + return ok() ? _str.s16(10) : 0; +} + +inline uint32_t +Post::mem_type42(bool ismax) const +{ + return ok() ? _str.u32(ismax ? 20 : 16) : 0; +} + +}} +#endif |