Support WOFF files in Celerity and add Source Sans Pro
Summary:
- Allow Celerity to map and serve WOFF files.
- Add Source Sans Pro, Source Sans Pro Bold, and the corresponding LICENSE.
- Add a `font-source-sans-pro` resource for the font.
Test Plan:
- Changed body `font-face` to `'Source Sans Pro'`.
- Added `require_celerity_resource('font-source-sans-pro')` in StandardPageView.
Works in Firefox/Chrome/Safari, at least:
{F123296}
{F123297}
{F123298}
Reviewers: btrahan, chad
Reviewed By: chad
CC: chad, aran
Differential Revision: https://secure.phabricator.com/D8430
This commit is contained in:
@@ -38,6 +38,7 @@ final class DivinerBookController extends DivinerController {
|
||||
|
||||
$document = new PHUIDocumentView();
|
||||
$document->setHeader($header);
|
||||
$document->setFontKit(PHUIDocumentView::FONT_SOURCE_SANS);
|
||||
|
||||
$properties = $this->buildPropertyList($book);
|
||||
|
||||
@@ -68,7 +69,19 @@ final class DivinerBookController extends DivinerController {
|
||||
$section->addContent($this->renderAtomList($atoms));
|
||||
$out[] = $section;
|
||||
}
|
||||
|
||||
$preface = $book->getPreface();
|
||||
$preface_view = null;
|
||||
if (strlen($preface)) {
|
||||
$preface_view =
|
||||
PhabricatorMarkupEngine::renderOneObject(
|
||||
id(new PhabricatorMarkupOneOff())->setContent($preface),
|
||||
'default',
|
||||
$viewer);
|
||||
}
|
||||
|
||||
$document->appendChild($properties);
|
||||
$document->appendChild($preface_view);
|
||||
$document->appendChild($out);
|
||||
|
||||
return $this->buildApplicationPage(
|
||||
@@ -79,6 +92,7 @@ final class DivinerBookController extends DivinerController {
|
||||
array(
|
||||
'title' => $book->getTitle(),
|
||||
'device' => true,
|
||||
'fonts' => true,
|
||||
));
|
||||
}
|
||||
|
||||
@@ -95,15 +109,6 @@ final class DivinerBookController extends DivinerController {
|
||||
pht('Updated'),
|
||||
phabricator_datetime($book->getDateModified(), $viewer));
|
||||
|
||||
$preface = $book->getPreface();
|
||||
if (strlen($preface)) {
|
||||
$view->addTextContent(
|
||||
PhabricatorMarkupEngine::renderOneObject(
|
||||
id(new PhabricatorMarkupOneOff())->setContent($preface),
|
||||
'default',
|
||||
$viewer));
|
||||
}
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user