Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2017-01-18
11:51 • Closed ticket [185712c861]: Font height calculation seems to be wrong plus 6... artifact: a260f2cb31 user: sebres
10:11 • New ticket [185712c861]. artifact: 7007dbc553 user: anonymous

Font height calculation seems to be wrong

Closed / Invalid185712c86116912ee9b853ee2e1ec9f39365d8adCreated 10 years agoUpdated 10 years ago
Descriptionplain2017-01-18 10:11:21
The priority should possibly be set to something that would correspond to "annoying!".

Problem description:
The lower few points of fonts are missing, at least for some (fonts and) sizes.

Font used:                     DejaVu Sans Mono
Problem visible at sizes:      4, 7, 10
Lower line(s) disappear for:   '_', not so visible for g,j,p,q and y 

OS:   Linux/Ubuntu 16.10 (I do not think the problem was present in the 16.04 version)
HW:   Lenovo y70-70 Touch

The impact is less for large fonts as there are more points available.

I have confirmed that wish itself (or sub-functionality) and not git-gui is to blame using the console.tcl found at <http://wiki.tcl.tk/786> referenced from <http://wiki.tcl.tk/36843>.  I have also verified that the problem is not found in Libre Office Writer for the same fonts and sizes. 

Preliminay analysis:
It seems that the lower line(s) are missing when the font size, n, devided by 3 gives m + 1/3 and is rounded down to m. (integer division).  If the value had been rounded up, the problem would probably not appear/exist.

Workaround alternatives:
- Change font.
- Change font size.
- Stop using underscores.

Discovery:
I have been using wish through git-gui for some years.  When comparing versions using git-gui I noticed that the underscores were missing and the code looked very strange.  If this had been normal texts (like from a book etc) the problem would not be so severe.  But as I am a C programmer, underscores (_) are often used to separate words in a variable or function name etc.  This would therefore apply to other C programmers as well.

I believe the problem appeared when changing from Ubuntu 16.04 to Ubuntu 16.10.
sebresplain2017-01-18 11:51:39
Here is a wrong place for this [tcl]. 

Please reopen this ticket in [tk] (http://core.tcl.tk/tk/tktnew).
Log in (anonymous is fine) to add a comment.