Index: private/themesite.class.php =================================================================== --- private/themesite.class.php (revision 24534) +++ private/themesite.class.php (working copy) @@ -795,6 +795,14 @@ rmdir($dirname); } + private function isfontpackfont($name) { + $ourfonts = glob(sprintf("%s/*bdf", config::fontdir)); + foreach($ourfonts as &$font) { + $font = basename($font, '.bdf'); + } + return in_array($name, $ourfonts); + } + /* * This rather unwieldy function validates the structure of a theme's * zipfile. It checks the following: @@ -847,6 +855,14 @@ if (strpos($filename, '.rockbox') !== 0) $err[] = sprintf("File outside /.rockbox/: %s", $filename); + /* Check if the font is already included in Rockbox */ + if (strtolower($pathinfo['extension']) == 'fnt') { + if ($this->isfontpackfont($pathinfo['filename'])) { + $err[] = sprintf("This font is included in the Rockbox font pack. Don't include it in your theme: %s", $filename); + } + } + + /* Check that all .wps, .rwps and .cfg filenames use the same shortname */ switch(strtolower($pathinfo['extension'])) { case 'cfg': Index: private/config.inc.php =================================================================== --- private/config.inc.php (revision 24534) +++ private/config.inc.php (working copy) @@ -51,6 +51,9 @@ // Location of 'unzip' const unzip = "/usr/bin/unzip"; + + // Location of the Rockbox source font dir + const fontdir = "/home/themes/rockbox-current/fonts"; //private key for recaptcha const recaptchakey_priv = "6LfwAQsAAAAAAOGeWVtqpSeIFZKP3WcActZeoVk1";