| Summary: | fonts like lucidasanstypewriter do not work in konsole | ||
|---|---|---|---|
| Product: | [Applications] konsole | Reporter: | Devendra Deshpande <devendra> |
| Component: | general | Assignee: | Konsole Bugs <konsole-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 1.2 | ||
| Target Milestone: | --- | ||
| Platform: | Unlisted Binaries | ||
| OS: | Solaris | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | p1 | ||
|
Description
Devendra Deshpande
2002-11-18 12:26:10 UTC
Subject: More on fixed-width fonts in konsole problem (on Solaris 2.7)
Hmmm,
I enabled a few debug lines (commented printf commands) in TEWidget.cpp,
TEWidget::fontChange and I see:
font: Screen,10,-1,5,50,0,0,0,1,0
fixed: yes
font_h: 14
font_w: 9
font_a: 10
rawname: -sun-screen-medium-r-normal--12-120-72-72-m-70-iso8859-1
So Knsole thinks (as Qt told it) that width of the font is 9. The
window size is 80x24, and the window width is 738 (9*80 = 720 + some
width for scrollbar).
But actually, the font width is 7! I can confirm this with rxvt.
The problem could be with Qt (Qt is giving the wrong value).
I change this loop in TEWidget::fontChange:
int fw;
font_w = 1;
for(int i=0;i<128;i++) {
if( isprint(i) && font_w < (fw = fm.width(i)))
font_w = fw;
}
to:
int fw;
font_w = 1;
for(int i=0;i<128;i++) {
if( isprint(i) && font_w < (fw = fm.width(i)))
printf("intermediate fw: %d (i=%d)\n",fw, i);
font_w = fw;
}
and I see:
intermediate fw: 9 (i=9)
font: Screen,10,-1,5,50,0,0,0,1,0
fixed: yes
font_h: 14
font_w: 7
font_a: 10
rawname: -sun-screen-medium-r-normal--12-120-72-72-m-70-iso8859-1
Whew!
I don't know what happened or what did the trick, but Konsole works
with the screen and typewriter fonts now!!
Any clues as to what might be happening?
Thanks,
Devendra
> Any clues as to what might be happening?
You forgot to place brackets after "if", it picks up the width of the last char.
Subject: Re: fonts like lucidasanstypewriter do not work in konsole On 2 Dec 2002 08:37:52 -0000 Stephan Binner <binner@kde.org> wrote: > > Any clues as to what might be happening? > > You forgot to place brackets after "if", it picks up the width of the > last char. <embarrassed> I realized that. </embarrassed> I did a few code changes that effectively take out: font_w=fm.maxWidth(); from the conditional. And I commented all the stuff that iterates over 0-127 chars and finds the max width. I get the right result now. Essentially, the code does the following (no more iterating): font_w=fm.maxWidth(); Things work like a charm now. I suspect this messes up the Japanese support, but I don't know anything better :-( Thanks, Devendra Created an attachment (id=557) p1 Subject: This attachment also solved the issue described in comment #3 of bug <a href="show_bug.cgi?id=45250"> #4520 </a>. (kde-3.0.5 qt-3.0.6 built with gcc-3.1.1) Thanks, Gerhard This may or may not be fixed by some changes that I made today to konsole in KDE CVS. (Revision 1.182 of TEWidget.cpp) Could you give that a try? Contact me at bastian@kde.org if you don't have access to CVS. A lot has happened since this report. In KDE3.4 (3.3.x?) lucidasanstypewriter works fine. |