font: css rule to download font
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 19 Apr 2015 19:32:07 +0000 (21:32 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 9 Jun 2015 03:43:44 +0000 (05:43 +0200)
Ensure correct display even if client does not have local install.

font.plp

index 547b297..af7743b 100644 (file)
--- a/font.plp
+++ b/font.plp
@@ -69,6 +69,10 @@ if (my $font = $ENV{PATH_INFO} =~ s{^/}{}r) {
        .glyphs tbody th[!colspan] { text-align: right }
        .glyphs tbody td { font-family: "$fontmeta->{name}" }
        .glyphs tbody td:nth-child(18) { border-left-width: 2px }
+       \@font-face {
+               font-family: "$fontmeta->{name}";
+               src: url(/data/font/$font.ttf);
+       }
 </style>
 EOT
        say '<table class="glyphs big">';