Author: fejj
Date: 2007-12-03 11:41:44 -0500 (Mon, 03 Dec 2007)
New Revision: 90556

Modified:
   trunk/moon/src/ChangeLog
   trunk/moon/src/clock.cpp
   trunk/moon/src/clock.h
   trunk/moon/src/font.cpp
Log:
2007-12-03  Jeffrey Stedfast  <[EMAIL PROTECTED]>

        Fixes a bug pointed out by Larry when rendering lines beginning
        with a 'J', where the tail escapes the bounding box.

        * font.cpp (Layout): Use the horiBearingX font metric.
        (RenderLine): Same.



Modified: trunk/moon/src/ChangeLog
===================================================================
--- trunk/moon/src/ChangeLog    2007-12-03 16:34:22 UTC (rev 90555)
+++ trunk/moon/src/ChangeLog    2007-12-03 16:41:44 UTC (rev 90556)
@@ -1,3 +1,11 @@
+2007-12-03  Jeffrey Stedfast  <[EMAIL PROTECTED]>
+
+       Fixes a bug pointed out by Larry when rendering lines beginning
+       with a 'J', where the tail escapes the bounding box.
+
+       * font.cpp (Layout): Use the horiBearingX font metric.
+       (RenderLine): Same.
+
 2007-12-03  Larry Ewing  <[EMAIL PROTECTED]>
 
        * brush.cpp (RadialGradientBrush::SetupBrush): add debug spew

Modified: trunk/moon/src/clock.cpp
===================================================================
--- trunk/moon/src/clock.cpp    2007-12-03 16:34:22 UTC (rev 90555)
+++ trunk/moon/src/clock.cpp    2007-12-03 16:41:44 UTC (rev 90556)
@@ -50,7 +50,7 @@
 extern guint32 moonlight_flags;
 
 TimeSpan
-get_now()
+get_now (void)
 {
         struct timeval tv;
         TimeSpan res;
@@ -520,7 +520,7 @@
 }
 
 void
-time_manager_list_clocks ()
+time_manager_list_clocks (void)
 {
        TimeManager::Instance()->ListClocks();
 }
@@ -1313,8 +1313,8 @@
 DependencyProperty* TimelineMarker::TimeProperty;
 DependencyProperty* TimelineMarker::TypeProperty;
 
-TimelineMarker*
-timeline_marker_new ()
+TimelineMarker *
+timeline_marker_new (void)
 {
        return new TimelineMarker ();
 }

Modified: trunk/moon/src/clock.h
===================================================================
--- trunk/moon/src/clock.h      2007-12-03 16:34:22 UTC (rev 90555)
+++ trunk/moon/src/clock.h      2007-12-03 16:41:44 UTC (rev 90556)
@@ -312,7 +312,7 @@
 guint time_manager_add_timeout (guint ms_interval, GSourceFunc func, gpointer 
timeout_data);
 void  time_manager_remove_timeout (guint timeout_id);
 
-void time_manager_list_clocks ();
+void time_manager_list_clocks (void);
 
 
 //
@@ -506,7 +506,7 @@
        virtual Type::Kind GetElementType() { return Type::TIMELINE; }
 };
 
-TimelineCollection * timeline_collection_new ();
+TimelineCollection *timeline_collection_new (void);
 
 class TimelineGroup : public Timeline {
  public:
@@ -527,7 +527,7 @@
        virtual void OnPropertyChanged (DependencyProperty *prop);
 };
 
-TimelineGroup * timeline_group_new ();
+TimelineGroup *timeline_group_new (void);
 
 
 
@@ -551,7 +551,7 @@
        static DependencyProperty* TypeProperty;
 };
 
-TimelineMarker* timeline_marker_new ();
+TimelineMarker *timeline_marker_new (void);
 
 
 /* useful for timing things */

Modified: trunk/moon/src/font.cpp
===================================================================
--- trunk/moon/src/font.cpp     2007-12-03 16:34:22 UTC (rev 90555)
+++ trunk/moon/src/font.cpp     2007-12-03 16:41:44 UTC (rev 90556)
@@ -1443,8 +1443,12 @@
                                continue;
                        
                        advance = glyph->metrics.horiAdvance;
-                       advance += run->font->Kerning (prev, glyph->index);
                        
+                       if (prev != 0)
+                               advance += run->font->Kerning (prev, 
glyph->index);
+                       else
+                               advance -= glyph->metrics.horiBearingX;
+                       
                        if ((is_space = isSpace (run->text[i]))) {
                                spc.width = lw + advance;
                                spc.index = i;
@@ -1727,7 +1731,11 @@
                                if (!(glyph = font->GetGlyphInfo (text[i])))
                                        continue;
                                
-                               x1 += font->Kerning (prev, glyph->index);
+                               if (prev != 0)
+                                       x1 += font->Kerning (prev, 
glyph->index);
+                               else
+                                       x1 -= glyph->metrics.horiBearingX;
+                               
                                prev = glyph->index;
                                
                                if (!font->IsScalable ())

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

Reply via email to