-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Patcher does not check for illegal characters in output filename #632
Comments
The font names should (imho) change to be the postscript names of that fonts (see #722). Unfortunately changing the font file name will probably upset people ;) But you are right and I should create a proper PR and not only a discussion. |
OH MY!... read that incorrectly. Of course the PS name limit is enough also for file names Ignore this comment.
@staticmethod
def postscript_char_filter(name):
"""Filter out characters that are not allowed in Postscript names"""
# The name string must be restricted to the printable ASCII subset, codes 33 to 126,
# except for the 10 characters '[', ']', '(', ')', '{', '}', '<', '>', '/', '%'
out = ""
for c in name:
if c in '[](){}<>/%' or ord(c) < 33 or ord(c) > 126:
continue
out += c
return out
Edit: 'Remove' this comment |
[why] The filename is determined by the font (family) name. The font name might include characters that are forbidden to use in filenames. [how] Filter output filesnames and prevent any character that is likely forbidden under Windows. Also prevent control characters. Translate Windows path separators to posix. Fixes: #632 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
[why] The filename is determined by the font (family) name. The font name might include characters that are forbidden to use in filenames. [how] Filter output filesnames and prevent any character that is likely forbidden under Windows. Also prevent control characters. Translate Windows path separators to posix. Fixes: #632 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a new issue, complete the issue template with all the details necessary to reproduce, and mention this issue as reference. |
[why] The filename is determined by the font (family) name. The font name might include characters that are forbidden to use in filenames. [how] Filter output filesnames and prevent any character that is likely forbidden under Windows. Also prevent control characters. Translate Windows path separators to posix. Fixes: ryanoasis#632 Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
🎯 Subject of the issue
As stated in title. Fonts which have fullnames containing characters illegal to the filesystem are not accounted for, and will cause the patcher to fail when producing final output. This could be worked around with an output file flag, or code to substitute illegal characters before final output.
🔧 Your Setup
Which font are you using ?
int10h -- Px437 DOS/V re. JPN16 (
Px437_DOS-V_re_JPN16.ttf
)Which terminal emulator are you using (e.g.
iterm2
,urxvt
,gnome
,konsole
)?Windows Terminal 1.8
Are you using OS X, Linux or Windows? And which specific version or distribution?
Windows 10. The issue most likely exists (with slight variants in allowed characters) for all systems.
The text was updated successfully, but these errors were encountered: