gzz-commits
[Top][All Lists]
Advanced

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

[Gzz-commits] libvob/org/nongnu/libvob/lava Demo.java TextVob...


From: Benja Fallenstein
Subject: [Gzz-commits] libvob/org/nongnu/libvob/lava Demo.java TextVob...
Date: Sun, 06 Apr 2003 08:30:30 -0400

CVSROOT:        /cvsroot/libvob
Module name:    libvob
Changes by:     Benja Fallenstein <address@hidden>      03/04/06 08:30:30

Modified files:
        org/nongnu/libvob/lava: Demo.java 
Added files:
        org/nongnu/libvob/lava: TextVob.java 

Log message:
        more linebreaking twiddle

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/lava/TextVob.java?rev=1.1
http://savannah.gnu.org/cgi-bin/viewcvs/libvob/libvob/org/nongnu/libvob/lava/Demo.java.diff?tr1=1.3&tr2=1.4&r1=text&r2=text

Patches:
Index: libvob/org/nongnu/libvob/lava/Demo.java
diff -u libvob/org/nongnu/libvob/lava/Demo.java:1.3 
libvob/org/nongnu/libvob/lava/Demo.java:1.4
--- libvob/org/nongnu/libvob/lava/Demo.java:1.3 Sat Apr  5 13:51:19 2003
+++ libvob/org/nongnu/libvob/lava/Demo.java     Sun Apr  6 08:30:30 2003
@@ -26,6 +26,7 @@
  * Written by Benja Fallenstein
  */
 package org.nongnu.libvob.lava;
+import org.nongnu.libvob.util.ScalableFont;
 import java.awt.*;
 
 /** A demo of the capabilities of the
@@ -45,13 +46,20 @@
                                         new Box(Vob.Y),
                                         300, Vob.X);
 
-       Vob r1 = new Colorize(new RectVob(50, 20), Color.blue);
-       for(int i=0; i<25; i++) {
-           Vob r2 = new Colorize(new FilledRect(5*i, 30), Color.blue);
-           seq.add(r1); seq.add(r2);
+       ScalableFont font = new ScalableFont("serif", 0, 12);
+       String string = "A little experiment 'ad hominem.' "
+           + "(What 'ad hominem' means? I wouldn't know. "
+           + "I just use it to sound impressive. This is "
+           + "really about linebreaking :-) )";
+
+       for(int i=0; i<string.length(); i++) {
+           if((i+1) % 30 == 0)
+               seq.add(new RectVob(20, 12));
+           seq.add(new TextVob(string.substring(i, i+1), font));
        }
 
-       g.add(new Translate(seq.close(), 300, 70));
+       g.add(new Translate(new Colorize(seq.close(), Color.blue),
+                           300, 70));
        
        Vob rect = new RectVob(300, (int)seq.getSize(Vob.Y));
        g.add(new Translate(new Colorize(rect, Color.red), 




reply via email to

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