Re: Help on print formatting please

48 views
Skip to first unread message

Terry Brown

unread,
Jul 3, 2012, 8:03:34 AM7/3/12
to leo-e...@googlegroups.com
On Mon, 2 Jul 2012 22:13:36 -0700 (PDT)
"F.S." <speec...@gmail.com> wrote:

> Also in 4.7 the log pane used monospace fonts so one can print out a table
> nicely using Python print formatting but in 4.10 the log pane seems to
> default to a proportional font.

You can copy the node `@data qt-gui-plugin-style-sheet` from
leoSettings.py to myLeoSettings.py, and look for

/* The log panes */
QTextEdit#log-widget {
background-color: #ffffec; /* #f2fdff; */
selection-color: white;
selection-background-color: blue;
/* font-family: Courier New; */
font-family: DejaVu Sans Mono;
font-size: 16px;
font-weight: normal; /* normal,bold,100,..,900 */
font-style: normal; /* normal, italic,oblique */
}

... hmm, this is my version but it seems the default is DejaVu Sans
Mono in leoSettings.py as well. So I wonder if that font exists on
your system? Font-family should probably be

font-family: DejaVu Sans Mono, monospace;

Not sure about the extra newlines, that sounds like a bug.

Cheers -Terry

Terry Brown

unread,
Jul 3, 2012, 8:47:53 AM7/3/12
to leo-e...@googlegroups.com
On Mon, 2 Jul 2012 22:13:36 -0700 (PDT)
"F.S." <speec...@gmail.com> wrote:

> I seem to be getting line breaks inserted after each item in the print
> statement: that is "print a, b, c" would insert line breaks after a and b

I just fixed this on the trunk, it should appear at
http://www.greygreen.org/leo/ tomorrow if you don't use bzr.

commit log:

fix behavior of

print 1,2,3

when g.redirectStdout() is used

the .write() method on the redirect class now sets from_redirect=True
so the qt log put() knows not to use .append() which wraps output in a
<p> element.

all unit tests pass.

Cheers -Terry

F.S.

unread,
Jul 3, 2012, 1:52:38 PM7/3/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
Thanks for the help. I installed the dejavu fonts, which didn't come with Windows 7. That solved the mono space fonts issue. The fonts look a bit peculiar on Windows, but I will either get used to it or find some other fixed width fonts, now that you showed me where the font settings are made.

F.S.

unread,
Jul 3, 2012, 2:11:40 PM7/3/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
I downloaded the 20120703 snapshot from the website. Your fix didn't seem to make into it. I will try again tomorrow. In addition I noticed the following issues:

For the newest release (Leo 4.11 devel, build 5416) whenever I attempt to move the cursor in the edit pane to the last few lines (400 lines total) the scroll would jump to recenter the focus, which is both a bit jarring and unfortunately puts the cursor out of view. I can re-scroll to bring the cursor and the last lines back into view. This quirk does not seem to exist for Leo 4.10. 

Leo 4.10 (Leo 4.10 final, build 5020) seems to be displaying lines incorrectly in the edit pane. Line count seems to be still correct. But some lines are not displayed and sometimes lines are jumbled. This seems to be fixed in the 4.11 so is probably a known issue.

I am using:
Python 2.7.3, qt version 4.8.2

Windows 6, 1, 7601, 2, Service Pack 1

F.S.

unread,
Jul 4, 2012, 10:56:48 AM7/4/12
to leo-e...@googlegroups.com, terry_...@yahoo.com
Snapshot 20120704 fixed the printing issuing. Thanks Terry! 
I will report more details on the scroll jumping issue in a new post.


On Tuesday, July 3, 2012 11:11:40 AM UTC-7, F.S. wrote:
I downloaded the 20120703 snapshot from the website. Your fix didn't seem to make into it. I will try again tomorrow. In addition I noticed the following issues:

For the newest release (Leo 4.11 devel, build 5416) whenever I attempt to move the cursor in the edit pane to the last few lines (400 lines total) the scroll would jump to recenter the focus, which is both a bit jarring and unfortunately puts the cursor out of view. I can re-scroll to bring the cursor and the last lines back into view. This quirk does not seem to exist for Leo 4.10. 

Leo 4.10 (Leo 4.10 final, build 5020) seems to be displaying lines incorrectly in the edit pane. Line count seems to be still correct. But some lines are not displayed and sometimes lines are jumbled. This seems to be fixed in the 4.11 so is probably a known issue.

I am using:
Python 2.7.3, qt version 4.8.2

Windows 6, 1, 7601, 2, Service Pack 1

On Tuesday, July 3, 2012 5:47:53 AM UTC-7, Terry wrote:
On Mon, 2 Jul 2012 22:13:36 -0700 (PDT)
"F.S."  wrote:
Reply all
Reply to author
Forward
0 new messages