summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-09-12 00:48:31 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-09-12 00:48:31 -0400
commit1ec9ad1c7937491ed37f01d9c06a15384c1f4e8f (patch)
tree3fb7987c166b7363b41598fe290eb97ad0d69476
parent81c54340201338dd65aff6d4fd4352315f5e7ab0 (diff)
downloadtranslate-1ec9ad1c7937491ed37f01d9c06a15384c1f4e8f.tar.gz
translate-1ec9ad1c7937491ed37f01d9c06a15384c1f4e8f.zip
translate: Update fontstats page to use textual/css headers
-rw-r--r--rockbox.css5
-rw-r--r--whichfont.php39
2 files changed, 25 insertions, 19 deletions
diff --git a/rockbox.css b/rockbox.css
index e691514..ebcd048 100644
--- a/rockbox.css
+++ b/rockbox.css
@@ -28,6 +28,11 @@ TD
padding: 0.3em;
}
+TH
+{
+ background-color: #9ABDDE;
+}
+
td img {
border: thin solid black;
}
diff --git a/whichfont.php b/whichfont.php
index 5e8c625..68569da 100644
--- a/whichfont.php
+++ b/whichfont.php
@@ -30,6 +30,7 @@ mb_internal_encoding("UTF-8");
<title>Font coverage of translations</title>
<link rel="stylesheet" href="rockbox.css" />
<style type="text/css">
+
td {
margin: 0px;
padding: 0px;
@@ -44,6 +45,22 @@ td.lang {
td.full {
background-color: green;
}
+th {
+ margin: 0px;
+ padding: 0px;
+ vertical-align: bottom;
+}
+
+.rotate {
+ writing-mode: vertical-lr;
+ white-space: nowrap;
+ font-weight: normal;
+ text-orientation: sideways-right;
+ transform: rotate(180deg);
+ font-size: 13px;
+ min-width: 1.25em;
+}
+
</style>
</head>
<body>
@@ -56,35 +73,19 @@ coverage. A <span style="color: green">green</span> square indicates full
coverage.</p>
<table>
- <thead>
<tr>
- <td></td>
+ <th></th>
<?php
-function getverticalimg($text) {
- $filename = sprintf('headers/%s.png', str_replace("/", "_", $text));
- if (!file_exists($filename) || filemtime(__FILE__) > filemtime($filename)) {
- $height = 200;
- $width = 11;
- $im = imagecreate($width, $height);
- $bg = imagecolorallocate($im, 0x9A, 0xBD, 0xDE);
- $fg = imagecolorallocate($im, 0, 0, 0);
- imagestringup($im, 2, -1, $height - 2, $text, $fg);
- imagecolortransparent($im, $bg);
- imagepng($im, $filename);
- }
- return sprintf("<img src='%s' />", $filename);
-}
-
$fontstats = parse_ini_file('scratch/fontcoverage.ini', true);
$langs = languageinfo();
/* Output the first row - font names */
if (isset($fontstats['english'])) {
foreach($fontstats['english'] as $font => $coverage) {
- printf(" <td>%s</td>\n", getverticalimg($font));
+ printf(" <th><span class=\"rotate\">%s</span></th>\n", $font);
}
- print(" </tr>\n </thead>\n <tbody>\n");
+ print(" </tr>\n");
}
foreach($fontstats as $lang => $stats) {