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

Project manager should declare export formats #1878

Closed
simoncozens opened this issue Dec 20, 2024 · 2 comments · Fixed by #1879
Closed

Project manager should declare export formats #1878

simoncozens opened this issue Dec 20, 2024 · 2 comments · Fixed by #1879

Comments

@simoncozens
Copy link
Contributor

Currently if the project manager supplies export-as in its info, then Fontra assumes that it supports all export formats:

if (this.fontController.backendInfo.projectManagerFeatures["export-as"]) {
for (const format of EXPORT_FORMATS) {
registerAction(
`action.export-as.${format}`,

An alternative is for Fontra to read the projectManagerFeatures["export-as"] as a list of supported export formats. Happy to PR this if it's a good idea.

@justvanrossum
Copy link
Collaborator

Yeah, good point, and good solution. Please keep the relationship with Fontra Pak in mind: https://github.com/googlefonts/fontra-pak/blob/main/FontraPakMain.py

@simoncozens
Copy link
Contributor Author

So I'll probably change:

        for key, methodName in [("export-as", "exportAs")]:
            projectManagerFeatures[key] = hasattr(self.projectManager, methodName)

to

        if hasattr(self.projectManager, "exportAs"):
            projectManagerFeatures["export-as"] = self.projectManager.supportedExportFormats

FileSystemProjectManager doesn't support any, AFIACS, and I'll send a separate PR to subclass it in FontraPak.

While I'm about it I'll try to fix up the fact that nothing checks whether features["find-glyphs-that-use-glyph"] before using it...

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

Successfully merging a pull request may close this issue.

2 participants