Revision: 3218
          http://vexi.svn.sourceforge.net/vexi/?rev=3218&view=rev
Author:   clrg
Date:     2008-11-18 00:36:47 +0000 (Tue, 18 Nov 2008)

Log Message:
-----------
Fix unintended compromises made by fixing glyph clipping

Modified Paths:
--------------
    trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java

Modified: trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java
===================================================================
--- trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java    2008-11-17 
17:50:09 UTC (rev 3217)
+++ trunk/core/org.vexi.core/src/org/vexi/graphics/Font.java    2008-11-18 
00:36:47 UTC (rev 3218)
@@ -102,17 +102,20 @@
         for(int i=0; i<text.length(); i++) {
             final char c = text.charAt(i);
             Glyph g = glyphs[c];
-            if (g == null) glyphs[c] = g = Platform.createGlyph(this, c);
-            g.render();
+            if (g == null) {
+                glyphs[c] = g = Platform.createGlyph(this, c);
+                g.render();
+            }
+            else g.render();
             height = java.lang.Math.max(height, max_ascent + max_descent);
             // avoid clipping first character
             int ox = x + width;
-            if (i!=0) ox += g.bearingx;
+            if (i!=0 || g.bearingx>0) ox += g.bearingx;
             // render glyph and move on
             if (pb != null) pb.drawGlyph(g, ox, y + g.font.max_ascent - 
g.baseline, cx1, cy1, cx2, cy2, textcolor);
             width += g.advance;
             // take into account clipping avoidance
-            if (i==0) width -= g.bearingx;
+            if (i==0 && g.bearingx<0) width -= g.bearingx;
         }
         return ((((long)width) << 32) | (height & 0xffffffffL));
     }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to