[TASK] Drop support and tests for FreeType 1 53/36153/6
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 21 Jan 2015 08:43:40 +0000 (09:43 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Fri, 30 Jan 2015 19:01:45 +0000 (20:01 +0100)
We've been using FreeType 2 for quite some time.
FreeType 1 is history meanwhile.

Change-Id: I45add19b77c9168bc00def15295ed85f4a7353e9
Resolves: #48542
Releases: master
Reviewed-on: http://review.typo3.org/36153
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
INSTALL.md
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Configuration/DefaultConfiguration.php
typo3/sysext/install/Classes/Controller/Action/Tool/TestSetup.php
typo3/sysext/install/Classes/Service/SilentConfigurationUpgradeService.php
typo3/sysext/install/Classes/SystemEnvironment/Check.php
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFont.html [new file with mode: 0644]
typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFontDpi.html [deleted file]
typo3/sysext/install/Resources/Private/Templates/Action/Tool/TestSetup.html
typo3/sysext/install/Resources/Private/Templates/Action/Tool/Welcome.html

index b77a05c..a3e7d96 100644 (file)
@@ -104,7 +104,7 @@ functionality:
   * apc caching (with at least 100 MB of memory available)
   * curl
   * mbstring
-  * FreeType (usually included within the PHP distribution)
+  * FreeType (usually included within the PHP distribution)
   * bcmath or gmp (needed if you'd like to use the openid system extension)
 
 * PHP access to /dev/urandom or /dev/random on Unix-like platforms for
index b6901fa..cef1a2b 100755 (executable)
@@ -4876,17 +4876,16 @@ Connection: close
        }
 
        /**
-        * Function to compensate for FreeType2 96 dpi
+        * Function to compensate for DPI resolution.
         *
-        * @param int $font_size Fontsize for freetype function call
-        * @return int Compensated fontsize based on $GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi']
+        * @param float $fontSize font size for freetype function call
+        *
+        * @return float compensated font size based on 96 dpi
         */
-       static public function freetypeDpiComp($font_size) {
-               $dpi = (int)$GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi'];
-               if ($dpi != 72) {
-                       $font_size = $font_size / $dpi * 72;
-               }
-               return $font_size;
+       static public function freetypeDpiComp($fontSize) {
+               // FreeType 2 always has 96 dpi.
+               $dpi = 96.0;
+               return $fontSize / $dpi * 72;
        }
 
        /**
index cdd0e89..739b2bb 100644 (file)
@@ -39,7 +39,6 @@ return array(
                'im_stripProfileCommand' => '+profile \'*\'',   // String: Specify the command to strip the profile information, which can reduce thumbnail size up to 60KB. Command can differ in IM/GM, IM also know the -strip command. See <a href="http://www.imagemagick.org/Usage/thumbnails/#profiles" target="_blank">imagemagick.org</a> for details
                'im_useStripProfileByDefault' => TRUE,                  // Boolean: If set, the im_stripProfileCommand is used with all IM Image operations by default. See tsRef for setting this parameter explocit for IMAGE generation.
                'jpg_quality' => 70,                                                    // Integer: Default JPEG generation quality
-               'TTFdpi' => 96,                                                                 // Integer: Enter how many dpi the FreeType module uses. Freetype1 should be set to 72. Freetype2 should be set to 96 (otherwise fonts are rendered way bigger than FreeType1). This works as a global scaling factor for Freetype.
                'png_truecolor' => TRUE,
                'colorspace' => 'RGB',                                                  // String: Specifiy the colorspace to use. Some ImageMagick versions (like 6.7.0 and above) use the sRGB colorspace, so all images are darker then the original. <br />Possible Values: CMY, CMYK, Gray, HCL, HSB, HSL, HWB, Lab, LCH, LMS, Log, Luv, OHTA, Rec601Luma, Rec601YCbCr, Rec709Luma, Rec709YCbCr, RGB, sRGB, Transparent, XYZ, YCbCr, YCC, YIQ, YCbCr, YUV
        ),
index 237effb..dec304e 100644 (file)
@@ -40,9 +40,9 @@ class TestSetup extends Action\AbstractAction {
                        $actionMessages[] = $this->sendTestMail();
                }
 
-               if (isset($this->postValues['set']['testTrueTypeFontDpi'])) {
-                       $this->view->assign('trueTypeFontDpiTested', TRUE);
-                       $actionMessages[] = $this->createTrueTypeFontDpiTestImage();
+               if (isset($this->postValues['set']['testTrueTypeFont'])) {
+                       $this->view->assign('trueTypeFontTested', TRUE);
+                       $actionMessages[] = $this->createTrueTypeFontTestImage();
                }
 
                if (isset($this->postValues['set']['testConvertImageFormatsToJpg'])) {
@@ -170,7 +170,7 @@ class TestSetup extends Action\AbstractAction {
         *
         * @return \TYPO3\CMS\Install\Status\StatusInterface
         */
-       protected function createTrueTypeFontDpiTestImage() {
+       protected function createTrueTypeFontTestImage() {
                $parseTimeStart = GeneralUtility::milliseconds();
 
                $image = @imagecreate(200, 50);
@@ -186,14 +186,14 @@ class TestSetup extends Action\AbstractAction {
                        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('install') . 'Resources/Private/Font/vera.ttf',
                        'Testing true type'
                );
-               $outputFile = PATH_site . 'typo3temp/installTool-' . uniqid('createTrueTypeFontDpiTestImage', TRUE) . '.gif';
+               $outputFile = PATH_site . 'typo3temp/installTool-' . uniqid('createTrueTypeFontTestImage', TRUE) . '.gif';
                imagegif($image, $outputFile);
 
                /** @var \TYPO3\CMS\Install\Status\StatusInterface $message */
                $message = $this->objectManager->get(\TYPO3\CMS\Install\Status\InfoStatus::class);
-               $message->setTitle('True type font DPI settings');
+               $message->setTitle('True type font');
                $message->setMessage(
-                       'If the two images below do not look the same, set $TYPO3_CONF_VARS[GFX][TTFdpi] to a value of 72.'
+                       'If the two images below do not look the same, please check your FreeType 2 module.'
                );
 
                $testResults = array();
@@ -626,7 +626,6 @@ class TestSetup extends Action\AbstractAction {
                $result['imageMagick5Effects'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_v5effects'];
                $result['gdlibEnabled'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib'];
                $result['gdlibPng'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['gdlib_png'];
-               $result['freeTypeDpi'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['TTFdpi'];
                $result['fileFormats'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'];
                return $result;
        }
index 5d7221d..5778577 100644 (file)
@@ -73,7 +73,9 @@ class SilentConfigurationUpgradeService {
                // #24900
                'SYS/compat_version',
                // #64643
-               'GFX/enable_typo3temp_db_tracking'
+               'GFX/enable_typo3temp_db_tracking',
+               // #48542
+               'GFX/TTFdpi',
        );
 
        /**
index 1d6897e..db69ac5 100644 (file)
@@ -115,7 +115,7 @@ class Check {
                $statusArray[] = $this->checkGdLibFreeTypeSupport();
                $statusArray[] = $this->checkRegisterGlobals();
                $statusArray[] = $this->checkLibXmlBug();
-               $statusArray[] = $this->isTrueTypeFontDpiStandard();
+               $statusArray[] = $this->isTrueTypeFontWorking();
                return $statusArray;
        }
 
@@ -1229,9 +1229,9 @@ class Check {
         *
         * @return Status\StatusInterface
         */
-       protected function isTrueTypeFontDpiStandard() {
+       protected function isTrueTypeFontWorking() {
                if (function_exists('imageftbbox')) {
-                       // 20 Pixels at 96 DPI - the DefaultConfiguration
+                       // 20 Pixels at 96 DPI
                        $fontSize = (20 / 96 * 72);
                        $textDimensions = @imageftbbox(
                                $fontSize,
@@ -1252,7 +1252,7 @@ class Check {
                                $status->setTitle('FreeType True Type Font DPI');
                                $status->setMessage('Fonts are rendered by FreeType library. ' .
                                        'This server does not render fonts as expected. ' .
-                                       'Please configure FreeType or TYPO3_CONF_VARS[GFX][TTFdpi]'
+                                       'Please check your FreeType 2 module.'
                                );
                        }
                } else {
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFont.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFont.html
new file mode 100644 (file)
index 0000000..11aa17a
--- /dev/null
@@ -0,0 +1,10 @@
+<form method="post">
+       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
+       <h4>True type font settings</h4>
+       <f:if condition="{trueTypeFontTested}">
+               <f:for each="{testResults}" as="test">
+                       <f:render partial="Action/Tool/TestSetup/DisplayTwinImage" arguments="{_all}"/>
+               </f:for>
+       </f:if>
+       <f:render partial="Action/Common/SubmitButton" arguments="{name:'testTrueTypeFont', text:'Test true type font'}"/>
+</form>
\ No newline at end of file
diff --git a/typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFontDpi.html b/typo3/sysext/install/Resources/Private/Partials/Action/Tool/TestSetup/TrueTypeFontDpi.html
deleted file mode 100644 (file)
index 9f9bb75..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<form method="post">
-       <f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
-       <h4>True type font dpi settings</h4>
-       <f:if condition="{trueTypeFontDpiTested}">
-               <f:for each="{testResults}" as="test">
-                       <f:render partial="Action/Tool/TestSetup/DisplayTwinImage" arguments="{_all}"/>
-               </f:for>
-       </f:if>
-       <f:render partial="Action/Common/SubmitButton" arguments="{name:'testTrueTypeFontDpi', text:'Test true type font dpi'}"/>
-</form>
\ No newline at end of file
index 2f62fd7..5118dac 100644 (file)
@@ -12,7 +12,7 @@
        <f:render partial="Action/Tool/TestSetup/Mail" arguments="{_all}" />
        <hr />
 
-       <f:render partial="Action/Tool/TestSetup/TrueTypeFontDpi" arguments="{_all}" />
+       <f:render partial="Action/Tool/TestSetup/TrueTypeFont" arguments="{_all}" />
        <hr />
 
        <f:render partial="Action/Tool/TestSetup/ConvertImageFormatsToJpg" arguments="{_all}" />
index 3ee395c..c967941 100644 (file)
                This gives you a set of tests for your TYPO3 CMS installation in order to test system settings:
                <ul>
                        <li>Mail setup</li>
-                       <li>True type font dpi settings</li>
+                       <li>True type font settings</li>
                        <li>Convert image formats to jpg</li>
                        <li>Writing gif and png</li>
                        <li>Scaling images</li>