octave-maintainers
[Top][All Lists]
Advanced

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

Re: GUI font and cursor location


From: Mike Miller
Subject: Re: GUI font and cursor location
Date: Sun, 29 Jul 2012 09:27:11 -0400

On Sun, Jul 29, 2012 at 8:29 AM, Michael Goffioul wrote:
> On Sun, Jul 29, 2012 at 12:59 PM, Doug Stewart <address@hidden>
> wrote:
>>
>>
>>
>> On Sun, Jul 29, 2012 at 7:44 AM, Michael Goffioul
>> <address@hidden> wrote:
>>>
>>> On Sun, Jul 29, 2012 at 12:18 PM, Doug Stewart <address@hidden>
>>> wrote:
>>>>>
>>>>>
>>>>> Could you also provide a full description of the problem:
>>>>> - the font you use
>>>>> - the steps needed to reproduce the issue
>>>>> - a screenshot of the issue
>>>>>
>>>>> Jacob, is there a way to revert back to a block cursor? I've reverted
>>>>> my qterminal repo to 186cf3960cfa0c2752b77eba18af24cd0853c12a, but I can't
>>>>> change the cursor shape, it's always an Ibeam whatever I select in the
>>>>> preferences dialog (changing blinking works, though).

I see this also. If I run qterminal without calling setCursorType, it
has an underline cursor. After calling setCursorType, it is always a
vertical line no matter which CursorType I specify.

>>>>>
>>>>> Michael.
>>>>>
>>>> I thought I did give a full description.
>>>>
>>>> In qt
>>>> compile and run qterminal using the default font and font size
>>>> fill one line with characters, any characters.
>>>> using the left and right arrows move back and forth on the same line.
>>>> watch how the characters move left and right as the cursor moves past
>>>> each character.
>>>>
>>>> Now change the default font size to 8 and do the same
>>>> etc.
>>>
>>>
>>> This does not tell me which font you're using. I can observe something
>>> similar when the terminal widget is using a non-monospace font. But that's
>>> not an issue, because the terminal widget is NOT supposed to be used with a
>>> non-monospace font (the problem here is that when the config file is empty,
>>> the GUI picks up a non-monospace font, and that's a bug, because it should
>>> pick up the system default monospace font).
>>>
>>> Now when I open the preferences dialog and go to the terminal tab, I can
>>> change the font size, but as the font selector is now only filled with
>>> monospace fonts (defaults to "Courier New" on my system), this also change
>>> the font and the cursor behaves normally afterwards.
>>>
>>> I've tried with 3 monospace fonts I have installed on my system and they
>>> all work fine. If you are able to reproduce the problem with a monospace
>>> font, could you tell me which one? (and a screenshot would also help)
>>>
>>> Thanks,
>>> Michael.
>>>
>>
>> I was not using the GUI
>> I was running only qterminal and I was using the default font of
>> qterminal.
>>
>>   Some background Info:
>>   Jacob saw the problem first from the GUI side. and as a result he froze
>> the terminal width in the gui. I saw that the terminal width would not
>> re-size and asked him why and he explained the problem to me. At Montreal we
>> talked about it and I asked him to give me a week to look at it when I got
>> home.
>> So after some time I narrowed it down to what I have explained. It seems
>> that   Mike Miller saw the problem and fix.
>> "
>> Applied here and definitely much improved for me. I still see a little
>> bit of movement though. I've tried a handful of mono fonts at
>> different sizes and there is still a tiny amount of wiggle when moving
>> the cursor across the line. Maybe down to a one-pixel error at this
>> point though.
>> "
>>
>>
>>  So, if you don't see the problem then this adds more mystery!
>> Doug
>
>
>
> I'm willing to help, but at this point I still don't know which font is used
> to reproduce the problem. And if it can be reproduced with a monospace font,
> which one. You mention that your test case is to run qterminal, but
> qterminal does not have any preference dialog, so how and where do you
> change the default font size?

I am willing to do some more testing to help reproduce this and narrow
it down also.

Here's how I just reproduced it with qterminal alone. This is on Debian wheezy.
    git clone https://code.google.com/p/qterminal/
    cd qterminal
    git checkout -b testing 186cf39
    qmake
    make
    ./qterminal/qterminal

The problem is evident to me this way. I changed the font family to
test various monospace fonts, and the size to make it more obvious.

Here's how I changed the font to test this:

diff --git a/qterminal/main.cpp b/qterminal/main.cpp
index e45a623..bd16bb2 100644
--- a/qterminal/main.cpp
+++ b/qterminal/main.cpp
@@ -29,6 +29,7 @@ int main(int argc, char *argv[])
     QMainWindow *mainWindow = new QMainWindow();

     QTerminal *terminal = new QTerminal();
+    terminal->setTerminalFont(QFont("Courier", 16));

     mainWindow->setCentralWidget(terminal);
     mainWindow->resize(600, 400);

I tested with the following monospace fonts I have available: Courier,
Droid Sans Mono, FreeMono, Inconsolata, Liberation Mono, and Ubuntu
Mono.

Screenshot attached demonstrating the problem using the Inconsolata
font. The first two lines are normal, showing that it is indeed
monospaced. The third line is the one where I went back one character
with the cursor.

Ubuntu Mono actually appears to have a worse problem, the characters
appear to be taking up more horizontal space than the cursor allows
them to. The more characters I type in a line, the more they get
truncated on the right.

> When I run qterminal, it uses a monospace font and I don't have any issue.
> Reading Mike's answer, it seems he still have the issue, even with your
> patch.

With Doug's patch, which is now applied as f91e00f on Jacob's repo,
the problem is greatly reduced, but not completely fixed.

-- 
mike

Attachment: qterminal.png
Description: PNG image


reply via email to

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