Skip to content

Commit

Permalink
font-patcher: Allow to specify custom symbolfont with absolute path
Browse files Browse the repository at this point in the history
[why]
When one wants to use a custom symbol font and specifies it with an
absolute path, the glyphdir is still prepended.

That means that the argument to `--custom` is always used as relative
path (to `--glyphdir`), even when it starts with `/`. That is somehow
unexpected or at least inconvenient.

Example:
fontforge font-patcher --custom ~/Downloads/fa6.otf Inconsolata-Regular.otf

fa6.otf is searched for in ./src/glyphs/home/username/Downloads

[how]
Use Python function that handles joining path fragments. If a component is
an absolute path, all previous components are thrown away.

Signed-off-by: Fini Jastrow <[email protected]>
  • Loading branch information
Finii committed Sep 7, 2022
1 parent 64d53b8 commit 7cda326
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion font-patcher
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class font_patcher:
if symfont:
symfont.close()
symfont = None
symfont = fontforge.open(self.args.glyphdir + patch['Filename'])
symfont = fontforge.open(os.path.join(self.args.glyphdir, patch['Filename']))

# Match the symbol font size to the source font size
symfont.em = self.sourceFont.em
Expand Down

0 comments on commit 7cda326

Please sign in to comment.