Subject: Re: bug#65803: 29.1; Noto Sans Mono CJK JP has doubled-width on Windows

From: Eli Zaretskii <[email-masked]>
Date: Sat, 09 Sep 2023 17:39:56 +0300

> From: Po Lu <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 09 Sep 2023 21:38:32 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Thanks, but the above snippet in ftfont.c is only done for
> > proportional fonts, not for fixed-pitch fonts.  Is the font in
> > question, Noto Sans Mono CJK JP, a proportional font?  That is, does
> > it not set the fixed-pitch attribute?
> 
> There's no spacing attribute in TrueType fonts, so that is contingent
> upon how the MS Windows font scaler detects fixed pitch fonts.  Here's
> how ftfont.c calculates the average width for fonts that Fontconfig
> deems fixed pitch:
> 
>     font->min_width = font->average_width = font->space_width
>       = (scalable ? ft_face->max_advance_width * size / upEM + 0.5
> 	 : ft_face->size->metrics.max_advance >> 6);

What is metrics.max_advance, in terms of the attributes recorded in
the font file?

> That aside, Fontconfig does not judge Noto Sans Mono CJK JP a fixed
> pitch font on my system.

OK, that might explain part of the issue, thanks.