CVSROOT: /sources/gnash Module name: gnash Changes by: Chad Musick <cmusick> 07/08/22 13:09:10
Modified files: . : ChangeLog server : font.cpp font.h impl.cpp swf.h server/swf : tag_loaders.cpp tag_loaders.h Log message: Changes necessary to implement SWF9 tag 88 -- DefineFontName font.h,font.cpp: Add new fields and read function. impl.cpp: Set loader for tag swf.h: Add tag tag_loaders.h,tag_loaders.cpp: Define and implement loader. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4066&r2=1.4067 http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.45&r2=1.46 http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.h?cvsroot=gnash&r1=1.28&r2=1.29 http://cvs.savannah.gnu.org/viewcvs/gnash/server/impl.cpp?cvsroot=gnash&r1=1.115&r2=1.116 http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf.h?cvsroot=gnash&r1=1.37&r2=1.38 http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.cpp?cvsroot=gnash&r1=1.130&r2=1.131 http://cvs.savannah.gnu.org/viewcvs/gnash/server/swf/tag_loaders.h?cvsroot=gnash&r1=1.20&r2=1.21 Patches: Index: ChangeLog =================================================================== RCS file: /sources/gnash/gnash/ChangeLog,v retrieving revision 1.4066 retrieving revision 1.4067 diff -u -b -r1.4066 -r1.4067 --- ChangeLog 22 Aug 2007 11:20:28 -0000 1.4066 +++ ChangeLog 22 Aug 2007 13:09:09 -0000 1.4067 @@ -1,3 +1,14 @@ +2007-08-22 Chad Musick <[EMAIL PROTECTED]> + + * server/font.h, server/font.cpp: Define + m_display_name and m_copyright_name for the + DefineFontName tag (88) of SWF 9, reader + for the tag. + * server/swf.h Add DEFINEFONTNAME tag to list. + * server/impl.cpp Set loader for DefineFontName + * server/swf/tag_loaders.h,.cpp Add loader for + DefineFontName tag. + 2007-08-22 Sandro Santilli <[EMAIL PROTECTED]> * configure.ac: bail out if kde gui or kparts plugin are Index: server/font.cpp =================================================================== RCS file: /sources/gnash/gnash/server/font.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -u -b -r1.45 -r1.46 --- server/font.cpp 24 Jul 2007 19:43:30 -0000 1.45 +++ server/font.cpp 22 Aug 2007 13:09:10 -0000 1.46 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: font.cpp,v 1.45 2007/07/24 19:43:30 strk Exp $ */ +/* $Id: font.cpp,v 1.46 2007/08/22 13:09:10 cmusick Exp $ */ // Based on the public domain work of Thatcher Ulrich <[EMAIL PROTECTED]> 2003 @@ -68,6 +68,8 @@ : m_texture_glyph_nominal_size(96), // Default is not important; gets overridden during glyph generation m_name(), + m_display_name(), + m_copyright_name(), m_owning_movie(NULL), m_unicode_chars(false), m_shift_jis_chars(false), @@ -85,6 +87,8 @@ : m_texture_glyph_nominal_size(96), // Default is not important; gets overridden during glyph generation m_name(name), + m_display_name(), + m_copyright_name(), m_owning_movie(NULL), m_unicode_chars(false), m_shift_jis_chars(false), @@ -429,6 +433,18 @@ } } + // Read the font name, display and legal, from a DefineFontName tag. + void font::read_font_name(stream* in, SWF::tag_type tag, + movie_definition* /*m*/) + { + assert(tag == SWF::DEFINEFONTNAME); + char* disp_name = in->read_string(); + char* copy_name = in->read_string(); + m_display_name = disp_name; + delete [] disp_name; + m_copyright_name = copy_name; + delete [] copy_name; + } // Read additional information about this font, from a // DefineFontInfo tag. The caller has already read the tag Index: server/font.h =================================================================== RCS file: /sources/gnash/gnash/server/font.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -b -r1.28 -r1.29 --- server/font.h 24 Jul 2007 19:43:30 -0000 1.28 +++ server/font.h 22 Aug 2007 13:09:10 -0000 1.29 @@ -233,6 +233,15 @@ /// void read_font_info(stream* in, SWF::tag_type tag, movie_definition* m); + /// \brief + /// Read the name of this font, from a DEFINEFONTNAME tag. + // + /// The caller has already read the tag type and font id. + // + /// @see SWF::define_font_name_loader + /// + void read_font_name(stream* in, SWF::tag_type tag, movie_definition* m); + /// Dump our cached data into the given stream. void output_cached_data(tu_file* out, const cache_options& options); @@ -369,6 +378,9 @@ int m_texture_glyph_nominal_size; std::string m_name; + std::string m_display_name; + std::string m_copyright_name; + movie_definition* m_owning_movie; bool m_has_layout; Index: server/impl.cpp =================================================================== RCS file: /sources/gnash/gnash/server/impl.cpp,v retrieving revision 1.115 retrieving revision 1.116 diff -u -b -r1.115 -r1.116 --- server/impl.cpp 22 Aug 2007 04:27:02 -0000 1.115 +++ server/impl.cpp 22 Aug 2007 13:09:10 -0000 1.116 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: impl.cpp,v 1.115 2007/08/22 04:27:02 cmusick Exp $ */ +/* $Id: impl.cpp,v 1.116 2007/08/22 13:09:10 cmusick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -256,13 +256,15 @@ register_tag_loader(SWF::CSMTEXTSETTINGS, fixme_loader); // 74 register_tag_loader(SWF::DEFINEFONT3, define_font_loader); // 75 - register_tag_loader(SWF::SYMBOLCLASS, fixme_loader); // 76 Chad + register_tag_loader(SWF::SYMBOLCLASS, fixme_loader); // 76 register_tag_loader(SWF::METADATA, metadata_loader); // 77 register_tag_loader(SWF::DEFINESCALINGGRID, fixme_loader); // 78 register_tag_loader(SWF::DOABCDEFINE, fixme_loader); // 79 -- AS3 codeblock. register_tag_loader(SWF::DEFINESHAPE4, fixme_loader); // 83 register_tag_loader(SWF::DEFINEMORPHSHAPE2, fixme_loader); // 84 + register_tag_loader(SWF::DEFINEFONTNAME, define_font_name_loader); // 88 + register_tag_loader(SWF::REFLEX, reflex_loader); // 777 } Index: server/swf.h =================================================================== RCS file: /sources/gnash/gnash/server/swf.h,v retrieving revision 1.37 retrieving revision 1.38 diff -u -b -r1.37 -r1.38 --- server/swf.h 21 Aug 2007 03:49:41 -0000 1.37 +++ server/swf.h 22 Aug 2007 13:09:10 -0000 1.38 @@ -156,6 +156,8 @@ /// http://sswf.sourceforge.net/SWFalexref.html#tag_definemorphshape2 DEFINEMORPHSHAPE2 = 84, + DEFINEFONTNAME = 88, + REFLEX = 777, DEFINEBITSPTR = 1023 Index: server/swf/tag_loaders.cpp =================================================================== RCS file: /sources/gnash/gnash/server/swf/tag_loaders.cpp,v retrieving revision 1.130 retrieving revision 1.131 diff -u -b -r1.130 -r1.131 --- server/swf/tag_loaders.cpp 18 Aug 2007 22:07:17 -0000 1.130 +++ server/swf/tag_loaders.cpp 22 Aug 2007 13:09:10 -0000 1.131 @@ -17,7 +17,7 @@ // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // -/* $Id: tag_loaders.cpp,v 1.130 2007/08/18 22:07:17 strk Exp $ */ +/* $Id: tag_loaders.cpp,v 1.131 2007/08/22 13:09:10 cmusick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -1063,6 +1063,27 @@ } } +// Set font name for a font. +void define_font_name_loader(stream* in, tag_type tag, movie_definition* m) +{ + assert(tag == SWF::DEFINEFONTNAME); + + uint16_t font_id = in->read_u16(); + + font* f = m->get_font(font_id); + if (f) + { + f->read_font_name(in, tag, m); + } + else + { + IF_VERBOSE_MALFORMED_SWF( + log_swferror(_("define_font_name_loader: " + "can't find font w/ id %d"), font_id); + ); + } +} + // Create and initialize a sprite, and add it to the movie. void sprite_loader(stream* in, tag_type tag, movie_definition* m) Index: server/swf/tag_loaders.h =================================================================== RCS file: /sources/gnash/gnash/server/swf/tag_loaders.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -b -r1.20 -r1.21 --- server/swf/tag_loaders.h 8 Aug 2007 18:26:38 -0000 1.20 +++ server/swf/tag_loaders.h 22 Aug 2007 13:09:10 -0000 1.21 @@ -19,7 +19,7 @@ // // -/* $Id: tag_loaders.h,v 1.20 2007/08/08 18:26:38 strk Exp $ */ +/* $Id: tag_loaders.h,v 1.21 2007/08/22 13:09:10 cmusick Exp $ */ #ifndef GNASH_SWF_TAG_LOADERS_H #define GNASH_SWF_TAG_LOADERS_H @@ -89,6 +89,11 @@ /// void define_font_info_loader(stream*, tag_type, movie_definition*); +/// SWF Tag DefineFontName (88) +// Load the display name and copyright string of a font. +// This adds to an existing font. +void define_font_name_loader(stream*, tag_type, movie_definition*); + /// Read SWF::DEFINETEXT and SWF::DEFINETEXT2 tags. void define_text_loader(stream*, tag_type, movie_definition*); _______________________________________________ Gnash-commit mailing list Gnash-commit@gnu.org http://lists.gnu.org/mailman/listinfo/gnash-commit