浏览代码

! 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
共有 4 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      Sources/Subs-Graphics.php
  2. 二进制
      Themes/default/fonts/AnonymousPro_end.gdf
  3. 二进制
      Themes/default/fonts/ConsolaMono_end.gdf
  4. 二进制
      Themes/default/fonts/Pfennig_end.gdf

+ 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;

二进制
Themes/default/fonts/AnonymousPro_end.gdf


二进制
Themes/default/fonts/ConsolaMono_end.gdf


二进制
Themes/default/fonts/Pfennig_end.gdf