commit-gnue
[Top][All Lists]
Advanced

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

gnue/gnuef/src GFOptions.py UIwxpython.py


From: James Thompson
Subject: gnue/gnuef/src GFOptions.py UIwxpython.py
Date: Thu, 14 Dec 2000 08:50:00 -0800

CVSROOT:        /cvs
Module name:    gnue
Changes by:     James Thompson <address@hidden> 00/12/14 08:50:00

Modified files:
        gnuef/src      : GFOptions.py UIwxpython.py 

Log message:
        Char placement code alterations

CVSWeb URLs:
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/GFOptions.py.diff?r1=1.8&r2=1.9
http://subversions.gnu.org/cgi-bin/cvsweb/gnue/gnuef/src/UIwxpython.py.diff?r1=1.44&r2=1.45

Patches:
Index: gnue/gnuef/src/GFOptions.py
diff -u gnue/gnuef/src/GFOptions.py:1.8 gnue/gnuef/src/GFOptions.py:1.9
--- gnue/gnuef/src/GFOptions.py:1.8     Wed Dec 13 08:02:31 2000
+++ gnue/gnuef/src/GFOptions.py Thu Dec 14 08:50:00 2000
@@ -14,6 +14,8 @@
 
 _msgNOTSAVED = "Data not saved. Commit or rollback changes."
 
-borderPercentage = 125
-textPercentage = 110
+
+pointSize = 8
+borderPercentage = 100
+textPercentage = 100
 
Index: gnue/gnuef/src/UIwxpython.py
diff -u gnue/gnuef/src/UIwxpython.py:1.44 gnue/gnuef/src/UIwxpython.py:1.45
--- gnue/gnuef/src/UIwxpython.py:1.44   Wed Dec 13 06:28:15 2000
+++ gnue/gnuef/src/UIwxpython.py        Thu Dec 14 08:50:00 2000
@@ -421,8 +421,28 @@
   def formHandler(self):
     self.frame = wxFrame(NULL, -1, "",
                     wxDefaultPosition, wxSize(int(self.form.width), 
int(self.form.height)))
-    self.charWidth = self.frame.GetCharWidth()
-    self.charHeight = self.frame.GetCharHeight()
+
+
+    # Got to be a bettwe way
+    maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0]
+    for letter in "WOyg-\|":
+      width,height,descent,leading = self.frame.GetFullTextExtent(letter)
+      maxWidth = maxWidth > width and maxWidth or width
+      maxHeight = maxHeight > height and maxHeight or height
+      maxDescent = maxDescent > descent and maxDescent or descent
+      maxLeading = maxLeading > leading and maxLeading or leading
+     
+    self.frame.SetFont(wxFont(GFOptions.pointSize,wxMODERN,wxNORMAL,wxNORMAL))
+
+    self.charWidth = maxWidth+maxLeading
+    self.charHeight = maxHeight+maxDescent
+#    self.charWidth = self.frame.GetCharWidth()
+#    self.charHeight = self.frame.GetCharHeight()
+
+#    print "Width" ,self.charWidth 
+#    print "Height" ,self.charHeight
+#    print "Descent" ,descent
+#    print "Leading" ,leading
 
     
     self.borderPercentage = (GFOptions.borderPercentage / 100.0)



reply via email to

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