VuFind API Documentation

Generator
in package

Dynamic Book Cover Generator

Tags
category

VuFind

author

Chris Hallberg crhallberg@gmail.com

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$defaultSettings  : array<string|int, mixed>
Default settings (values used by setOptions() if not overridden).
$im  : resource
Base for image
$layerManager  : PluginManager
Layer manager
$settings  : object
Active style configuration
$themeTools  : ThemeInfo
ThemeInfo object
__construct()  : mixed
Constructor
generate()  : string
Generates a dynamic cover image from elements of the item
setOptions()  : void
Set the generator options.
destroyImage()  : void
Clear the resources associated with the image in the object.
fontPath()  : string
Find font in the theme folder
getBackgroundLayer()  : LayerInterface
Get the layer plugin for the background
getTextLayer()  : LayerInterface
Get the layer plugin for the text
initImage()  : void
Initialize the image in the object.
renderPng()  : string
Render the contents of the image in the object to a PNG; return as string.

Properties

$defaultSettings

Default settings (values used by setOptions() if not overridden).

protected array<string|int, mixed> $defaultSettings = ['backgroundMode' => 'grid', 'textMode' => 'default', 'authorFont' => 'DroidSerif-Bold.ttf', 'titleFontSize' => 7, 'authorFontSize' => 6, 'lightness' => 220, 'maxTitleLines' => 5, 'minAuthorFontSize' => 5, 'saturation' => 80, 'size' => 84, 'textAlign' => 'center', 'titleFont' => 'DroidSerif-Bold.ttf', 'topPadding' => 19, 'bottomPadding' => 3, 'wrapWidth' => 80, 'titleFillColor' => 'black', 'titleBorderColor' => 'none', 'authorFillColor' => 'white', 'authorBorderColor' => 'black', 'baseColor' => 'white', 'accentColor' => 'random']

$settings

Active style configuration

protected object $settings

Methods

__construct()

Constructor

public __construct(ThemeInfo $themeTools, PluginManager $lm[, array<string|int, mixed> $settings = [] ]) : mixed
Parameters
$themeTools : ThemeInfo

For font loading

$lm : PluginManager

Layer manager

$settings : array<string|int, mixed> = []

Overwrite styles

Return values
mixed

generate()

Generates a dynamic cover image from elements of the item

public generate(string $title, string $author[, string $callnumber = null ]) : string
Parameters
$title : string

Title of the book

$author : string

Author of the book

$callnumber : string = null

Callnumber of the book

Return values
string

contents of image file

setOptions()

Set the generator options.

public setOptions(array<string|int, mixed> $rawSettings) : void
Parameters
$rawSettings : array<string|int, mixed>

Overwrite styles

Return values
void

destroyImage()

Clear the resources associated with the image in the object.

protected destroyImage() : void
Return values
void

fontPath()

Find font in the theme folder

protected fontPath(string $font) : string
Parameters
$font : string

Font_name.ttf

Return values
string

file path

initImage()

Initialize the image in the object.

protected initImage() : void
Return values
void

renderPng()

Render the contents of the image in the object to a PNG; return as string.

protected renderPng() : string
Return values
string

Search results