Skip to content

Use systemId urn:fontconfig:fonts.dtd to reference the fonts.dtd type defintion #644

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hegjon
Copy link

@hegjon hegjon commented Nov 21, 2022

When packaging font for Fedora Linux, the RPM macro will check if the fontconfig is valid by running the xmllint command.

Before:

Hack/config/fontconfig on  master
❯ xmllint --loaddtd --valid --nonet 45-Hack.conf
45-Hack.conf:2: warning: failed to load external entity "fonts.dtd"
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
                                        ^
45-Hack.conf:3: validity error : Validation failed: no DTD found !
<fontconfig>
           ^
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <!-- Declare Hack a monospace font -->
  <alias>
    <family>Hack</family>
    <default><family>monospace</family></default>
  </alias>
  <!-- if this file is put in user’s configuration, unset sans-serif family -->
  <match>
    <test compare="eq" name="family">
        <string>sans-serif</string>
    </test>
    <test compare="eq" name="family">
        <string>Hack</string>
    </test>
    <edit mode="delete" name="family"/>
  </match>
</fontconfig>

After:

Hack/config/fontconfig on  fontconfig
❯ xmllint --loaddtd --valid --nonet 45-Hack.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <!-- Declare Hack a monospace font -->
  <alias>
    <family>Hack</family>
    <default><family>monospace</family></default>
  </alias>
  <!-- if this file is put in user’s configuration, unset sans-serif family -->
  <match>
    <test compare="eq" name="family">
        <string>sans-serif</string>
    </test>
    <test compare="eq" name="family">
        <string>Hack</string>
    </test>
    <edit mode="delete" name="family"/>
  </match>
</fontconfig>

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant