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

Add Menu bar #89

Open
ollimeier opened this issue Feb 29, 2024 · 0 comments
Open

Add Menu bar #89

ollimeier opened this issue Feb 29, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@ollimeier
Copy link
Collaborator

ollimeier commented Feb 29, 2024

File
'New Font...'
'Open...'
'Duplicate as...'

Notes:
The file open dialog at least needs to filter by accepted file type. It currently allows selecting of any file, which will lead to confusing errors. I am considering declaring .fontra and .rcjk as packages, then at least on macOS we can treat them as files. On Windows we would still need the "open font project folder" menu, and we probably need some error checking: what if the user selects a folder that is not a valid project? (not .ufo, .fontra or .rcjk).
The New font and Open (file) menu's need shortcuts: command-N and command-O respectively. Not sure how that can map to control-N and control-O on non-macOS.

Maybe add 'Duplidate as' to the file menu, which would allow the user to duplicate the current project (also TTF or OTF) as a .ufo, .fontra or .rcjk.
This would be useful for testing, and for creating a new project based on an existing one.
Maybe implemented by Fontra Pak, but triggered by the front end.

        fileMenu = self.menuBar().addMenu("File")

        newAction = fileMenu.addAction("New Font...")
        newAction.triggered.connect(self.newFont)

        openMenu = fileMenu.addMenu("Open...")
        openFolderAction = openMenu.addAction("Open .fontra, .ufo or .rcjk ...")
        openFolderAction.triggered.connect(self.openFolder)
        openFileAction = openMenu.addAction(
            "Open TTF, OTF, Designspace or GlyphsApp..."
        )
        openFileAction.triggered.connect(self.openFile)
    def openFolder(self):
        projectPath = QFileDialog.getExistingDirectory(
            self, "Open Fontra Folder", "/home/user/", QFileDialog.Option.ShowDirsOnly
        )
        if os.path.exists(projectPath):
            openFile(projectPath, self.port)

    def openFile(self):
        dialog = QFileDialog.getOpenFileName(self, "Open File")
        projectPath = dialog[0]
        if os.path.exists(projectPath):
            openFile(projectPath, self.port)
@ollimeier ollimeier self-assigned this Feb 29, 2024
@ollimeier ollimeier changed the title Add menu bar Add Menu bar Feb 29, 2024
@ollimeier ollimeier added the enhancement New feature or request label Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant