Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00025
00029
00030 #ifndef GNASH_SWF_DEFINEFONTTAG_H
00031 #define GNASH_SWF_DEFINEFONTTAG_H
00032
00033 #include "SWF.h"
00034 #include "Font.h"
00035 #include <map>
00036 #include <string>
00037 #include <boost/cstdint.hpp>
00038
00039
00040 namespace gnash {
00041 class SWFStream;
00042 class movie_definition;
00043 class RunResources;
00044 }
00045
00046 namespace gnash {
00047 namespace SWF {
00048
00050 class DefineFontTag
00051 {
00052 public:
00053
00055
00057 static void loader(SWFStream& in, TagType tag, movie_definition& m,
00058 const RunResources& r);
00059
00061 const Font::GlyphInfoRecords& glyphTable() const {
00062 return _glyphTable;
00063 }
00064
00066
00068
00070 bool hasCodeTable() const {
00071 return _codeTable.get();
00072 }
00073
00075
00078
00082 boost::shared_ptr<const Font::CodeTable> getCodeTable() const {
00083 return _codeTable;
00084 }
00085
00086 bool ansiChars() const { return _ansiChars; }
00087 bool shiftJISChars() const { return _shiftJISChars; }
00088 bool unicodeChars() const { return _unicodeChars; }
00089 bool italic() const { return _italic; }
00090 bool bold() const { return _bold; }
00091 bool subpixelFont() const { return _subpixelFont; }
00092
00094
00096 boost::int16_t leading() const {
00097 return _leading;
00098 }
00099
00101
00103 boost::int16_t ascent() const {
00104 return _ascent;
00105 }
00106
00108
00110 boost::int16_t descent() const {
00111 return _descent;
00112 }
00113
00114 const std::string& name() const { return _name; }
00115
00117 static void readCodeTable(SWFStream& in, Font::CodeTable& table,
00118 bool wideCodes, size_t glyphCount);
00119
00120 private:
00121
00122 DefineFontTag(SWFStream& in, movie_definition& m, TagType tag,
00123 const RunResources& r);
00124
00126 void readDefineFont(SWFStream& in, movie_definition& m,
00127 const RunResources& r);
00128
00130 void readDefineFont2Or3(SWFStream& in, movie_definition& m,
00131 const RunResources& r);
00132
00134 Font::GlyphInfoRecords _glyphTable;
00135
00136 std::string _name;
00137 bool _subpixelFont;
00138 bool _hasLayout;
00139 bool _unicodeChars;
00140 bool _shiftJISChars;
00141 bool _ansiChars;
00142 bool _italic;
00143 bool _bold;
00144 bool _wideCodes;
00145
00146 boost::int16_t _ascent;
00147 boost::int16_t _descent;
00148 boost::int16_t _leading;
00149
00150 typedef std::map<kerning_pair, boost::int16_t> KerningTable;
00151 KerningTable _kerningPairs;
00152
00153 boost::shared_ptr<const Font::CodeTable> _codeTable;
00154 };
00155
00156
00157 class DefineFontInfoTag
00158 {
00159 public:
00161
00165 static void loader(SWFStream& in, TagType tag, movie_definition& m,
00166 const RunResources& r);
00167 };
00168
00169 }
00170 }
00171
00172 #endif