Author: fejj
Date: 2007-11-02 16:02:47 -0500 (Fri, 02 Nov 2007)
New Revision: 88745

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/font.cpp
   trunk/moon/src/text.cpp
Log:
2007-11-02  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        * font.cpp (RenderLine): Render glyphs with index 0 too, so that
        we render an empty box for glyphs not in the font (just like
        Silverlight).

        * text.cpp (ComputeTransform): Fixed to use the correct matrix for
        getting the scale values.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-11-02 20:43:52 UTC (rev 88744)
+++ trunk/moon/src/ChangeLog    2007-11-02 21:02:47 UTC (rev 88745)
@@ -1,3 +1,12 @@
+2007-11-02  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       * font.cpp (RenderLine): Render glyphs with index 0 too, so that
+       we render an empty box for glyphs not in the font (just like
+       Silverlight).
+
+       * text.cpp (ComputeTransform): Fixed to use the correct matrix for
+       getting the scale values.
+
 2007-11-01  Jackson Harper  <[EMAIL PROTECTED]>
 
        * trigger.h:

Modified: trunk/moon/src/font.cpp
===================================================================
--- trunk/moon/src/font.cpp     2007-11-02 20:43:52 UTC (rev 88744)
+++ trunk/moon/src/font.cpp     2007-11-02 21:02:47 UTC (rev 88745)
@@ -447,7 +447,7 @@
                        g_free (glyph->bitmap->buffer);
                        glyph->bitmap->buffer = NULL;
                        
-                       // Don't free the bitmap as we'll just be amlloc'ing it 
again anyway
+                       // Don't free the bitmap as we'll just be malloc'ing it 
again anyway
                        //g_free (glyph->bitmap);
                        //glyph->bitmap = NULL;
                }
@@ -1716,16 +1716,14 @@
                                if (!(glyph = font->GetGlyphInfo (text[i])))
                                        continue;
                                
-                               if (glyph->index > 0) {
-                                       x1 += font->Kerning (prev, 
glyph->index);
-                                       prev = glyph->index;
-                                       
-                                       if (!font->IsScalable ())
-                                               font->Render (cr, glyph, x1, 
y1);
-                                       else
-                                               font->Path (cr, glyph, x1, y1);
-                               }
+                               x1 += font->Kerning (prev, glyph->index);
+                               prev = glyph->index;
                                
+                               if (!font->IsScalable ())
+                                       font->Render (cr, glyph, x1, y1);
+                               else
+                                       font->Path (cr, glyph, x1, y1);
+                               
                                x1 += glyph->metrics.horiAdvance;
                        }
                        

Modified: trunk/moon/src/text.cpp
===================================================================
--- trunk/moon/src/text.cpp     2007-11-02 20:43:52 UTC (rev 88744)
+++ trunk/moon/src/text.cpp     2007-11-02 21:02:47 UTC (rev 88745)
@@ -822,26 +822,22 @@
 void
 TextBlock::ComputeTransform ()
 {
-       cairo_matrix_t matrix;
-       
        UIElement::ComputeTransform ();
        
-       // We extract the scale component of the transform matrix
-       // and apply it to the font so that if we are scaling up,
-       // the rendered glyphs don't look really bad. The font
-       // itself will reverse-scale the rendering so that once
-       // the trasnform is applied, it renders at the correct
-       // size.
-       uielement_get_render_affine (this, &matrix);
+       // We extract the scale component of the absolute transform
+       // matrix and apply it to the font so that if we are scaling
+       // up, the rendered glyphs don't look really bad. The font
+       // itself will reverse-scale the rendering so that once the
+       // trasnform is applied, it renders at the correct size.
        
        if (!RENDER_USING_PANGO) {
                double scale = font.custom->GetScale ();
                
-               if (matrix.yy != scale) {
-                       if (matrix.yy <= 1.0)
+               if (absolute_xform.yy != scale) {
+                       if (absolute_xform.yy <= 1.0)
                                font.custom->UnsetFields (FontMaskScale);
                        else
-                               font.custom->SetScale (matrix.yy);
+                               font.custom->SetScale (absolute_xform.yy);
                        
                        dirty = true;
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to