Procházet zdrojové kódy

! While we still have GDF font files, we should fix one of the known bugs for them, as per Mantis 923. True, ARM servers aren't common (but they're being experimented with more and more), and an ARM server that doesn't have TTF support is also rare... but it's not exactly a hardship to support the inverted endianness.

Signed-off-by: Peter Spicer <[email protected]>
Peter Spicer před 10 roky
rodič
revize
b5e51f2f57

+ 5 - 2
Sources/Subs-Graphics.php

@@ -855,10 +855,14 @@ function showCodeImage($code)
 	$font_dir = dir($settings['default_theme_dir'] . '/fonts');
 	$font_list = array();
 	$ttfont_list = array();
+	$endian = unpack('v', pack('S', 0x00FF)) === 0x00FF;
 	while ($entry = $font_dir->read())
 	{
 		if (preg_match('~^(.+)\.gdf$~', $entry, $matches) === 1)
-			$font_list[] = $entry;
+		{
+			if ($endian ^ (strpos($entry, '_end.gdf') === false))
+				$font_list[] = $entry;
+		}
 		elseif (preg_match('~^(.+)\.ttf$~', $entry, $matches) === 1)
 			$ttfont_list[] = $entry;
 	}
@@ -946,7 +950,6 @@ function showCodeImage($code)
 			// Can we use true type fonts?
 			$can_do_ttf = function_exists('imagettftext');
 
-
 			// How much rotation will we give?
 			if ($rotationType == 'none')
 				$angle = 0;

binární
Themes/default/fonts/AnonymousPro_end.gdf


binární
Themes/default/fonts/ConsolaMono_end.gdf


binární
Themes/default/fonts/Pfennig_end.gdf