Browse Source

Add support for font previews

tags/v8.1.0alpha1
Olivier Paroz 9 years ago
parent
commit
f49805eea5
3 changed files with 22 additions and 1 deletions
  1. 1
    0
      config/config.sample.php
  2. 2
    1
      lib/private/preview.php
  3. 19
    0
      lib/private/preview/font.php

+ 1
- 0
config/config.sample.php View File

* - OC\Preview\StarOffice * - OC\Preview\StarOffice
* - OC\Preview\SVG * - OC\Preview\SVG
* - OC\Preview\TIFF * - OC\Preview\TIFF
* - OC\Preview\Font
* *
* .. note:: Troubleshooting steps for the MS Word previews are available * .. note:: Troubleshooting steps for the MS Word previews are available
* at the :doc:`collaborative_documents_configuration` section * at the :doc:`collaborative_documents_configuration` section

+ 2
- 1
lib/private/preview.php View File

* - OC\Preview\Illustrator * - OC\Preview\Illustrator
* - OC\Preview\Postscript * - OC\Preview\Postscript
* - OC\Preview\Photoshop * - OC\Preview\Photoshop
* - OC\Preview\Font
*/ */
if(empty(self::$enabledProviders)) { if(empty(self::$enabledProviders)) {
self::$enabledProviders = \OC::$server->getConfig()->getSystemValue('enabledPreviewProviders', array( self::$enabledProviders = \OC::$server->getConfig()->getSystemValue('enabledPreviewProviders', array(
'PDF' => 'OC\Preview\PDF', 'PDF' => 'OC\Preview\PDF',
'AI' => 'OC\Preview\Illustrator', 'AI' => 'OC\Preview\Illustrator',
'PSD' => 'OC\Preview\Photoshop', 'PSD' => 'OC\Preview\Photoshop',
// Requires adding 'eps' => array('application/postscript', null), to lib/private/mimetypes.list.php
'EPS' => 'OC\Preview\Postscript', 'EPS' => 'OC\Preview\Postscript',
'TTF' => 'OC\Preview\Font',
); );


foreach ($imagickProviders as $queryFormat => $provider) { foreach ($imagickProviders as $queryFormat => $provider) {

+ 19
- 0
lib/private/preview/font.php View File

<?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$)/';
}
}

Loading…
Cancel
Save