2

Getting this error on my vps server:

fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank"

This is the file:

https://pastebin.com/VqcSgJ9x

How to fix it?

  • Getting the same error when trying to launch headless Chrome in a docker container - still digging. – Jacob Thomason Mar 8 at 23:05
0

TL;DR: You should probably just ignore this warning.

If you feel a little bold you might try removing the <blank>...</blank> section from your /etc/fonts/fonts.conf file (maybe making a back-up first if you're not feeling quite so foolhardy). When I tried this, the warning went away. However, you may have noticed a scary looking message at the top of the file saying: DO NOT EDIT THIS FILE. IT WILL BE REPLACED WHEN FONTCONFIG IS UPDATED. LOCAL CHANGES BELONG IN 'local.conf'. So this was probably not the right solution. (If you wondering why I did it anyways: I didn't see a local.conf, was too lazy to read the fine manuals, and figured that my hack getting overwritten was more like a feature than a bug anyway since maintainers would likely publish an official solution later anyway -- besides I wanted to learn.)

OK, let's back up now. This is (unsurprisingly) related to fontconfig's <blank> element, whose usage is described in the fontconfig docs as

<blank> Fonts often include "broken" glyphs which appear in the encoding but are drawn as blanks on the screen. Within the element, place each Unicode characters which is supposed to be blank in an element. Characters outside of this set which are drawn as blank will be elided from the set of characters supported by the font.

The docs suggest that there's nothing with having these options defined. Also, they are specified in the DTD. However, you may have noticed a related fontconfig API called FcBlanks (emphasis mine):

An FcBlanks object holds a list of Unicode chars which are expected to be blank when drawn. When scanning new fonts, any glyphs which are empty and not in this list will be assumed to be broken and not placed in the FcCharSet associated with the font. This provides a significantly more accurate CharSet for applications.

FcBlanks is deprecated and should not be used in newly written code. It is still accepted by some functions for compatibility with older code but will be removed in the future.

This suggests to me that they are allowed in the configuration file for compatibility but are not intended to be used any more.

Without more information I'm not sure in what context you're seeing this warning, however, lately I've seen it a lot with chromium / electron / Google Chrome. Taking a peek at chromium's external/fontconfig's commit history I noticed:

commit dc8326d3f116bb2a1425aa68660a332e351b6cb4
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Fri Sep 15 01:20:56 2017 -0400

    [fc-query] Remove --ignore-blanks / -b

    Blanks are the new black, err, dead!

...

commit 8b46a518bda8ecb3c5e2dfb0c1e5fda99e40aa3e
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Tue Sep 12 17:08:08 2017 -0400

    Update documentation for removal of blanks

    Patch from Jerry Casiano.

You can also see this in the 2.12.91 change log. I suspect that the warning started appearing around the time chromium updated to this (or newer) version of fontconfig. It looks like that happened around June 2018 / chromium 69. Peeking at the DEPS file and third_party/fontconfig/BUILD.gn suggests that ba206df9b9a7ca300265f650842c1459ff7c634a (a couple commits newer than 2.13.1) is used for embedded builds meanwhile ChromeOS and Linux will use "the system version." If I understand correctly that means that when building chromium on/for Linux, build/install-build-deps.sh would have installed the latest libfontconfig1 package provided by the distribution (in my case 2.11.0-6.7+b1). At this point I looked around a little bit for more information about how my build of chromium was compiled, specifically, but then I lost interest. I assume the maintainers try to keep it in step with the rest of the distribution.

In the end, if I'm not terribly mistaken, all this message really means is that the configuration file contains some information (other than comments) that will not be used by the program that output it.

See also:

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.