gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] gnash ChangeLog server/font.cpp server/font.h s...


From: Chad Musick
Subject: [Gnash-commit] gnash ChangeLog server/font.cpp server/font.h s...
Date: Mon, 03 Sep 2007 16:50:09 +0000

CVSROOT:        /sources/gnash
Module name:    gnash
Changes by:     Chad Musick <cmusick>   07/09/03 16:50:09

Modified files:
        .              : ChangeLog 
        server         : font.cpp font.h text.cpp 

Log message:
        SWF8+ fonts (DefineFont3) now work.  DefineFontAlignZones still needs 
to be
        finished.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.4201&r2=1.4202
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.cpp?cvsroot=gnash&r1=1.47&r2=1.48
http://cvs.savannah.gnu.org/viewcvs/gnash/server/font.h?cvsroot=gnash&r1=1.29&r2=1.30
http://cvs.savannah.gnu.org/viewcvs/gnash/server/text.cpp?cvsroot=gnash&r1=1.37&r2=1.38

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.4201
retrieving revision 1.4202
diff -u -b -r1.4201 -r1.4202
--- ChangeLog   3 Sep 2007 13:18:13 -0000       1.4201
+++ ChangeLog   3 Sep 2007 16:50:08 -0000       1.4202
@@ -1,3 +1,9 @@
+2007-09-04 Chad Musick <address@hidden>
+
+       * server/font.cpp,.h: Add is_subpixel_font flag for DefineFont3 tag.
+       * server/text.cpp: Size SWF8, SWF9 fonts correctly -- they use subpixel
+         shapes, so they need to be scaled when displayed.
+
 2007-09-03 Sandro Santilli <address@hidden>
 
        * server/sprite_instance.cpp (advance_sprite): don't use

Index: server/font.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/font.cpp,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -b -r1.47 -r1.48
--- server/font.cpp     27 Aug 2007 12:44:28 -0000      1.47
+++ server/font.cpp     3 Sep 2007 16:50:09 -0000       1.48
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: font.cpp,v 1.47 2007/08/27 12:44:28 strk Exp $ */
+/* $Id: font.cpp,v 1.48 2007/09/03 16:50:09 cmusick Exp $ */
 
 // Based on the public domain work of Thatcher Ulrich <address@hidden> 2003
 
@@ -77,6 +77,7 @@
                m_is_italic(false),
                m_is_bold(false),
                m_wide_codes(false),
+               m_subpixel_font(false),
                m_ascent(0.0f),
                m_descent(0.0f),
                m_leading(0.0f)
@@ -96,6 +97,7 @@
                m_is_italic(false),
                m_is_bold(false),
                m_wide_codes(false),
+               m_subpixel_font(false),
                m_ascent(0.0f),
                m_descent(0.0f),
                m_leading(0.0f)
@@ -187,6 +189,8 @@
                {
                        assert (tag == SWF::DEFINEFONT2 || tag == 
SWF::DEFINEFONT3);
                        readDefineFont2_or_3(in, m);
+                       if (tag == SWF::DEFINEFONT3)
+                               m_subpixel_font = true;
                }
 
                if ( ! m_name.empty() && ! initDeviceFontProvider() )

Index: server/font.h
===================================================================
RCS file: /sources/gnash/gnash/server/font.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -b -r1.29 -r1.30
--- server/font.h       22 Aug 2007 13:09:10 -0000      1.29
+++ server/font.h       3 Sep 2007 16:50:09 -0000       1.30
@@ -341,6 +341,8 @@
        float   get_leading() const { return m_leading; }
        float   get_descent() const { return m_descent; }
 
+       bool    is_subpixel_font() const { return m_subpixel_font; }
+       void    set_subpixel_font(bool isit) { m_subpixel_font = isit; }
 private:
 
        /// Read the table that maps from glyph indices to character codes.
@@ -390,6 +392,7 @@
        bool    m_is_italic;
        bool    m_is_bold;
        bool    m_wide_codes;
+       bool    m_subpixel_font;
 
        // This table maps from Unicode character number to glyph index.
        typedef std::map<uint16_t, int> code_table;

Index: server/text.cpp
===================================================================
RCS file: /sources/gnash/gnash/server/text.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -b -r1.37 -r1.38
--- server/text.cpp     18 Aug 2007 13:24:14 -0000      1.37
+++ server/text.cpp     3 Sep 2007 16:50:09 -0000       1.38
@@ -17,7 +17,7 @@
 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 //
 
-/* $Id: text.cpp,v 1.37 2007/08/18 13:24:14 strk Exp $ */
+/* $Id: text.cpp,v 1.38 2007/09/03 16:50:09 cmusick Exp $ */
 
 // Based on the public domain work of Thatcher Ulrich <address@hidden> 2003
 
@@ -167,6 +167,10 @@
                                        
                                mat = base_matrix;
                                mat.concatenate_translation(x, y);
+                               //mat.concatenate_scale(scale);
+                               if (fnt->is_subpixel_font())
+                                       mat.concatenate_scale(0.05f * scale);
+                               else
                                mat.concatenate_scale(scale);
 
                                if (index == -1)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]