Skip to content

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

Open
hegjon wants to merge 1 commit intosource-foundry:masterfrom
hegjon:fontconfig
Open

Use systemId urn:fontconfig:fonts.dtd to reference the fonts.dtd type defintion#644
hegjon wants to merge 1 commit intosource-foundry:masterfrom
hegjon:fontconfig

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant