19 #ifndef GNASH_SWF_TEXTRECORD_H 20 #define GNASH_SWF_TEXTRECORD_H 24 #include <boost/intrusive_ptr.hpp> 31 class movie_definition;
71 typedef std::vector<GlyphEntry>
Glyphs;
78 size_t ret = c + glyphs.size();
97 const TextRecords& records,
bool embedded =
true);
104 _glyphs.insert(_glyphs.end(), num, ge);
108 if (!num) _glyphs.clear();
109 else _glyphs.resize(_glyphs.size() - num);
126 _htmlTarget = target;
143 for (
const auto& glyph :
glyphs())
145 width += glyph.advance;
204 std::uint16_t _textHeight;
219 boost::intrusive_ptr<const Font> _font;
221 std::string _htmlURL;
222 std::string _htmlTarget;
const rgba & color() const
Definition: TextRecord.h:184
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:95
bool hasYOffset() const
Definition: TextRecord.h:167
A Font resource.
Definition: Font.h:89
std::vector< GlyphEntry > Glyphs
Definition: TextRecord.h:71
float yOffset() const
Definition: TextRecord.h:176
const Glyphs & glyphs() const
Definition: TextRecord.h:99
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:30
void clearGlyphs(Glyphs::size_type num=0)
Definition: TextRecord.h:107
void setTarget(std::string target)
Definition: TextRecord.h:125
bool hasXOffset() const
Definition: TextRecord.h:154
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:40
void setXOffset(float x)
Definition: TextRecord.h:158
float xOffset() const
Definition: TextRecord.h:163
void addGlyph(const GlyphEntry &ge, Glyphs::size_type num=1)
Definition: TextRecord.h:103
Definition: klash_part.cpp:329
Definition: GnashKey.h:149
Definition: GnashKey.h:152
Base class for render handlers.
Definition: Renderer.h:188
bool underline() const
Definition: TextRecord.h:188
Accumulate the number of glyphs in a TextRecord.
Definition: TextRecord.h:74
float advance
Definition: TextRecord.h:56
Definition: GnashKey.h:166
Definition: klash_part.cpp:329
void setTextHeight(std::uint16_t height)
Definition: TextRecord.h:137
void setYOffset(float y)
Definition: TextRecord.h:171
Store a TextRecord.
Definition: TextRecord.h:47
void setURL(std::string url)
Definition: TextRecord.h:117
bool read(SWFStream &in, movie_definition &m, int glyphBits, int advanceBits, TagType tag)
Read a TextRecord from the stream.
Definition: TextRecord.cpp:39
TextRecord()
Definition: TextRecord.h:59
std::vector< TextRecord > TextRecords
Definition: TextRecord.h:51
void setColor(const rgba &color)
Definition: TextRecord.h:180
std::int32_t x
Definition: BitmapData_as.cpp:434
Definition: GnashKey.h:148
const std::string & getTarget() const
Definition: TextRecord.h:129
std::int32_t y
Definition: BitmapData_as.cpp:435
size_t operator()(size_t c, const TextRecord &t)
Definition: TextRecord.h:76
std::string url
Definition: gnash.cpp:59
float recordWidth() const
Definition: TextRecord.h:141
static void displayRecords(Renderer &renderer, const Transform &xform, const TextRecords &records, bool embedded=true)
Render the given glyph records.
Definition: TextRecord.cpp:163
Definition: GnashKey.h:159
const std::string & getURL() const
Definition: TextRecord.h:121
int index
Definition: TextRecord.h:55
void setFont(boost::intrusive_ptr< const Font > f)
Definition: TextRecord.h:113
void setUnderline(bool b)
Definition: TextRecord.h:192
std::uint16_t textHeight() const
Definition: TextRecord.h:150
const Font * getFont() const
Definition: TextRecord.h:133
Definition: GnashKey.h:331
Definition: TextRecord.h:53
SWF stream wrapper class.
Definition: SWFStream.h:58
A basic RGBA type.
Definition: RGBA.h:35