Gnash
0.8.11dev
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
libcore
swf
DefineFontNameTag.h
Go to the documentation of this file.
1
// DefineFontNameTag.cpp: read a DefineFontName tag.
2
//
3
// Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012
4
// Free Software Foundation, Inc
5
//
6
// This program is free software; you can redistribute it and/or modify
7
// it under the terms of the GNU General Public License as published by
8
// the Free Software Foundation; either version 3 of the License, or
9
// (at your option) any later version.
10
//
11
// This program is distributed in the hope that it will be useful,
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
// GNU General Public License for more details.
15
//
16
// You should have received a copy of the GNU General Public License
17
// along with this program; if not, write to the Free Software
18
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19
//
20
21
#include "
SWF.h
"
22
#include "
SWFStream.h
"
23
#include "
Font.h
"
24
#include "
RunResources.h
"
25
#include "
movie_definition.h
"
26
27
#ifndef GNASH_SWF_DEFINEFONTNAMETAG_H
28
#define GNASH_SWF_DEFINEFONTNAMETAG_H
29
30
namespace
gnash {
31
namespace
SWF
{
32
34
//
37
class
DefineFontNameTag
38
{
39
public
:
40
41
// Set font name for a font.
42
static
void
loader
(
SWFStream
& in,
TagType
tag,
movie_definition
&
m
,
43
const
RunResources
&
/*r*/
)
44
{
45
assert
(tag ==
SWF::DEFINEFONTNAME
);
46
47
in.
ensureBytes
(2);
48
boost::uint16_t fontID = in.
read_u16
();
49
50
Font
*
f
= m.
get_font
(fontID);
51
if
(!f)
52
{
53
IF_VERBOSE_MALFORMED_SWF
(
54
log_swferror(
_
(
"define_font_name_loader: can't find "
55
"font with id %d"
), fontID);
56
);
57
return
;
58
}
59
60
Font::FontNameInfo
fontName;
61
in.
read_string
(fontName.
displayName
);
62
in.
read_string
(fontName.
copyrightName
);
63
64
f->
addFontNameInfo
(fontName);
65
}
66
67
};
68
69
}
70
}
71
72
#endif
Generated on Wed Oct 23 2013 11:31:08 for Gnash by
1.8.4