Gnash
0.8.11dev
|
Store a TextRecord. More...
#include <TextRecord.h>
Classes | |
struct | GlyphEntry |
struct | RecordCounter |
Accumulate the number of glyphs in a TextRecord. More... | |
Public Types | |
typedef std::vector< TextRecord > | TextRecords |
typedef std::vector< GlyphEntry > | Glyphs |
Public Member Functions | |
TextRecord () | |
bool | read (SWFStream &in, movie_definition &m, int glyphBits, int advanceBits, TagType tag) |
Read a TextRecord from the stream. More... | |
const Glyphs & | glyphs () const |
void | addGlyph (const GlyphEntry &ge, Glyphs::size_type num=1) |
void | clearGlyphs (Glyphs::size_type num=0) |
void | setFont (boost::intrusive_ptr< const Font > f) |
void | setURL (std::string url) |
const std::string & | getURL () const |
void | setTarget (std::string target) |
const std::string & | getTarget () const |
const Font * | getFont () const |
void | setTextHeight (std::uint16_t height) |
float | recordWidth () const |
std::uint16_t | textHeight () const |
bool | hasXOffset () const |
void | setXOffset (float x) |
float | xOffset () const |
bool | hasYOffset () const |
void | setYOffset (float y) |
float | yOffset () const |
void | setColor (const rgba &color) |
const rgba & | color () const |
bool | underline () const |
void | setUnderline (bool b) |
Static Public Member Functions | |
static void | displayRecords (Renderer &renderer, const Transform &xform, const TextRecords &records, bool embedded=true) |
Render the given glyph records. More... | |
Store a TextRecord.
This consists of style information and a number of glyphs. This may be parsed from a SWFStream, or it can be constructed dynamically by TextField. A static TextField has fewer possible properties than a dynamic one.
typedef std::vector<GlyphEntry> gnash::SWF::TextRecord::Glyphs |
typedef std::vector<TextRecord> gnash::SWF::TextRecord::TextRecords |
|
inline |
|
inline |
Referenced by gnash::TextField::setFont().
|
inline |
Referenced by gnash::TextField::setFont().
|
inline |
Referenced by setColor(), and gnash::TextField::setFont().
|
static |
Render the given glyph records.
Display of device fonts is complicated in Gnash as we use the same rendering process as for embedded fonts. The shape and position of a font relies on the concatenated transformation of its containing DisplayObject and all parent DisplayObjects. Device fonts have the peculiarity that the glyphs are always scaled equally in both dimensions, using the y scale only. However, indentation and left margin (the starting x position) are scaled using the given x scale. The translation is applied as normal. The proprietary player does not display rotated or skewed device fonts. Gnash does.
References gnash::Transform::colorTransform, gnash::SWFMatrix::concatenate_scale(), gnash::SWFMatrix::concatenate_translation(), gnash::Renderer::drawGlyph(), gnash::Renderer::drawLine(), gnash::Font::get_glyph(), gnash::SWFMatrix::get_x_scale(), gnash::SWFMatrix::get_y_scale(), IF_VERBOSE_MALFORMED_SWF, gnash::log_debug(), gnash::log_swferror(), gnash::key::m, gnash::rgba::m_a, gnash::Transform::matrix, gnash::SWFCxForm::transform(), gnash::SWFMatrix::tx(), gnash::SWFMatrix::ty(), underline(), gnash::Font::unitsPerEM(), x, and y.
Referenced by gnash::SWF::DefineTextTag::display(), gnash::TextField::display(), and gnash::SWF::TextRecord::RecordCounter::operator()().
|
inline |
Referenced by gnash::TextField::setFont().
|
inline |
Referenced by gnash::TextField::mouseEvent().
|
inline |
Referenced by gnash::TextField::mouseEvent().
|
inline |
|
inline |
|
inline |
bool gnash::SWF::TextRecord::read | ( | SWFStream & | in, |
movie_definition & | m, | ||
int | glyphBits, | ||
int | advanceBits, | ||
TagType | tag | ||
) |
Read a TextRecord from the stream.
in | The SWFStream to read from. |
m | The movie_definition containing this TextRecord. |
glyphBits | The number of bits per glyph |
advanceBits | The number of bits per advance |
tag | The tag type of this TextRecord. This must be DefineText or DefineText2 |
References _, gnash::SWF::TextRecord::GlyphEntry::advance, gnash::SWF::DEFINETEXT, gnash::SWFStream::ensureBits(), gnash::SWFStream::ensureBytes(), gnash::movie_definition::get_font(), gnash::key::i, IF_VERBOSE_PARSE, gnash::SWF::TextRecord::GlyphEntry::index, gnash::log_parse(), gnash::SWFStream::read_s16(), gnash::SWFStream::read_sint(), gnash::SWFStream::read_u16(), gnash::SWFStream::read_u8(), gnash::SWFStream::read_uint(), gnash::readRGB(), and gnash::readRGBA().
Referenced by gnash::SWF::TextRecord::RecordCounter::operator()().
|
inline |
References color().
Referenced by gnash::TextField::setFont(), and gnash::TextField::setTextColor().
|
inline |
References gnash::key::f.
Referenced by gnash::TextField::setFont().
|
inline |
Referenced by gnash::TextField::setFont().
|
inline |
References height.
Referenced by gnash::TextField::setFont().
|
inline |
References gnash::key::b.
Referenced by gnash::TextField::setFont().
|
inline |
References url.
Referenced by gnash::TextField::setFont().
|
inline |
References x.
Referenced by gnash::TextField::setFont(), and gnash::TextField::setTextFormat().
|
inline |
References y.
Referenced by gnash::TextField::setFont().
|
inline |
Referenced by gnash::TextField::removeTextField(), and gnash::TextField::setFont().
|
inline |
Referenced by displayRecords(), and gnash::TextField::setFont().
|
inline |
|
inline |
Referenced by gnash::TextField::removeTextField(), and gnash::TextField::setFont().