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
Message #47 received at 52888 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
On Wed 05 Jan 2022 at 02:37PM +02, Eli Zaretskii wrote:
> According to what I see in the documentation, FcPatternGetRange exists
> only since version 2.11.91 of Fontconfig, whereas we support 2.2.0 and
> up.
Ah, right. Is this version bound written down anywhere other than the
conditionals in configure.ac? Sorry I didn't think to look there.
> So we cannot unconditionally use that API, and some part of the
> temporary solution will have to be left in the source. I'd need to
> see the final patch with that in mind, before I can decide whether it
> is simple/safe enough for the release branch.
My patch requires FC_VARIABLE which was not added until 2.12.91, so in
the attached revision I've set up preprocessor conditionals based on
FC_VARIABLE. Checking that FC_VARIABLE is true is how we know it's one
of the virtual entries.
It looks like fontconfig commit 83b41611 introduced the meta patterns
under discussion. The first tagged release including that commit is
2.12.91. So AFAICT nothing of the old fix need remain.
> I'm far from being an expert on Fontconfig programming, but the above
> use of 'range' looks strange: it's a pointer that starts pointing to
> some random (potentially invalid) address, and you pass its address to
> FcPatternGetRange, which presumably assigns to it a valid point. But
> doesn't that valid pointer need to be released somehow after we use
> it? Or does it point to static area(s)? I cannot find anything in
> the Fontconfig documentation about the memory-management protocols for
> FcValue objects, but maybe we should call FcValueDestroy on it after
> we are done with it? Or maybe this is not needed, as this passage
> from the docs says near the end:
Yes, I was surprised too, but as has been mentioned, the FcPatternGet*
functions are documented as supplying pointers to storage which must not
be freed.
--
Sean Whitton
[v2-0001-Skip-virtual-FcPattern-entries-for-variable-weigh.patch (text/x-patch, attachment)]
This bug report was last modified 3 years and 125 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.