mirror of
https://github.com/ryanoasis/nerd-fonts.git
synced 2024-09-19 09:51:48 +02:00
Merge pull request #1508 from nobk/pdckr
Parallel execution fontforge in docker
This commit is contained in:
commit
e633e5f2cc
3 changed files with 22 additions and 2 deletions
|
@ -6,7 +6,7 @@ LABEL org.opencontainers.image.title="Nerd Fonts Patcher" \
|
|||
org.opencontainers.image.source="https://github.com/ryanoasis/nerd-fonts" \
|
||||
org.opencontainers.image.licenses="MIT"
|
||||
|
||||
RUN apk update && apk upgrade && apk add --no-cache fontforge --repository=https://dl-cdn.alpinelinux.org/alpine/latest-stable/community
|
||||
RUN apk update && apk upgrade && apk add --no-cache fontforge parallel --repository=https://dl-cdn.alpinelinux.org/alpine/latest-stable/community
|
||||
|
||||
ENV PYTHONIOENCODING=utf-8
|
||||
|
||||
|
|
|
@ -23,6 +23,16 @@ done
|
|||
printf "Running with options:\n%s\n" "$args"
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
for f in /in/*.otf /in/*.ttf /in/*.woff /in/*.eot /in/*.ttc; do [ -f "$f" ] && fontforge -script /nerd/font-patcher -out /out $args "$f"; done
|
||||
if [ "$PN" -eq 1 ]; then
|
||||
find /in -type f \
|
||||
\( -iname '*.otf' -o -iname '*.ttf' -o -iname '*.woff' -o -iname '*.eot' -o -iname '*.ttc' \) \
|
||||
-exec fontforge -script /nerd/font-patcher -out /out $args {} \;
|
||||
else
|
||||
njob=""
|
||||
[ "$PN" -gt 1 ] && njob="-j $PN"
|
||||
find /in -type f \
|
||||
\( -iname '*.otf' -o -iname '*.ttf' -o -iname '*.woff' -o -iname '*.eot' -o -iname '*.ttc' \) \
|
||||
| parallel $njob fontforge -script /nerd/font-patcher -out /out $args {}
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
|
10
readme.md
10
readme.md
|
@ -365,9 +365,19 @@ Patching the font of your own choosing:
|
|||
```
|
||||
|
||||
* Use docker
|
||||
* Default parallel tasks
|
||||
```
|
||||
docker run --rm -v /path/to/fonts:/in:Z -v /path/for/output:/out:Z nerdfonts/patcher [OPTIONS]
|
||||
```
|
||||
* Single process (slow)
|
||||
```
|
||||
docker run --rm -v /path/to/fonts:/in:Z -v /path/for/output:/out:Z -e "PN=1" nerdfonts/patcher [OPTIONS]
|
||||
```
|
||||
* Specify the parallel tasks number to 10
|
||||
```
|
||||
docker run --rm -v /path/to/fonts:/in:Z -v /path/for/output:/out:Z -e "PN=10" nerdfonts/patcher [OPTIONS]
|
||||
```
|
||||
|
||||
|
||||
> [!NOTE]
|
||||
> The resulting font's family (aka font name) will be set to the original family after CamelCasing, removing whitespace and appending ` Nerd Font`. For example, `iosevka term` would become `IosevkaTerm Nerd Font`.
|
||||
|
|
Loading…
Reference in a new issue