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

Conversation

@mdschweda
Copy link
Contributor

Description

The changes introduce Docker support for Nerd Fonts.

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?

  • Adds a Dockerfile alongside .dockerignore and a shell script that serves as the entrypoint of the container
  • Defines a GitHub Actions workflow for continuous deployment of the image. Of course, any other CI/CD tooling of your choice may be used
  • Extends the README with text passages on how to use the image
  • References a Docker Hub repository I have created for the project (nerdfonts/patcher)

The PR requires some follow-up work:

  • Invitation of the project's owner to the Docker Hub organization and transfer of its ownership
  • Creation of a personal access token
  • Definition of two repository secrets DOCKER_USER and DOCKER_PAT for pushing images to Docker Hub
  • README translation

How should this be manually tested?

I did an initial push to the Docker repository for testing purposes. You can test the image by following the instructions on the repository site.

Any background context you can provide?

Especially on Windows, the Fonts Patcher is inconvenient to use. An official Docker image would give users an easy-to-use alternative and a possibility to use the latest version of the Fonts Patcher in a pre-configured environment or as part of build pipelines.

What are the relevant tickets (if any)?

This PR relates to issue #422 . I have worked on the changes before stumbling over the issue. The Dockerfile is very similar @carlosedp 's work and introduces some improvements: I could greatly reduce the image size by basing the image on Alpine Linux and defined a custom entrypoint so that users can pass options into the container analogous to how you would use the CLI.

Screenshots (if appropriate or helpful)

@cdalvaro
Copy link

Maybe you can take some ideas from here: cdalvaro/docker-nerd-fonts-patcher

@ryanoasis
Copy link
Owner

I'll take a look this weekend. Thanks and good stuff!

@ryanoasis
Copy link
Owner

Hey I just got around to trying this out, it's pretty exciting but I have an issue.

pwd
/home/ryan/projects/nerd-fonts/temp/docker-testing

ls -l
drwxrwxrwx 2 ryan ryan 4096 Apr  6 12:52 in
drwxrwxrwx 2 ryan ryan 4096 Apr  6 12:51 out

sudo docker run -v /home/ryan/projects/nerd-fonts/temp/docker-testing/in:/in -v /home/ryan/projects/nerd-fonts/temp/docker-testing/out:/out nerdfonts/patcher --complete

sh: New: unknown operand

Where in has one otf file

Maybe I'm doing something dumb? 🤔 Thanks

@pbnj
Copy link

pbnj commented Apr 9, 2020

I just followed the instructions here on my machine (macOS X Catalina) and it worked just fine:

docker run -v $PWD:/in -v $PWD:/out nerdfonts/patcher --complete

where $PWD has 4 TTF files.

@ryanoasis
Copy link
Owner

Yeah I'm on Ubuntu 16.04 LTS (don't laugh at me 😄)

I've got the branch working but I definitely do see that shell error but it DOES end up patching it 👍

I tried looking into shellcheck, probably some minor thing.

I haven't gotten the container from Docker Hub working yet.. I'll try again hopefully tomorrow..

@juchom
Copy link

juchom commented May 18, 2020

Running this command on Windows 10:

docker run --rm --volume c:/dev/jbmono-nf/work/in:/in --volume c:/dev/jbmono-nf/work/out:/out nerdfonts/patcher --complete

I have this outputs, is this ok?

Copyright (c) 2000-2019. See AUTHORS for Contributors.
 License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
 with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
 Version: 20190801
 Based on sources from 23:54 UTC 30-Dec-2019-ML-D-GDK3.
Your version of iconv does not support the "Mac Roman" encoding.
If this causes problems, reconfigure --without-iconv.The following table(s) in the font have been ignored by FontForge
  Ignoring 'DSIG' digital signature table
The truetype encoding specified by platform=1 specific=0 (which we map to Mac) is not supported by your version of iconv(3).
Adding 54 Glyphs from Seti-UI + Custom Set
╢████████████████████████████████████████╟ 100%
Adding 198 Glyphs from Devicons Set
╢████████████████████████████████████████╟ 100%
Adding 3 Glyphs from Powerline Symbols Set
╢████████████████████████████████████████╟ 100%
Adding 4 Glyphs from Powerline Symbols Set
╢████████████████████████████████████████╟ 100%
Adding 1 Glyphs from Powerline Extra Symbols Set
╢████████████████████████████████████████╟ 100%
Adding 21 Glyphs from Powerline Extra Symbols Set
╢████████████████████████████████████████╟ 100%
Adding 1 Glyphs from Powerline Extra Symbols Set
╢████████████████████████████████████████╟ 100%
Adding 8 Glyphs from Powerline Extra Symbols Set
╢████████████████████████████████████████╟ 100%
Adding 11 Glyphs from Pomicons Set
╢████████████████████████████████████████╟ 100%The following table(s) in the font have been ignored by FontForge
  Ignoring 'EPAR'
The glyph named asterisk is mapped to U+F069.
  But its name indicates it should be mapped to U+002A.
The glyph named plus is mapped to U+F067.
  But its name indicates it should be mapped to U+002B.
The glyph named question is mapped to U+F128.
  But its name indicates it should be mapped to U+003F.
The glyph named minus is mapped to U+F068.
  But its name indicates it should be mapped to U+2212.
The glyph named heart is mapped to U+F004.
  But its name indicates it should be mapped to U+2665.
The glyph named home is mapped to U+F015.

...
...
...

Adding 1 Glyphs from Power Symbols Set
╢████████████████████████████████████████╟ 100%The PostScript font name "Material Design Icons" is invalid.
It should be printable ASCII,
must not contain (){}[]<>%/ or space
and must be shorter than 63 characters
The PostScript font name "Material Design Icons" is invalid.
It should be printable ASCII,
must not contain (){}[]<>%/ or space
and must be shorter than 63 characters
The glyph named alpha is mapped to U+F02B.
  But its name indicates it should be mapped to U+03B1.

...
...
...

Adding 2119 Glyphs from Material Set
╢████████████████████████████████████████╟ 100%The following table(s) in the font have been ignored by FontForge
  Ignoring 'webf'

...
...
...

Done with Patch Sets, generating font...

Generated: JetBrainsMonoNerdFontComplete-Regular
/nerd/font-patcher:823: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  glyph.left_side_bearing = 0.0
/nerd/font-patcher:825: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  glyph.right_side_bearing = 0.0

EDIT: Actually I have this small issue after patching, the arrow is too big:
image

@ryanoasis ryanoasis merged commit 0d9f3dc into ryanoasis:master Apr 20, 2021
@ryanoasis
Copy link
Owner

The PR requires some follow-up work

Yep, can work together on some of these. Thanks again

@mdschweda
Copy link
Contributor Author

Completely forgot about this 🙁. Dockerfile needs some attention after a year

✔ Docker repository ownership transferred
✔ Action running
⏳ Investigate build error
⏳ Test image with latest version

fyi @ryanoasis

@ryanoasis
Copy link
Owner

Hey @mdschweda

Yep. I finally got around to adding the secrets after setting up my account that you had linked me to for the registry 😄

Build error has been fixed by other PRs (thanks goes out to those peeps!)

Docker publishing is now working/fixed

LNKLEO pushed a commit to LNKLEO/Nerd that referenced this pull request Nov 24, 2023
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.

5 participants