gnash-commit
[Top][All Lists]
Advanced

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

[Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-


From: Benjamin Wolsey
Subject: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_start-174-g4191a46
Date: Fri, 04 Mar 2011 10:05:53 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnash".

The branch, master has been updated
       via  4191a46adfe29bc47c699e08f50a3c51ce47c83f (commit)
      from  13732116819cb9a9d93f545d9f96e48536e6731e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit//commit/?id=4191a46adfe29bc47c699e08f50a3c51ce47c83f


commit 4191a46adfe29bc47c699e08f50a3c51ce47c83f
Author: Benjamin Wolsey <address@hidden>
Date:   Fri Mar 4 10:43:58 2011 +0100

    Don't try to implement leading unless it stops making text disappear.

diff --git a/libcore/TextField.cpp b/libcore/TextField.cpp
index 9c99acf..b9149d0 100644
--- a/libcore/TextField.cpp
+++ b/libcore/TextField.cpp
@@ -344,9 +344,8 @@ TextField::display(Renderer& renderer, const Transform& 
base)
     }
 
     _displayRecords.clear();
-    float scale = getFontHeight() /
-        static_cast<float>(_font->unitsPerEM(_embedFonts));
-    float fontLeading = _font->leading() * scale;
+    // TODO: work out how leading should be implemented.
+    const float fontLeading = 0;
 
     //offset the lines
     int yoffset = (getFontHeight() + fontLeading) + PADDING_TWIPS;
@@ -1052,9 +1051,12 @@ TextField::format_text()
     }
 
     boost::uint16_t fontHeight = getFontHeight();
-    float scale = fontHeight /
-        static_cast<float>(_font->unitsPerEM(_embedFonts)); 
-    const float fontLeading = _font->leading() * scale;
+    const float scale = fontHeight /
+        static_cast<float>(_font->unitsPerEM(_embedFonts));
+
+    // TODO: work out how leading affects things.
+    const float fontLeading = 0;
+
     const boost::uint16_t leftMargin = getLeftMargin();
     const boost::uint16_t indent = getIndent();
     const boost::uint16_t blockIndent = getBlockIndent();
@@ -1166,9 +1168,8 @@ void
 TextField::scrollLines()
 {
     boost::uint16_t fontHeight = getFontHeight();
-    float scale = fontHeight /
-        static_cast<float>(_font->unitsPerEM(_embedFonts));
-    float fontLeading = _font->leading() * scale;
+    const float fontLeading = 0;
+
     _linesindisplay = _bounds.height() / (fontHeight + fontLeading + 
PADDING_TWIPS);
     if (_linesindisplay > 0) { //no need to place lines if we can't fit any
         size_t manylines = _line_starts.size();
@@ -1214,11 +1215,8 @@ TextField::newLine(boost::int32_t& x, boost::int32_t& y,
     LineStarts::iterator linestartit = _line_starts.begin();
     LineStarts::const_iterator linestartend = _line_starts.end();
     
-    float scale = _fontHeight /
-        static_cast<float>(_font->unitsPerEM(_embedFonts)); 
-    float fontLeading = _font->leading() * scale;
-    float leading = getLeading();
-    leading += fontLeading * scale; // not sure this is correct...
+    // TODO: work out how leading affects things.
+    const float leading = 0;
     
     // Close out this stretch of glyphs.
     ++_glyphcount;
@@ -1272,6 +1270,10 @@ TextField::newLine(boost::int32_t& x, boost::int32_t& y,
         int space = rec.getFont()->get_glyph_index(32, _embedFonts);
         SWF::TextRecord::GlyphEntry ge;
         ge.index = space;
+
+        const float scale = getFontHeight() /
+            static_cast<float>(_font->unitsPerEM(_embedFonts));
+
         ge.advance = scale * rec.getFont()->get_advance(space, _embedFonts);
                   
         rec.addGlyph(ge,5);
@@ -1303,9 +1305,10 @@ TextField::handleChar(std::wstring::const_iterator& it,
     float scale = _fontHeight /
         static_cast<float>(_font->unitsPerEM(_embedFonts)); 
     float fontDescent = _font->descent(_embedFonts) * scale; 
-    float fontLeading = _font->leading() * scale;
-    float leading = getLeading();
-    leading += fontLeading * scale; // not sure this is correct...
+
+    // TODO: work out how leading should be implemented.
+    const float leading = 0;
+    const float fontLeading = 0;
     
     boost::uint32_t code = 0;
     while (it != e)
@@ -1677,9 +1680,6 @@ TextField::handleChar(std::wstring::const_iterator& it,
 
             default:
             {
-       
-
-                               
                 if ( password() )
                 {    
                     SWF::TextRecord::GlyphEntry ge;

-----------------------------------------------------------------------

Summary of changes:
 libcore/TextField.cpp |   40 ++++++++++++++++++++--------------------
 1 files changed, 20 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
Gnash



reply via email to

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