Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Utilities
Konsole
Commits
b46a907b
Commit
b46a907b
authored
Aug 02, 2002
by
Stephan Binner
Browse files
Fallback for calculated unrealistic font width.
svn path=/trunk/kdebase/konsole/; revision=170135
parent
2cbc28a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
konsole/TEWidget.cpp
View file @
b46a907b
...
...
@@ -229,12 +229,21 @@ void TEWidget::fontChange(const QFont &)
{
QFontMetrics
fm
(
font
());
font_h
=
fm
.
height
()
+
m_lineSpacing
;
// waba TEWidget 1.123:
// "Base character width on widest ASCII character. This prevents too wide
// characters in the presence of double wide (e.g. Japanese) characters."
int
fw
;
font_w
=
1
;
for
(
int
i
=
0
;
i
<
128
;
i
++
)
{
if
(
isprint
(
i
)
&&
font_w
<
(
fw
=
fm
.
width
(
i
)))
font_w
=
fw
;
}
if
(
font_w
>
200
)
// don't trust unrealistic value, fallback to QFontMetrics::maxWidth()
font_w
=
fm
.
maxWidth
();
if
(
font_w
<
1
)
font_w
=
1
;
font_a
=
fm
.
ascent
();
//printf("font: %s\n", font().toString().latin1());
//printf("fixed: %s\n", font().fixedPitch() ? "yes" : "no");
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment