crayon-syntax-highlighter/crayon_fonts.class.php

39 lines
1.3 KiB
PHP
Raw Normal View History

2019-08-30 19:30:19 +02:00
<?php
require_once('global.php');
require_once(CRAYON_RESOURCE_PHP);
2019-08-30 19:30:19 +02:00
/* Manages fonts once they are loaded. */
class CrayonFonts extends CrayonUserResourceCollection
{
// Properties and Constants ===============================================
2019-08-30 19:30:19 +02:00
const DEFAULT_FONT = 'monaco';
const DEFAULT_FONT_NAME = 'Monaco';
2019-08-30 19:30:19 +02:00
// Methods ================================================================
function __construct()
{
$this->set_default(self::DEFAULT_FONT, self::DEFAULT_FONT_NAME);
2019-08-30 19:30:19 +02:00
$this->directory(CRAYON_FONT_PATH);
$this->relative_directory(CRAYON_FONT_DIR);
$this->extension('css');
CrayonLog::debug("Setting font directories");
$upload = CrayonGlobalSettings::upload_path();
if ($upload) {
$this->user_directory($upload . CRAYON_FONT_DIR);
if (!is_dir($this->user_directory())) {
CrayonGlobalSettings::mkdir($this->user_directory());
CrayonLog::debug($this->user_directory(), "FONT USER DIR");
}
} else {
CrayonLog::syslog("Upload directory is empty: " . $upload . " cannot load fonts.");
}
CrayonLog::debug($this->directory());
CrayonLog::debug($this->user_directory());
}
2019-08-30 19:30:19 +02:00
}