GNU bug report logs - #52888
29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX

Previous Next

Package: emacs;

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: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Sean Whitton <spwhitton <at> spwhitton.name>
Subject: bug#52888: closed (Re: bug#52888: 29.0.50; font_{delete_unmatched,score}
 do not handle nil FONT_WEIGHT_INDEX)
Date: Wed, 12 Jan 2022 14:57:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#52888: 29.0.50; font_{delete_unmatched,score} do not handle nil FONT_WEIGHT_INDEX

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 52888 <at> debbugs.gnu.org.

-- 
52888: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52888
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 52888-done <at> debbugs.gnu.org
Subject: Re: bug#52888: 29.0.50; font_{delete_unmatched,score} do not handle
 nil FONT_WEIGHT_INDEX
Date: Wed, 12 Jan 2022 16:56:44 +0200
> From: Sean Whitton <spwhitton <at> spwhitton.name>
> Cc: 52888 <at> debbugs.gnu.org
> Date: Thu, 06 Jan 2022 11:10:12 -0700
> 
> > OK, but (a) we need a comment there explaining why FC_VARIABLE is used
> > as the condition, and (b) we'd also need to merge the temporary fix in
> > font.c to master.
> 
> Here's an updated patch.  I don't think I can help with (b) but let me
> know if there's something I can do.

Thanks, I installed this, and also installed a followup change that is
the "temporary fix" from emacs-28 adapted to the code on master.

And with that, I'm closing this bug.  Thanks for working on this.

[Message part 3 (message/rfc822, inline)]
From: Sean Whitton <spwhitton <at> spwhitton.name>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; font_{delete_unmatched,score} do not handle nil
 FONT_WEIGHT_INDEX
Date: Wed, 29 Dec 2021 22:28:37 -0700
[Message part 4 (text/plain, inline)]
Hello,

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.

[1]  https://github.com/googlefonts/Inconsolata/tree/main/fonts/variable

-- 
Sean Whitton
[0001-Handle-nil-FONT_WEIGHT_INDEX.patch (text/x-patch, attachment)]

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.