Brendan Howell avatar Brendan Howell committed 4fb0be4

started rewrite of pango-based ScreenText class

Comments (0)

Files changed (2)

pycessing/drawing_cairo.py

         layout = self.pangoctx.create_layout()
         #print dir(self.families[0])
         print self.families[0].get_name()
-        layout.set_font_description(pango.FontDescription(self.families[0].get_name() + " 25"))
+        layout.set_font_:description(pango.FontDescription(self.families[0].get_name() + " 25"))
         layout.set_width(300)
         layout.set_text(txt)
         self.pangoctx.update_layout(layout)
-        print('ctx.POS: %s %s'%self.ctx.get_current_point())
+        #print('ctx.POS: %s %s'%self.ctx.get_current_point())
         self.pangoctx.show_layout(layout)
-        print('F => %s %s'%layout.get_pixel_size())
+        #print('F => %s %s'%layout.get_pixel_size())
         self.ctx.restore()
 
     def _fillAndStroke(self):
     along with PyCessing.  If not, see <http://www.gnu.org/licenses/>.
 """
 
-import pygame, sys, os
+import pygame
+import sys
+import os
 
 from pycess import *
 
 
 def setup():
     pass
-    
+
 def draw():
     pass
 
 
 def setFillState(fillState):
     drawing.setFillState(fillState)
-    
+
 def setFillOn():
     drawing.setFillOn()
-    
+
 def setFillOff():
     drawing.setFillOff()
 
 def screenGrab(fileName):
     drawing.screenGrab(fileName)
-	
+
 def getPixel(x, y):
     return pycessing.screen.get_at((x, y))
 
     drawing.setBackground(127, 127, 127)
     images.SCREEN = pycessing.screen
     images.CTX = drawing.ctx
-    typo.SCREEN = pycessing.screen
+    typo.CTX = drawing.ctx
+    typo.PANGOCTX = drawing.pangoctx
 
     while 1:
         pycessing.doEvents(pygame.fastevent.get())
                     if event.type == pygame.QUIT:
                         sys.exit(0)
                 pycessing.clock.tick(30)
-            
+
 if __name__ == '__main__':
     main(sys.argv[1], sys.argv[2].strip())
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.