mirror of
https://github.com/daylinmorgan/monolisa-nerdfont-patch.git
synced 2024-09-28 20:27:18 -05:00
Compare commits
No commits in common. "67e41cd3628414559b7180aa3cf168990894ee5b" and "683734abba82191ce1654f8b93436a4a59474be8" have entirely different histories.
67e41cd362
...
683734abba
8 changed files with 20 additions and 115 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -185,4 +185,3 @@ patched/*
|
||||||
nerd-fonts
|
nerd-fonts
|
||||||
.env
|
.env
|
||||||
font-patcher-log.txt
|
font-patcher-log.txt
|
||||||
result
|
|
||||||
|
|
|
@ -1,14 +1,20 @@
|
||||||
exclude: "^(src/.*|bin/scripts|font-patcher)"
|
exclude: "^(src/.*|bin/scripts|font-patcher)"
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.5.0
|
rev: v4.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/psf/black
|
||||||
rev: v0.1.14
|
rev: 23.1.0
|
||||||
|
hooks:
|
||||||
|
- id: black
|
||||||
|
- repo: https://github.com/charliermarsh/ruff-pre-commit
|
||||||
|
rev: 'v0.0.257'
|
||||||
hooks:
|
hooks:
|
||||||
- id: ruff-format
|
|
||||||
- id: ruff
|
- id: ruff
|
||||||
args: [ --fix ]
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
||||||
|
rev: v0.9.0.2
|
||||||
|
hooks:
|
||||||
|
- id: shellcheck
|
||||||
|
|
2
LICENSE
2
LICENSE
|
@ -77,7 +77,7 @@ with others.
|
||||||
|
|
||||||
The OFL allows the licensed fonts to be used, studied, modified and
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
redistributed freely as long as they are not sold by themselves. The
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
fonts, including any derivative works, can be bundled, embedded,
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
redistributed and/or sold with any software provided that any reserved
|
redistributed and/or sold with any software provided that any reserved
|
||||||
names are not used by derivative works. The fonts and derivatives,
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
however, cannot be released under any other type of license. The
|
however, cannot be released under any other type of license. The
|
||||||
|
|
|
@ -83,14 +83,6 @@ make update-fonts
|
||||||
|
|
||||||
You can verify the fonts have been added with `make check`.
|
You can verify the fonts have been added with `make check`.
|
||||||
|
|
||||||
## with Nix
|
|
||||||
|
|
||||||
You can run using the included `flake.nix`.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
nix run "github:daylinmorgan/monolisa-nerdfont-patch"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Before making changes to to any of the scripts in `bin` you should first install `pre-commit`.
|
Before making changes to to any of the scripts in `bin` you should first install `pre-commit`.
|
||||||
|
|
|
@ -8,18 +8,11 @@ divider() {
|
||||||
}
|
}
|
||||||
show-version() {
|
show-version() {
|
||||||
printf "%s %s %s\n" "$(divider)" "$1" "$(divider)"
|
printf "%s %s %s\n" "$(divider)" "$1" "$(divider)"
|
||||||
which "$1" 2>/dev/null
|
which "$1"
|
||||||
"$@"
|
"$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
show-dir() {
|
|
||||||
dir="$( dirname -- "$( readlink -f -- "$0"; )"; )"/../"$1"
|
|
||||||
printf "%s\n%s\n%s\n" "$(divider)" "$(tree "$dir")" "$(divider)"
|
|
||||||
}
|
|
||||||
|
|
||||||
show-version python --version
|
show-version python --version
|
||||||
show-version fontforge --version
|
show-version fontforge --version
|
||||||
show-version docker --version
|
show-version docker --version
|
||||||
show-version uname -a
|
show-version uname -a
|
||||||
show-dir MonoLisa
|
|
||||||
show-dir patched
|
|
27
flake.lock
27
flake.lock
|
@ -1,27 +0,0 @@
|
||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1706371002,
|
|
||||||
"narHash": "sha256-dwuorKimqSYgyu8Cw6ncKhyQjUDOyuXoxDTVmAXq88s=",
|
|
||||||
"owner": "nixos",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "c002c6aa977ad22c60398daaa9be52f2203d0006",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "nixos",
|
|
||||||
"ref": "nixos-unstable",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
58
flake.nix
58
flake.nix
|
@ -1,58 +0,0 @@
|
||||||
{
|
|
||||||
description = "brain";
|
|
||||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
|
||||||
|
|
||||||
outputs = inputs @ {
|
|
||||||
self,
|
|
||||||
nixpkgs,
|
|
||||||
}: let
|
|
||||||
inherit (nixpkgs.lib) genAttrs;
|
|
||||||
forAllSystems = f:
|
|
||||||
genAttrs
|
|
||||||
["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"]
|
|
||||||
(system: f nixpkgs.legacyPackages.${system});
|
|
||||||
in {
|
|
||||||
packages = forAllSystems (
|
|
||||||
pkgs:
|
|
||||||
with pkgs; {
|
|
||||||
default = stdenv.mkDerivation {
|
|
||||||
name = "monolisa-nerdfont-patch";
|
|
||||||
src = ./.;
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
buildInputs = [
|
|
||||||
fontforge
|
|
||||||
python3
|
|
||||||
];
|
|
||||||
unpackPhase = ":";
|
|
||||||
buildPhase = ":";
|
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
install -m755 -D ${./patch-monolisa} $out/bin/monolisa-nerdfont-patch
|
|
||||||
install -m755 -D ${./font-patcher} $out/bin/font-patcher
|
|
||||||
cp -r ${./bin} $out/bin/bin
|
|
||||||
cp -r ${./src} $out/bin/src
|
|
||||||
'';
|
|
||||||
postFixup = ''
|
|
||||||
wrapProgram $out/bin/monolisa-nerdfont-patch \
|
|
||||||
--set PATH ${lib.makeBinPath [
|
|
||||||
fontforge
|
|
||||||
]}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
devShells = forAllSystems (
|
|
||||||
pkgs:
|
|
||||||
with pkgs; {
|
|
||||||
default = mkShell {
|
|
||||||
buildInputs = [
|
|
||||||
fontforge
|
|
||||||
python3
|
|
||||||
pre-commit
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
}
|
|
|
@ -10,6 +10,8 @@ import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List, Set
|
from typing import List, Set
|
||||||
|
|
||||||
|
FONT_SRC = (Path(__file__).parent / "MonoLisa").absolute()
|
||||||
|
|
||||||
|
|
||||||
class Color:
|
class Color:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -131,16 +133,16 @@ def patch_single_font(
|
||||||
font_path: Path, output_dir: Path, fp_args: str, verbose: bool
|
font_path: Path, output_dir: Path, fp_args: str, verbose: bool
|
||||||
) -> None:
|
) -> None:
|
||||||
# update display name to full resolved path
|
# update display name to full resolved path
|
||||||
rel_path = font_path.absolute()
|
rel_path = font_path.absolute().relative_to(FONT_SRC)
|
||||||
output_path = (output_dir / rel_path.parent.name).absolute()
|
output_path = (output_dir / rel_path).parent
|
||||||
output_path.mkdir(exist_ok=True, parents=True)
|
output_path.mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
"fontforge",
|
"fontforge",
|
||||||
"-script",
|
"-script",
|
||||||
f"{Path(__file__).parent}/font-patcher",
|
"./font-patcher",
|
||||||
"--glyphdir",
|
"--glyphdir",
|
||||||
f"{Path(__file__).parent}/src/glyphs/",
|
"./src/glyphs/",
|
||||||
"-out",
|
"-out",
|
||||||
f"{output_path}",
|
f"{output_path}",
|
||||||
f"{font_path.absolute()}",
|
f"{font_path.absolute()}",
|
||||||
|
@ -169,9 +171,7 @@ def collect_files_by_dir(fontfiles: List[Path]) -> Set[Path]:
|
||||||
def patch_font_dir_docker(
|
def patch_font_dir_docker(
|
||||||
font_dir_path: Path, output_dir: Path, fp_args: str, verbose: bool
|
font_dir_path: Path, output_dir: Path, fp_args: str, verbose: bool
|
||||||
) -> None:
|
) -> None:
|
||||||
output_path = (
|
output_path = (output_dir / font_dir_path.relative_to(FONT_SRC)).absolute()
|
||||||
output_dir / font_dir_path.relative_to(font_dir_path.parent)
|
|
||||||
).absolute()
|
|
||||||
output_path.mkdir(exist_ok=True, parents=True)
|
output_path.mkdir(exist_ok=True, parents=True)
|
||||||
|
|
||||||
cmd = [
|
cmd = [
|
||||||
|
|
Loading…
Reference in a new issue