Преглед изворни кода

! 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 пре 10 година
родитељ
комит
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
Themes/default/fonts/AnonymousPro_end.gdf


BIN
Themes/default/fonts/ConsolaMono_end.gdf


BIN
Themes/default/fonts/Pfennig_end.gdf