Go to the documentation of this file.
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;
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;
size_t operator()(size_t c, const TextRecord &t)
Definition: TextRecord.h:76
static void displayRecords(Renderer &renderer, const Transform &xform, const TextRecords &records, bool embedded=true)
Render the given glyph records.
Definition: TextRecord.cpp:163
void ensureBits(unsigned long needed)
Ensure the requested number of bits are available for a bitwise read in currently opened tag.
Definition: SWFStream.h:382
unsigned read_uint(unsigned short bitcount)
Reads a bit-packed unsigned integer from the stream and returns it. The given bitcount determines the...
Definition: SWFStream.cpp:102
SWF::ShapeRecord * get_glyph(int glyph_index, bool embedded) const
Get glyph by index.
Definition: Font.cpp:101
@ DEFINETEXT
Definition: SWF.h:43
int read_sint(unsigned short bitcount)
Reads a bit-packed little-endian signed integer from the stream. The given bitcount determines the nu...
Definition: SWFStream.cpp:191
@ height
Definition: klash_part.cpp:329
void setTarget(std::string target)
Definition: TextRecord.h:125
void log_swferror(StringType msg, Args... args)
Definition: log.h:325
TextRecord()
Definition: TextRecord.h:59
void setFont(boost::intrusive_ptr< const Font > f)
Definition: TextRecord.h:113
TagType
SWF tag types. Symbolic names copied from Ming.
Definition: SWF.h:31
const Glyphs & glyphs() const
Definition: TextRecord.h:99
void log_debug(StringType msg, Args... args)
Definition: log.h:301
std::int32_t y
Definition: BitmapData_as.cpp:435
@ i
Definition: GnashKey.h:155
A basic RGBA type.
Definition: RGBA.h:36
virtual void drawLine(const std::vector< point > &coords, const rgba &color, const SWFMatrix &mat)=0
Draw a line-strip directly, using a thin, solid line.
#define _(String)
Definition: log.h:44
float advance
Definition: TextRecord.h:56
bool hasXOffset() const
Definition: TextRecord.h:154
Anonymous namespace for callbacks, local functions, event handlers etc.
Definition: dbus_ext.cpp:41
void setUnderline(bool b)
Definition: TextRecord.h:192
bool underline() const
Definition: TextRecord.h:188
float yOffset() const
Definition: TextRecord.h:176
Base class for render handlers.
Definition: Renderer.h:189
void setXOffset(float x)
Definition: TextRecord.h:158
@ m
Definition: GnashKey.h:159
std::vector< TextRecord > TextRecords
Definition: TextRecord.h:51
void setTextHeight(std::uint16_t height)
Definition: TextRecord.h:137
bool read(SWFStream &in, movie_definition &m, int glyphBits, int advanceBits, TagType tag)
Read a TextRecord from the stream.
Definition: TextRecord.cpp:39
Client program's interface to the definition of a movie or sprite.
Definition: movie_definition.h:96
const std::string & getURL() const
Definition: TextRecord.h:121
std::int16_t read_s16()
Read a aligned signed 16-bit value from the stream.
Definition: SWFStream.cpp:355
#define IF_VERBOSE_MALFORMED_SWF(x)
Definition: log.h:404
float xOffset() const
Definition: TextRecord.h:163
@ t
Definition: GnashKey.h:166
void addGlyph(const GlyphEntry &ge, Glyphs::size_type num=1)
Definition: TextRecord.h:103
const std::string & getTarget() const
Definition: TextRecord.h:129
void setColor(const rgba &color)
Definition: TextRecord.h:180
virtual void drawGlyph(const SWF::ShapeRecord &rec, const rgba &color, const SWFMatrix &mat)=0
Draws a glyph (font character).
float recordWidth() const
Definition: TextRecord.h:141
Accumulate the number of glyphs in a TextRecord.
Definition: TextRecord.h:75
void setYOffset(float y)
Definition: TextRecord.h:171
void clearGlyphs(Glyphs::size_type num=0)
Definition: TextRecord.h:107
geometry::Point2d point
Definition: Point2d.h:143
std::int32_t tx() const
Definition: SWFMatrix.h:95
size_t unitsPerEM(bool embedded) const
Return height of the EM square used for glyphs definition.
Definition: Font.cpp:257
Definition: TextRecord.h:54
Definition: SWFMatrix.h:54
double get_x_scale() const
return the magnitude scale of our x coord output
Definition: SWFMatrix.cpp:314
const rgba & color() const
Definition: TextRecord.h:184
void setURL(std::string url)
Definition: TextRecord.h:117
#define IF_VERBOSE_PARSE(x)
Definition: log.h:378
std::uint8_t m_a
Definition: RGBA.h:113
void log_parse(StringType msg, Args... args)
Definition: log.h:313
int index
Definition: TextRecord.h:55
rgba readRGB(SWFStream &in)
Read an RGB rgba from input stream.
Definition: TypesParser.cpp:106
std::vector< GlyphEntry > Glyphs
Definition: TextRecord.h:71
std::string url
Definition: gnash.cpp:59
@ f
Definition: GnashKey.h:152
A Font resource.
Definition: Font.h:90
std::uint16_t read_u16()
Read a aligned unsigned 16-bit value from the stream.
Definition: SWFStream.cpp:332
@ c
Definition: GnashKey.h:149
bool hasYOffset() const
Definition: TextRecord.h:167
std::int32_t ty() const
Definition: SWFMatrix.h:99
std::uint8_t read_u8()
Read a aligned unsigned 8-bit value from the stream.
Definition: SWFStream.cpp:319
double get_y_scale() const
return the magnitude scale of our y coord output
Definition: SWFMatrix.cpp:322
Holds information needed to draw a shape.
Definition: ShapeRecord.h:127
SWF stream wrapper class.
Definition: SWFStream.h:59
void ensureBytes(unsigned long needed)
Ensure the requested number of bytes are available for an aligned read in the currently opened tag.
Definition: SWFStream.cpp:50
@ width
Definition: klash_part.cpp:329
@ SWF
Definition: GnashKey.h:331
Store a TextRecord.
Definition: TextRecord.h:48
std::int32_t x
Definition: BitmapData_as.cpp:434
@ b
Definition: GnashKey.h:148
const Font * getFont() const
Definition: TextRecord.h:133
rgba readRGBA(SWFStream &in)
Read an RGBA rgba from input stream.
Definition: TypesParser.cpp:95
std::uint16_t textHeight() const
Definition: TextRecord.h:150