chiark / gitweb /
Add an icon to the Web page
authorBen Harris <bjh21@bjh21.me.uk>
Sat, 13 Jul 2024 15:54:09 +0000 (16:54 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Fri, 16 Aug 2024 23:11:11 +0000 (00:11 +0100)
I generate various sizes because the 16-pixel version looks better than
the scaled-down larger versions.

Makefile
icon.ps [new file with mode: 0644]
index.xhtml

index 71a7b8fe86409b38238657ade0dcca238fb738df..6ba581b876d6f2c9591d0df35993e402e6f749b2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ DISTFILES = bedstead.c Makefile CONTRIBUTING COPYING NEWS df.ps rom.ps \
 all: $(DISTFILES)
 
 .PHONY: all-web
-all-web: all sample.png extended.png
+all-web: all sample.png extended.png icon.png
 
 .PHONY: experimental
 experimental: bedstead-chiseltip.otf bedstead-plotter-thin.otf \
@@ -85,6 +85,9 @@ bedstead-chiseltip.sfd: strokefont.py bedstead-oc.sfd
 %.png: %.ps $(OTFFILES) Fontmap
        gs -P -q -dSAFER -sDEVICE=png16m -dTextAlphaBits=4 -o $@ $<
 
+icon-%.png: icon.ps bedstead-extended.otf Fontmap
+       gs -P -q -dSAFER -dsize=$* -sDEVICE=png16m -dTextAlphaBits=4 -o $@ $<
+
 bedstead-%-df.png: df.ps bedstead.otf Fontmap
        gs -P -q -dSAFER -dsize=$* -sDEVICE=png16m -o $@ $<
 
diff --git a/icon.ps b/icon.ps
new file mode 100644 (file)
index 0000000..69f53df
--- /dev/null
+++ b/icon.ps
@@ -0,0 +1,11 @@
+%!
+/bpy { size 8 div mul } bind def
+/bpx { bpy 1.25 mul } bind def
+<< /HWResolution [ 72 72 ] /PageSize [ size size ] >> setpagedevice
+3 255 div 17 255 div 9 255 div setrgbcolor 0 0 size size rectfill
+51 255 div 255 255 div 136 255 div setrgbcolor
+/Bedstead-Extended findfont 10 bpy scalefont setfont
+size 5 bpx sub 2 div 1 bpx sub
+size 7 bpy sub 2 div
+moveto (B) show
+showpage
index e5b4bb9ebeb97d2cda6bcfed4040a2c684d7116c..e5496b7f47625ee2a5dc77731b4796778531a1b4 100644 (file)
@@ -7,6 +7,9 @@
          content="application/xhtml+xml;charset=UTF-8" />
     <title>Bedstead &ndash; MODE 7 for the 21st century</title>
     <link rel="stylesheet" href="bedstead.css" type="text/css" />
+    <link rel="icon" href="icon-16.png" type="image/png" sizes="16x16" />
+    <link rel="icon" href="icon-32.png" type="image/png" sizes="32x32" />
+    <link rel="icon" href="icon-64.png" type="image/png" sizes="64x64" />
   </head>
   <body>
     <h1><div class="fade">Bedstead</div></h1>