1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-09 16:32:39 +01:00

Impact Font Used If Available

Summary: Fixed T2395

Test Plan: When impact.ttf was added to resources/font, it was being used. When renamed, tuffy was.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Maniphest Tasks: T2395

Differential Revision: https://secure.phabricator.com/D4700
This commit is contained in:
Debarghya Das 2013-02-01 08:19:33 -08:00 committed by epriestley
parent 1c64b40a22
commit f4971b0858
2 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View file

@ -24,3 +24,6 @@
/conf/local/local.json
/conf/local/ENVIRONMENT
/conf/local/VERSION
# Impact Font
/resources/font/impact.ttf

View file

@ -175,7 +175,11 @@ final class PhabricatorImageTransformer {
$data = $file->loadFileData();
$img = imagecreatefromstring($data);
$phabricator_root = dirname(phutil_get_library_root('phabricator'));
$font_path = $phabricator_root.'/resources/font/tuffy.ttf';
$font_root = $phabricator_root.'/resources/font/';
$font_path = $font_root.'tuffy.ttf';
if (Filesystem::pathExists($font_root.'impact.ttf')) {
$font_path = $font_root.'impact.ttf';
}
$white = imagecolorallocate($img, 255, 255, 255);
$black = imagecolorallocate($img, 0, 0, 0);
$border_width = 3;