Przeglądaj źródła

www: use a subsetted Prisma font

Found a program to produce a subsetted font (pyftsubset, part of
fonttools); use a subsetted Prisma font with only the characters MAX;
this plus the SVG is really quite small.
H. Peter Anvin 2 lat temu
rodzic
commit
4a6356a9ed

BIN
esp32/www/img/Prisma-MAX.woff2


BIN
esp32/www/img/Prisma.woff2


+ 1 - 3
esp32/www/img/max80-trans.svg

@@ -1,8 +1,6 @@
 <?xml version="1.0" standalone="no" ?>
 <svg viewBox="0 0 315 100" xmlns="http://www.w3.org/2000/svg">
-  <style>
-    @font-face { font-family: Prisma; src: url(Prisma.woff2); }
-  </style>
+  <style>@font-face { font-family: Prisma; src: url(Prisma-MAX.woff2); }</style>
   <mask id="mask">
     <g dominant-baseline="middle" text-rendering="geometricPrecision" paint-order="stroke fill" fill="white" stroke="black">
       <text font-family="Prisma" x="164" y="50" font-size="100">X</text>

+ 7 - 1
img/Makefile

@@ -2,7 +2,7 @@ SIZES	= 25 50 100 200
 IMGS	= max80.svg
 REDUCE	= -colors 4
 
-all:
+all:	Prisma-MAX.woff2
 	for f in $(SIZES); do $(MAKE) SIZE=$$f imgs; done
 
 imgs:	$(patsubst %.svg,%-$(SIZE).png,$(IMGS))
@@ -12,8 +12,14 @@ imgs:	$(patsubst %.svg,%-$(SIZE).png,$(IMGS))
 		$(REDUCE) -auto-level \
 		-negate -alpha copy -negate $@
 
+Prisma-MAX.woff2: Prisma.otf
+	pyftsubset $< --output-file=$@ --text='MAX' \
+		--desubroutinize --flavor=woff2 --recalc-bounds
+
+
 clean:
 	for f in $(patsubst %.svg,%,$(IMGS)); do rm -f "$$f"-*.png; done
+	rm -f Prisma-MAX.woff2
 
 spotless: clean
 

BIN
img/max80-100.png


BIN
img/max80-200.png


BIN
img/max80-25.png


BIN
img/max80-50.png


+ 1 - 0
img/max80-trans.svg

@@ -1,5 +1,6 @@
 <?xml version="1.0" standalone="no" ?>
 <svg viewBox="0 0 315 100" xmlns="http://www.w3.org/2000/svg">
+  <style>@font-face { font-family: Prisma; src: url(Prisma-MAX.woff2); }</style>
   <mask id="mask">
     <g dominant-baseline="middle" text-rendering="geometricPrecision" paint-order="stroke fill" fill="white" stroke="black">
       <text font-family="Prisma" x="164" y="50" font-size="100">X</text>

+ 1 - 0
img/max80.svg

@@ -1,5 +1,6 @@
 <?xml version="1.0" standalone="no" ?>
 <svg viewBox="0 0 315 100" xmlns="http://www.w3.org/2000/svg">
+  <style>@font-face { font-family: Prisma; src: url(Prisma-MAX.woff2); }</style>
   <g dominant-baseline="middle" text-rendering="geometricPrecision"
      paint-order="stroke fill" fill="black" stroke="white">
     <text font-family="Prisma" x="164" y="50" font-size="100">X</text>