Re: FcFontList() can return NULL - should it? should it be documented?

Akira TAGOH <[email protected]>
Newsgroups gmane.comp.fonts.fontconfig
Message-ID <CACT-Cx1vCSQHKMXhzH2uvqxLbkF7xCDqc7r0pv0Nz_bDThMV7g@mail.gmail.com>
On Thu, Aug 25, 2016 at 2:22 PM, Behdad Esfahbod <[email protected]> wrote:

> My understanding is that fontconfig API returns NULL only on allocation
> failures.  So, I think you've hit a bug.
>
Same on my understanding.


>
> On Aug 25, 2016 1:19 PM, "Alan Coopersmith" <[email protected]>
> wrote:
>
>> While assisting with the investigation of:
>>     [JDK-8160664] JVM crashed with font manager on Solaris 12
>>     https://bugs.openjdk.java.net/browse/JDK-8160664
>> we discovered that if none of the font directories are present on the
>> system
>> FcFontList() returns NULL, but if at least one is present, even if empty,
>> then it returns a valid pointer to a list of 0 entries.
>>
>
Interesting. though I've tried to reproduce that situation by modifying
fonts.conf containing invalid directories, fc-list does show no fonts but
the returned value has a valid pointer rather than NULL.
Can you investigate more where the checking failed and then return NULL in
fontconfig? and what version of fontconfig are you using?


>> This doesn't seem to be documented anywhere that I can find, but you
>> can see the fc-list utility checks for it all the way back to the
>> first revision in git.   Is this intentional?  Should it be documented
>> so other application authors know to check for NULL?
>>
>> --
>>         -Alan Coopersmith-              [email protected]
>>          Oracle Solaris Engineering - http://blogs.oracle.com/alanc
>> _______________________________________________
>> Fontconfig mailing list
>> [email protected]
>> https://lists.freedesktop.org/mailman/listinfo/fontconfig
>>
>
> _______________________________________________
> Fontconfig mailing list
> [email protected]
> https://lists.freedesktop.org/mailman/listinfo/fontconfig
>
>


-- 
Akira TAGOH

_______________________________________________
Fontconfig mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/fontconfig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.