LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2010, 11:59 AM   #1
jabfinger
Member
 
Registered: Jan 2004
Location: USA, Pa
Distribution: Gentoo, Fedora Core 3, Mepis, Vector
Posts: 83

Rep: Reputation: 15
python font pixel size


Hello,

I am trying to scroll text from a text file across a wx.panel.

This is the code so far:

Code:
    def scrolling(self, text, rate):
        def scroll():
            charList = []
            dc = wx.ClientDC(self.panel_1)
            open_text = open(text, "rb")
            my_text = open_text.read()
            charList.append(my_text)
            open_text.close()
            x,y = self.panel_1.GetClientSizeTuple()
            while 1:
                for z in charList:
                    for r in range(2000):
                        dc.DrawText(z,x-r,0)
                        time.sleep(rate)
                        dc.Clear()
        net3 = threading.Thread(target=scroll)
        net3.setDaemon(1)
        net3.start()
It scrolls but I am guessing where the range is (2000). I need to be able to determine the total number of pixels that the text in the file is.

Is there a python way to determine this?

Thanks
 
Old 02-17-2010, 01:22 PM   #2
jabfinger
Member
 
Registered: Jan 2004
Location: USA, Pa
Distribution: Gentoo, Fedora Core 3, Mepis, Vector
Posts: 83

Original Poster
Rep: Reputation: 15
solved

I found it

Code:
dc.GetTextExtent()
I am unsure how to mark this post as solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Emacs - changing default font size and font type? neilcpp Linux - Software 16 05-20-2013 11:29 AM
get current pixel clock size for Modeline (xorg.conf) snitko Linux - Hardware 3 11-07-2008 07:15 PM
Draw a Pixel with Python geek_man Programming 3 03-08-2008 11:49 AM
how does pixel aspect relate to frame size in mplayer/how do you find vid frame size? BrianK Linux - General 3 10-31-2007 01:08 PM
convert a set of 32x32 pixel png's into a font jakykong Linux - Software 2 09-12-2007 11:21 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration