GNU bug report logs -
#52888
29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX
Previous Next
Reported by: Sean Whitton <spwhitton <at> spwhitton.name>
Date: Thu, 30 Dec 2021 05:29:01 UTC
Severity: normal
Found in version 29.0.50
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Date: Wed, 29 Dec 2021 22:28:37 -0700
>
> On my system I have a variable weight .ttf font[1] installed somewhere.
> When I build with --enable-check-lisp-object-type, the line
>
> int candidate = XFIXNUM (AREF (entity, prop)) >> 8;
>
> in font_delete_unmatched and the expression
>
> EMACS_INT diff = ((XFIXNUM (AREF (entity, i)) >> 8)
> - (XFIXNUM (spec_prop[i]) >> 8));
>
> in font_score have failed assertions because the FONT_WEIGHT_INDEX for
> this .ttf file is nil:
>
> #<font-entity ftcrhb CYRE Inconsolata nil iso10646-1 nil normal nil
> 0 nil 100 0 ((:font-entity
> "/usr/share/fonts/inconsolata/Inconsolata-VariableFont_wdth,wght.ttf"
> . 0))>
>
> I don't believe Emacs really knows how to handle these multi-weight .ttf
> files? Thus I propose the attached patch, to handle the value.
Is the patch supposed to allow Emacs to handle these fonts, or is it
just the protection against assertion violations? If the latter,
isn't it better to teach the font driver to handle these fonts
correctly?
AFAIU, your patch basically will cause Emacs to reject such fonts and
not use them, which is tantamount to telling users to configure Emacs
to ignore them via, say, face-ignored-fonts. Is that right, or am I
missing something?
Thanks.
This bug report was last modified 3 years and 124 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.