Subject: bug#22780: 25.1.50; wrong average width picked for bold face for 7x13 X11 font

From: Eli Zaretskii <[email-masked]>
Date: Wed, 14 Sep 2016 19:49:31 +0300

> From: Philipp Stephani <[email-masked]>
> Date: Wed, 14 Sep 2016 14:15:47 +0000
> 
> Alex Khesin <[email-masked]> schrieb am Di., 23. Feb. 2016 um 08:20 Uhr:
> 
>  emacs 25 choses fonts with different average width for 7x13 font, making bold text take more horizontal
>  space. This is particularly a problem when using themes like https://github.com/bbatsov/zenburn-emacs
>  which use bold to hihglight matching parenthesis in show-paren-mode, causing characters to shift as
>  the cursor is moved from a parenthesis to a non-parenthesis character.
> 
>  Repro that demonstrates the problem in both 25 pretest 1 and current head (but is perfectly ok in emacs
>  24):
> 
>  $ emacs -Q --eval '(progn (set-face-font '\''default "7x13") (print (face-font "default")) (print (face-font
>  "bold")))'
> 
>  shows
>  -misc-fixed-medium-r-normal--13-120-75-75-c-70-iso8859-1
>  -misc-fixed-bold-r-normal--13-120-75-75-c-80-iso8859-1
> 
>  Notice the jump from 70 to 80 before the iso8859 component - that's the average width, and that's what
>  I believe is causing bold characters to render wider than non-bold ones. Both are 70 in emacs 24.
> 
> This appears to be a regression from Emacs 24. Would be great if somebody who has knowledge about this
> area could look into this. 

Alas, we don't have such experts on board.  Moreover, I could be
wrong, but I don't think font selection has seen any changes between
Emacs 24 and 25.

Perhaps the best way ahead is for someone who sees the problem to
revert changes since Emacs 24.5 to xftfont.c, ftfont.c, and font.c one
by one, and see which one causes the problem.  There are only a few
changes there that affect the code and font selection in particular.

Sorry, but I have no better advice.