Commit 6f945a36 authored by Naoki OKAMURA's avatar Naoki OKAMURA

improved: use self-patched MyricaM M as Monospace font

parent 5eefdf7a
......@@ -3,23 +3,17 @@
fonts = {
fonts = with pkgs; [
noto-fonts-cjk-jp noto-fonts-emoji
myrica dejavu_fonts nerdfonts-symbols
genjyuu-gothic
myrica myrica-patched genjyuu-gothic
];
fontconfig = {
enable = true;
ultimate = {
enable = true;
preset = "osx";
};
penultimate.enable = false;
penultimate.enable = true;
defaultFonts = {
sansSerif = [ "Noto Sans CJK JP" "Noto Emoji" ];
serif = [ "Noto Serif CJK JP" "Noto Emoji" ];
monospace = [ "Myrica M" "Symbols Nerd Font" "Noto Emoji" "Noto Sans Mono CJK JP" ];
sansSerif = [ "Noto Sans CJK JP" "Noto Color Emoji" ];
serif = [ "Noto Serif CJK JP" "Noto Color Emoji" ];
monospace = [ "Myrica M Patched" "Noto Sans Mono CJK JP" "Noto Color Emoji" ];
};
};
};
......
DEFAULT=Myrica M
U+25A0-25FF=DejaVu Sans Mono
U+2700-27BF=DejaVu Sans Mono
U+E000-E00A=Symbols Nerd Font
U+E0A0-E0E3=Symbols Nerd Font
U+E0B0-E0D4=Symbols Nerd Font
U+E200-E2A9=Symbols Nerd Font
U+E5FA-E62B=Symbols Nerd Font
U+E700-E7C5=Symbols Nerd Font
U+F000-F2E0=Symbols Nerd Font
U+F300-F313=Symbols Nerd Font
U+F400-F4A8=Symbols Nerd Font
DEFAULT=Monospace
......@@ -18,11 +18,11 @@ set-option -g message-command-style "bg=default,fg=brightblue"
set-option -g message-style "bg=default,fg=brightwhite"
set-option -g status-style "bg=default,fg=brightwhite"
set-option -g status-left " #{?pane_in_mode,#[fg=brightmagenta]#[default],#[fg=blue]#[default]} "
set-option -g status-right "#[fg=brightyellow]#[default] %Y-%m-%d #[fg=brightcyan]#[default] %H:%M:%S #[fg=brightblue]#[default] #(echo $USER) #[fg=brightgreen]#[default] #(hostname)"
set-option -g status-left " #{?pane_in_mode,#[fg=brightmagenta]#[default],#[fg=blue]#[default]} "
set-option -g status-right "#[fg=brightyellow]#[default] %Y-%m-%d #[fg=brightcyan]#[default] %H:%M:%S #[fg=brightblue]#[default] #(echo $USER) #[fg=brightgreen]#[default] #(hostname)"
set-option -g status-right-length 80
set-window-option -g window-status-current-format "#[fg=brightgreen]#[bold]#[default] #W"
set-window-option -g window-status-current-format "#[fg=brightgreen]#[bold]#[default] #W"
set-window-option -g window-status-format "#[bold]#I#[default]:#W"
# pane status
......
self: super: let
require = path: args: super.callPackage (import path) args;
in {
genjyuu-gothic = require ./pkgs/genjyuu-gothic/default.nix { };
nerdfonts-symbols = require ./pkgs/nerdfonts-symbols/default.nix { };
noto-fonts-cjk-jp = require ./pkgs/noto-fonts-cjk-jp/default.nix { };
fontmerger = require ./pkgs/font-merger/default.nix { };
genjyuu-gothic = require ./pkgs/genjyuu-gothic/default.nix { };
myrica-patched = require ./pkgs/myrica-patched/default.nix { };
nerdfonts-symbols = require ./pkgs/nerdfonts-symbols/default.nix { };
noto-fonts-cjk-jp = require ./pkgs/noto-fonts-cjk-jp/default.nix { };
wcwidth-cjk = require ./pkgs/wcwidth-cjk/default.nix { };
}
{ stdenv, python2, python2Packages, fetchFromGitHub, fontforge }:
stdenv.mkDerivation rec {
name = "fontmerger";
version = "git";
src = fetchFromGitHub {
owner = "iij";
repo = "fontmerger";
rev = "3432e19b6d99422889c4ceec4d9f4dbb25000cc8";
sha256 = "0cbmks0x93gn72avpayhvr0lr77gnsb81yq2iq9rg985idgsv626";
};
buildInputs = [
python2 fontforge
];
patchPhase = ''
sed -i "s!default='./fonts.json'!default='$out/share/fontmerger/fonts.json'!" fontmerger/__init__.py
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/fontmerger
cp -R . $out/share/fontmerger
cat <<EOF >$out/bin/fontmerger
#! ${stdenv.shell}
export PATH=${python2}/bin:${fontforge}/bin:\''$PATH
cd $out/share/fontmerger
exec bash bin/fontmerger "\''${@:-}"
EOF
chmod +x $out/bin/fontmerger
'';
}
{ stdenv, fetchurl, fontmerger, myrica, fontforge }:
let
script = fetchurl {
url = "https://gist.githubusercontent.com/fatum12/941a10f31ac1ad48ccbc/raw/15b0b59bd4b372740ce944474ba103f6548b73f3/ttc2ttf.pe";
sha256 = "09zd1g5hp6dhwlql7swq85xdg6idakl844qiprkyz52j4hbbd77i";
};
in stdenv.mkDerivation rec {
name = "myrica-patched";
version = "0.0.1";
nativeBuildInputs = [
fontmerger fontforge
];
unpackPhase = ''
fontforge -script ${script} ${myrica}/share/fonts/truetype/Myrica.TTC
fontforge -script ${script} ${myrica}/share/fonts/truetype/MyricaM.TTC
'';
buildPhase = ''
fontmerger --verbose --all --suffix=Patched --output=`pwd` -- `pwd`/MyricaM.ttf
fontmerger --verbose --all --suffix=Patched --output=`pwd` -- `pwd`/MyricaMM.ttf
'';
installPhase = ''
mkdir -p $out/share/fonts/truetype
cp MyricaM*Patched*.ttf $out/share/fonts/truetype
'';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment