diff --git a/config/vufind/config.ini b/config/vufind/config.ini index 97be2a9a8d94031d8dcbdcf3e9331ce01ee450da..c23260d7a5becc694f8ebc45dbb01b5e4c52ab84 100644 --- a/config/vufind/config.ini +++ b/config/vufind/config.ini @@ -676,12 +676,14 @@ authors = Wikipedia ; everything by doing the following: break the title into lines, and if the title ; is too long (more than maxTitleLines lines), it will display ellipses at the last ; line. -; All text will be drawn at fontSize using the specified textAlign alignment value, -; except that author names will be reduced to the minAuthorFontSize option if -; needed, and if that doesn't make it fit, text will be aligned left and truncated. +; All text will be drawn using the specified textAlign alignment value using the +; relevant titleFontSize or authorFontSize setting, except that author names will +; be reduced to the minAuthorFontSize option if needed, and if that doesn't make +; it fit, text will be aligned left and truncated. ;textAlign = center -;fontSize = 9 -;minAuthorFontSize = 8 +;titleFontSize = 9 +;authorFontSize = 8 +;minAuthorFontSize = 7 ;maxTitleLines = 4 ; All color options support the same basic set of values: diff --git a/module/VuFind/src/VuFind/Cover/Generator.php b/module/VuFind/src/VuFind/Cover/Generator.php index b0012c402616048197988663f6d0e9edc65c9d5b..0dd2d293dfe421020a1c2c321ffa46dbaf24222c 100644 --- a/module/VuFind/src/VuFind/Cover/Generator.php +++ b/module/VuFind/src/VuFind/Cover/Generator.php @@ -113,7 +113,8 @@ class Generator $default = [ 'mode' => 'grid', 'authorFont' => 'DroidSerif-Bold.ttf', - 'fontSize' => 7, + 'titleFontSize' => 7, + 'authorFontSize' => 6, 'lightness' => 220, 'maxTitleLines' => 5, 'minAuthorFontSize' => 5, @@ -431,7 +432,7 @@ class Generator $textWidth = $this->textWidth( rtrim($line, ' '), $this->settings->titleFont, - $this->settings->fontSize + $this->settings->titleFontSize ); if ($textWidth > $this->settings->wrapWidth) { // Print black with white border @@ -439,7 +440,7 @@ class Generator rtrim($pline, ' '), $this->settings->topPadding + $lineHeight * $lineCount, $this->settings->titleFont, - $this->settings->fontSize, + $this->settings->titleFontSize, $this->titleFillColor, $this->titleBorderColor ); @@ -453,7 +454,7 @@ class Generator rtrim($line, ' '), $this->settings->topPadding + $lineHeight * $lineCount, $this->settings->titleFont, - $this->settings->fontSize, + $this->settings->titleFontSize, $this->titleFillColor, $this->titleBorderColor ); @@ -464,7 +465,7 @@ class Generator $this->settings->topPadding + $this->settings->maxTitleLines * $lineHeight, $this->settings->titleFont, - $this->settings->fontSize + 1, + $this->settings->titleFontSize + 1, $this->titleFillColor, $this->titleBorderColor ); @@ -481,7 +482,7 @@ class Generator protected function drawAuthor($author) { // Scale author to fit by incrementing fontsizes down - $fontSize = $this->settings->fontSize; + $fontSize = $this->settings->authorFontSize + 1; do { $fontSize--; $textWidth = $this->textWidth(