diff --git a/config/config.sample.php b/config/config.sample.php index 94284e28dd86a5e4f74502cb02be0bf300822543..8d8fed7ad8c509d3aa3cfe60e5528529cde8c196 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -681,6 +681,7 @@ $CONFIG = array( * - OC\Preview\StarOffice * - OC\Preview\SVG * - OC\Preview\TIFF + * - OC\Preview\Font * * .. note:: Troubleshooting steps for the MS Word previews are available * at the :doc:`../configuration_files/collaborative_documents_configuration` diff --git a/lib/private/preview.php b/lib/private/preview.php index f45cc0858c7c18a8bf92c944f29df2b3c73b9dc7..6af1586293fc2dee806a3b772abd68b03a87a751 100644 --- a/lib/private/preview.php +++ b/lib/private/preview.php @@ -713,6 +713,7 @@ class Preview { * - OC\Preview\Illustrator * - OC\Preview\Postscript * - OC\Preview\Photoshop + * - OC\Preview\Font */ if(empty(self::$enabledProviders)) { self::$enabledProviders = \OC::$server->getConfig()->getSystemValue('enabledPreviewProviders', array( @@ -772,8 +773,8 @@ class Preview { 'PDF' => 'OC\Preview\PDF', 'AI' => 'OC\Preview\Illustrator', 'PSD' => 'OC\Preview\Photoshop', - // Requires adding 'eps' => array('application/postscript', null), to lib/private/mimetypes.list.php 'EPS' => 'OC\Preview\Postscript', + 'TTF' => 'OC\Preview\Font', ); foreach ($imagickProviders as $queryFormat => $provider) { diff --git a/lib/private/preview/font.php b/lib/private/preview/font.php new file mode 100644 index 0000000000000000000000000000000000000000..58d64e8264d16023a5c02a51d1679000a63826a0 --- /dev/null +++ b/lib/private/preview/font.php @@ -0,0 +1,19 @@ +<?php +/** + * @copyright Olivier Paroz 2015 <owncloud@interfasys.ch> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Preview; + +// .otf, .ttf and .pfb +class Font extends Bitmap { + /** + * {@inheritDoc} + */ + public function getMimeType() { + return '/application\/(?:font-sfnt|x-font$)/'; + } +} \ No newline at end of file