Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Idea: Validate XML in .designspace files and maybe presence of source files #24

Open
madig opened this issue Oct 23, 2018 · 6 comments
Open

Comments

@madig
Copy link
Contributor

madig commented Oct 23, 2018

So instead of passing several UFOs to ufolint, you pass one or more .designspaces files and ufolint validates the XML and then runs all the normal other checks on the source files.

@chrissimpkins
Copy link
Member

Where is the designspace spec housed?

@madig
Copy link
Contributor Author

madig commented Oct 24, 2018

I think it is specified more or less informally, at https://github.com/fonttools/fonttools/tree/master/Doc/source/designspaceLib.

@chrissimpkins
Copy link
Member

chrissimpkins commented Oct 24, 2018

Thanks!

So this would involve the following?:

  1. XML validation check on designspace file
  2. parse XML for UFO source paths in sources child element in the following file spec:
<?xml version='1.0' encoding='utf-8'?>
<designspace format="3">
    <axes>
        <!-- define axes here -->
        <axis../>
    </axes>
    <sources>
        <!-- define masters here -->
        <source../>
    </sources>
    <instances>
        <!-- define instances here -->
        <instance../>
    </instances>
    <rules>
        <!-- define rules here -->
        <rule../>
    </rules>
    <lib>
        <dict>
            <!-- store custom data here -->
        </dict>
    </lib>
</designspace>
  1. Run tests on each identified UFO source path

@madig
Copy link
Contributor Author

madig commented Oct 24, 2018

What do you mean by 2.? I think checking the XML and then turning it into a designspaceLib.DesignspaceDocument to iterate over the source files is enough. If designspaceLib raises, print that instead and abort.

@chrissimpkins
Copy link
Member

Ah sorry, wasn't thinking. Of course we can read it with designspaceLib. Trying to reinvent the wheel.

Something that you'd like to work on? If not, I am willing to add this when time allows.

@madig
Copy link
Contributor Author

madig commented Oct 24, 2018

Don't have time this week I think, but we can just leave it here for now...

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

No branches or pull requests

2 participants