소스 검색

! 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. BIN
      Themes/default/fonts/AnonymousPro_end.gdf
  3. BIN
      Themes/default/fonts/ConsolaMono_end.gdf
  4. BIN
      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;

BIN
Themes/default/fonts/AnonymousPro_end.gdf


BIN
Themes/default/fonts/ConsolaMono_end.gdf


BIN
Themes/default/fonts/Pfennig_end.gdf