这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@Finii
Copy link
Collaborator

@Finii Finii commented Nov 24, 2021

Description

Please explain the changes you made here.

Requirements / Checklist

  • Read the Contributing Guidelines
  • Read or at least glanced at the FAQ
  • Read or at least glanced at the Wiki
  • Scripts execute without error (if necessary):
    • If any of the scripts were modified they have been tested and execute without error, e.g.:
      • ./font-patcher Inconsolata.otf --fontawesome --octicons --pomicons
      • ./gotta-patch-em-all-font-patcher\!.sh Hermit
  • Extended the README and documentation if necessary, e.g. You added a new font please update the table

What does this Pull Request (PR) do?

2 commits:

font-patcher: Allow processing of fonts with fsType set

[why]
Through fsType certain restrictions can be set on a font. When fontforge
is used in interactive mode the user can override the restrictions with
a popup dialogue. The font-patcher script dies instead, without any
meaningful message.

[how]
Allow the script to ignore fsType settings when opening.
The restrictions will still persist into the generated patched font.

[note]
This came up with Bicubik by Anton Kudin, that has fsType = 2
(modification restriction) set.

Fixes: #686

font-patcher: Fail with meaningful message if font can not be opened

[why]
When fontforge is not able to open the font we fail with a meaninless
exception. Users might think that the font-patcher script itself is
broken.

[how]
Exit the script with a hint how to get more information if fontforge was
not able to open the font.

[why]
Through fsType certain restrictions can be set on a font. When fontforge
is used in interactive mode the user can override the restrictions with
a popup dialogue. The font-patcher script dies instead, without any
meaningful message.

[how]
Allow the script to ignore fsType settings when opening.
The restrictions will still persist into the generated patched font.

[note]
This came up with Bicubik by Anton Kudin, that has fsType = 2
(modification restriction) set.

Fixes: #686

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why]
When fontforge is not able to open the font we fail with a meaninless
exception. Users might think that the font-patcher script itself is
broken.

[how]
Exit the script with a hint how to get more information if fontforge was
not able to open the font.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
@0xf0xx0
Copy link

0xf0xx0 commented Nov 25, 2021

can confirm this works, thanks :D

@ryanoasis ryanoasis merged commit 7145db4 into master Nov 27, 2021
@ryanoasis ryanoasis deleted the bugfix/fstype-font-does-not-open branch November 27, 2021 01:57
@ryanoasis
Copy link
Owner

great. thanks. tested out. looks good.

ryanoasis added a commit that referenced this pull request Nov 28, 2021
* the patcher refuses to patch all/most fonts with this flag in the open options
@ryanoasis
Copy link
Owner

I had to revert part of this as that flag seems to be causing issues patching at all. see #691

At first I thought something changed with Cascadia Code but I tried the unpatched version in Nerd Fonts as well as Hack. Neither worked. Seems to work again now.

Finii added a commit that referenced this pull request Nov 28, 2021
[why]
With commit
  f7d6fcb font-patcher: Allow processing of fonts with fsType set
we added support for fonts with the fsType set. This came up in
issue #686 with font 'Bicubik'.

The solution in that commit uses (modern) textual flags in the
`fontforge` open() method. But they have been only introduced in 2020,
so people using older `fontforge` could not patch anything anymore.
This has been reported in issue #691.

As a quick fix the fsType support has been removed with commit
  ab6fa3c Reverts part of #687 * the patcher refuses to patch all/most fonts with this flag in the open options

[how]
Revert f7d6fcb but use the old fashioned numerical open flags
interface instead.

[note]
The textual open() flags have been introduced into `fontforge`s python
interface with their commit

fontforge/fontforge@4a76712

  Font Open flag improvements
  * Document more Open flags
  * Add string tuple interface to python FontOpen API

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this pull request Nov 24, 2023
…es-not-open

Bugfix/fstype font does not open
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this pull request Nov 24, 2023
* the patcher refuses to patch all/most fonts with this flag in the open options
LNKLEO pushed a commit to LNKLEO/Nerd that referenced this pull request Nov 24, 2023
[why]
With commit
  f7d6fcb font-patcher: Allow processing of fonts with fsType set
we added support for fonts with the fsType set. This came up in
issue ryanoasis#686 with font 'Bicubik'.

The solution in that commit uses (modern) textual flags in the
`fontforge` open() method. But they have been only introduced in 2020,
so people using older `fontforge` could not patch anything anymore.
This has been reported in issue ryanoasis#691.

As a quick fix the fsType support has been removed with commit
  ab6fa3c Reverts part of ryanoasis#687 * the patcher refuses to patch all/most fonts with this flag in the open options

[how]
Revert f7d6fcb but use the old fashioned numerical open flags
interface instead.

[note]
The textual open() flags have been introduced into `fontforge`s python
interface with their commit

fontforge/fontforge@4a76712

  Font Open flag improvements
  * Document more Open flags
  * Add string tuple interface to python FontOpen API

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Font-patcher fails to patch font: OSError

4 participants