1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-21 02:05:16 +03:00
aports/community/nerd-fonts/794-fix-custom-opt-with-absolute-path.patch
2022-07-25 01:57:04 +02:00

43 lines
1.6 KiB
Diff

Patch-Source: https://github.com/ryanoasis/nerd-fonts/pull/794
--
From 34186ed8476ce822b9a59d50b5e9f631083b7822 Mon Sep 17 00:00:00 2001
From: Fini Jastrow <ulf.fini.jastrow@desy.de>
Date: Tue, 22 Feb 2022 16:35:11 +0100
Subject: [PATCH] font-patcher: Allow to specify custom symbolfont with
absolute path
[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 <ulf.fini.jastrow@desy.de>
---
font-patcher | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/font-patcher b/font-patcher
index 7d063ab24..b3ebbaaf1 100755
--- a/font-patcher
+++ b/font-patcher
@@ -107,7 +107,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