Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Fontconfig error: junk after document ele[SOLVED-WORKAROUND]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
epsilon72
Guru
Guru


Joined: 20 Sep 2007
Posts: 568

PostPosted: Thu Aug 12, 2010 7:44 am    Post subject: Fontconfig error: junk after document ele[SOLVED-WORKAROUND] Reply with quote

I get this error whenever I start almost any X application:

Code:

Fontconfig error: "local.conf", line 9: junk after document element


Code:

$ cat /etc/fonts/local.conf
<!-- Replace Helvetica with DejaVu Sans -->
<match target="pattern" name="family">
        <test name="family" qual="any"><string>Helvetica</string></test>
        <edit name="family" mode="assign">
                <string>DejaVu Sans</string>
        </edit>
</match>
<!-- Replace Lucida with DejaVu Sans -->
<match target="pattern" name="family">
   <test name="family" qual="any"><string>Lucida</string></test>
   <edit name="family" mode="assign">
                <string>DejaVu Sans</string>
        </edit>
</match>
<!-- Replace Times with DejaVu Serif -->
<match target="pattern" name="family">
        <test name="family" qual="any"><string>Times</string></test>
        <edit name="family" mode="assign">
                <string>DejaVu Serif</string>
        </edit>
</match>


What's wrong with line 9? :? :?
Code:

<match target="pattern" name="family">

:? :? :?


Last edited by epsilon72 on Fri Aug 20, 2010 8:25 am; edited 1 time in total
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Thu Aug 12, 2010 8:25 am    Post subject: Reply with quote

Doesn't make sense, there's not even a document element Is there another local.conf somewhere??

Maybe try starting a program under strace and see if it's accessing a different file.
Back to top
View user's profile Send private message
epsilon72
Guru
Guru


Joined: 20 Sep 2007
Posts: 568

PostPosted: Sat Aug 14, 2010 8:42 pm    Post subject: Reply with quote

The only "local.conf" font file I have is the one in the first post (I searched for "local.conf" using locate)

I did find out that if I only have one <match> section in the file, the applications don't complain about it. If I only have one section, however, I can't have all of the ugly fonts replaced that I want to.
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sat Aug 14, 2010 9:17 pm    Post subject: Reply with quote

How does it behave if you merge the match sections into one? Definitely not the right syntax but depending how the parser works it might do the job.

Otherwise, sounds like bug reporting time.
Back to top
View user's profile Send private message
epsilon72
Guru
Guru


Joined: 20 Sep 2007
Posts: 568

PostPosted: Sun Aug 15, 2010 7:27 am    Post subject: Reply with quote

BradN wrote:
How does it behave if you merge the match sections into one? Definitely not the right syntax but depending how the parser works it might do the job.

Otherwise, sounds like bug reporting time.

How would I merge them into one? I tried:
Code:

<!-- Replace Helvetica with DejaVu Sans -->
<match target="pattern" name="family">
        <test name="family" qual="any"><string>Helvetica</string></test>
        <edit name="family" mode="assign">
                <string>DejaVu Sans</string>
        </edit>
        <test name="family" qual="any"><string>Lucida</string></test>
        <edit name="family" mode="assign">
                <string>DejaVu Sans</string>
        </edit>
        <test name="family" qual="any"><string>Times</string></test>
        <edit name="family" mode="assign">
                <string>DejaVu Serif</string>
        </edit>
</match>


..and I didn't get any errors, but only the first font replacement worked; the other two were ignored.

This isn't a big deal because it doesn't affect the functioning of any programs, nevertheless there is something amiss here.
Back to top
View user's profile Send private message
BradN
Advocate
Advocate


Joined: 19 Apr 2002
Posts: 2391
Location: Wisconsin (USA)

PostPosted: Sun Aug 15, 2010 8:33 pm    Post subject: Reply with quote

Yeah, that was what I was thinking. Oh well, it was worth a shot.
Back to top
View user's profile Send private message
epsilon72
Guru
Guru


Joined: 20 Sep 2007
Posts: 568

PostPosted: Fri Aug 20, 2010 8:23 am    Post subject: Reply with quote

I haven't found a solution to the "Fontconfig error" problem with three font family replacements, but I have managed to render that issue moot.


It turns out that the real problem was with the Helvetica bitmapped font. If I just include the lines
Code:

<!-- Replace Helvetica with DejaVu Sans -->
<match target="pattern" name="family">
        <test name="family" qual="any"><string>Helvetica</string></test>
        <edit name="family" mode="assign">
                <string>DejaVu Sans</string>
        </edit>
</match>


in my /etc/fonts/local.conf, I don't get any errors, because it's just one match/family.

However, I've found out that the local.conf file above isn't even needed:
Code:

$ eselect fontconfig list | grep bitmaps
      [38]  70-no-bitmaps.conf
      [39]  70-yes-bitmaps.conf
$ sudo eselect fontconfig enable 38
$ eselect fontconfig list | grep bitmaps
      [38]  70-no-bitmaps.conf *
      [39]  70-yes-bitmaps.conf


That does the trick without any extra files.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum