diff options
author | Karl Berry <karl@freefriends.org> | 2008-02-17 19:29:39 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-02-17 19:29:39 +0000 |
commit | fc3b5d4d4f684baa6216685a0696efb853141529 (patch) | |
tree | 0694ed01c09b3c97fcd64453e2c1f647a3fb31ad /Build/source/texk/lcdf-typetools/include/efont/otfpost.hh | |
parent | 5fc0a693ca037d37d815b00c49660c138b332224 (diff) |
move lcdf-typetools to texk and update to 2.66
git-svn-id: svn://tug.org/texlive/trunk@6662 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/lcdf-typetools/include/efont/otfpost.hh')
-rw-r--r-- | Build/source/texk/lcdf-typetools/include/efont/otfpost.hh | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/Build/source/texk/lcdf-typetools/include/efont/otfpost.hh b/Build/source/texk/lcdf-typetools/include/efont/otfpost.hh new file mode 100644 index 00000000000..4d7ff64146c --- /dev/null +++ b/Build/source/texk/lcdf-typetools/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 |