blob: 68569da861a388802c7673a18a7a0a20ae4bd662 [file] [log] [blame]
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +00001<?php
Solomon Peachya0eef362020-04-02 10:05:23 -04002/************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * Copyright (C) 2010 Jonas Häggqvist
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
15 *
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
18 *
19 **************************************************************************/
20
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000021header("Content-type: text/html; charset=UTF-8");
22require_once('common.php');
23/* Set internal character encoding to UTF-8 */
24mb_internal_encoding("UTF-8");
25?>
26<!DOCTYPE html>
27<html>
28<head>
29<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
30<title>Font coverage of translations</title>
31<link rel="stylesheet" href="rockbox.css" />
32<style type="text/css">
Solomon Peachy1ec9ad12020-09-12 00:48:31 -040033
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000034td {
35 margin: 0px;
36 padding: 0px;
37 vertical-align: middle;
38}
39td img {
40 border: 0px solid black;
41}
42td.lang {
43 white-space: nowrap;
44}
45td.full {
46 background-color: green;
47}
Solomon Peachy1ec9ad12020-09-12 00:48:31 -040048th {
49 margin: 0px;
50 padding: 0px;
51 vertical-align: bottom;
52}
53
54.rotate {
55 writing-mode: vertical-lr;
56 white-space: nowrap;
57 font-weight: normal;
58 text-orientation: sideways-right;
59 transform: rotate(180deg);
60 font-size: 13px;
61 min-width: 1.25em;
62}
63
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000064</style>
65</head>
66<body>
67
68<h1>Language coverage of fonts</h1>
69
70<p>This page lists fonts included with Rockbox and tries to visualise their
71coverage of the included translations. The darker the square, the better
72coverage. A <span style="color: green">green</span> square indicates full
73coverage.</p>
74
75<table>
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000076 <tr>
Solomon Peachy1ec9ad12020-09-12 00:48:31 -040077 <th></th>
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000078<?php
79
Solomon Peachy817a3362020-07-27 13:27:53 -040080$fontstats = parse_ini_file('scratch/fontcoverage.ini', true);
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000081$langs = languageinfo();
82
83/* Output the first row - font names */
Frank Gevaertsf6a9d682012-04-04 21:26:38 +020084if (isset($fontstats['english'])) {
85 foreach($fontstats['english'] as $font => $coverage) {
Solomon Peachy1ec9ad12020-09-12 00:48:31 -040086 printf(" <th><span class=\"rotate\">%s</span></th>\n", $font);
Frank Gevaertsf6a9d682012-04-04 21:26:38 +020087 }
Solomon Peachy1ec9ad12020-09-12 00:48:31 -040088 print(" </tr>\n");
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000089}
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +000090
91foreach($fontstats as $lang => $stats) {
92 printf(" <tr>\n <td class='lang'><img src='flags/%d/%s.png' /> %s</td>\n",SMALL_FLAGSIZE, urlencode($langs[$lang]['flag']), $langs[$lang]['name']);
93 foreach($stats as $font => $coverage) {
94 if ($coverage == 1) {
95 printf(" <td class='full' title='%s has full coverage of %s'>&nbsp;</td>\n", $font, $lang);
96 }
97 else {
98 $r = 0x9A * (1-$coverage);
99 $g = 0xBD * (1-$coverage);
100 $b = 0xDE * (1-$coverage);
101 printf(" <td style='background-color: #%02X%02X%02X' title='%s has %0.2f%% coverage of %s'>&nbsp;</td>", $r, $g, $b, $font, $coverage*100, $lang);
Solomon Peachya0eef362020-04-02 10:05:23 -0400102 }
Jonas Häggqvist45f3dfb2011-04-18 21:32:14 +0000103 }
104 print(" </tr>\n");
105}
106?>
107</tbody>
108</table>
109</body>
110</html>