Browse Source

re-add font, but text only

main
Milan 3 weeks ago
parent
commit
e5a3fd88a2
Signed by: petabyteboy GPG Key ID: A6DC6A7CB0B97859
4 changed files with 44 additions and 19 deletions
  1. +21
    -4
      Makefile
  2. +1
    -14
      default.nix
  3. +6
    -1
      files/style.css
  4. +16
    -0
      make-font.pe

+ 21
- 4
Makefile View File

@ -1,8 +1,10 @@
outdir ?= ./public
tmpdir ?= ./tmp
veraMonoSrc ?= ./VeraMono.ttf
all = $(addprefix ${outdir}/, $(addsuffix .html, $(basename $(wildcard *.md))))
files = $(addprefix ${outdir}/, $(wildcard files/*))
all: ${all} ${files}
all: ${all} ${files} ${outdir}/VeraMono.subset.woff2
show:
@echo ${all}
@ -11,6 +13,9 @@ show:
${outdir}:
mkdir -p ${outdir}
${tmpdir}:
mkdir -p ${tmpdir}
${outdir}/files:
mkdir -p ${outdir}/files
@ -20,12 +25,24 @@ ${outdir}/%.html: %.md template.html ${outdir}
${outdir}/files/%: files/% ${outdir}/files
cp $< $@
${tmpdir}/VeraMono.ttf: ${veraMonoSrc} ${tmpdir}
cp $< $@
${tmpdir}/%.subset.ttf: ${tmpdir}/%.ttf
fontforge -script make-font.pe $< $@
${tmpdir}/%.woff2: ${tmpdir}/%.ttf
woff2_compress $<
${outdir}/%: ${tmpdir}/% ${outdir}
cp $< $@
clean:
rm -r ${outdir}
rm -r ${outdir} ${tmpdir}
start: ${all}
{ php -S 127.0.0.1:8123 -t ${outdir} & \
echo $$! > php.pid; }
echo $$! > ${tmpdir}/php.pid; }
stop:
kill `cat php.pid`
kill `cat ${tmpdir}/php.pid`

+ 1
- 14
default.nix View File

@ -7,20 +7,7 @@ stdenv.mkDerivation {
buildInputs = [ pandoc fontforge woff2 ];
textFont = dejavu_fonts + "/share/fonts/truetype/DejaVuSansMono.ttf";
emojiFont = noto-fonts-emoji.overrideAttrs (orig: {
src = fetchFromGitHub {
owner = "googlefonts";
repo = "noto-emoji";
rev = "55420aed4f62497c6a5976e2fce294f4eff2d9d9";
sha256 = "02fa0pdfzf7qyprmjizy4p7i9b5zjg71zqybl6sn3i0xjj20da3r";
};
installPhase = ''
mkdir -p $out/share/fonts/noto
cp NotoColorEmoji.ttf fonts/NotoEmoji-Regular.ttf $out/share/fonts/noto
cp NotoColorEmoji.ttf fonts/NotoEmoji-Regular.ttf fonts/NotoColorEmoji_WindowsCompatible.ttf $out/share/fonts/noto
'';
}) + "/share/fonts/noto/NotoColorEmoji_WindowsCompatible.ttf";
veraMonoSrc = ttf_bitstream_vera + "/share/fonts/truetype/VeraMono.ttf";
installPhase = ''
cp -r public $out


+ 6
- 1
files/style.css View File

@ -1,5 +1,10 @@
/* layout */
@font-face {
font-family: Bitstream Vera Sans Mono;
src: url("../BitstreamVeraSansMono.subset.woff2");
}
body {
margin: 0;
min-height: 100vh;
@ -7,7 +12,7 @@ body {
flex-direction: column;
background: url("./voyager-dark.webp");
color: rgba(255, 255, 255, .9);
font-family: monospace;
font-family: Bitstream Vera Sans Mono, monospace;
font-size: 17px;
}
main {


+ 16
- 0
make-font.pe View File

@ -0,0 +1,16 @@
Open($1)
// selecton of ASCII glyphs, including a-z, A-Z, 0-9 and basic symbols
SelectMore(0u0020, 0u007e)
SelectMore(0u00e4) // ä
SelectMore(0u00f6) // ö
SelectMore(0u00fc) // ü
SelectMore(0u00c4) // Ä
SelectMore(0u00d6) // Ö
SelectMore(0u00dc) // Ü
SelectMore(0u00df) // ß
SelectInvert()
DetachAndRemoveGlyphs()
Generate($2)

Loading…
Cancel
Save