Fix: replace String with StringHelper in Font

We use StringHelper::countCharacters, not String::countCharacters
This commit is contained in:
Valentin I. Nikolaev 2016-05-19 05:33:22 +03:00
parent 104d8362ec
commit 5e4e6fe3ee
1 changed files with 4 additions and 4 deletions

View File

@ -340,7 +340,7 @@ class Font
switch ($fontName) { switch ($fontName) {
case 'Calibri': case 'Calibri':
// value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font. // value 8.26 was found via interpolation by inspecting real Excel files with Calibri 11 font.
$columnWidth = (int) (8.26 * String::countCharacters($columnText)); $columnWidth = (int) (8.26 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
break; break;
@ -348,19 +348,19 @@ class Font
// value 7 was found via interpolation by inspecting real Excel files with Arial 10 font. // value 7 was found via interpolation by inspecting real Excel files with Arial 10 font.
// $columnWidth = (int) (7 * String::countCharacters($columnText)); // $columnWidth = (int) (7 * String::countCharacters($columnText));
// value 8 was set because of experience in different exports at Arial 10 font. // value 8 was set because of experience in different exports at Arial 10 font.
$columnWidth = (int) (8 * String::countCharacters($columnText)); $columnWidth = (int) (8 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
break; break;
case 'Verdana': case 'Verdana':
// value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font. // value 8 was found via interpolation by inspecting real Excel files with Verdana 10 font.
$columnWidth = (int) (8 * String::countCharacters($columnText)); $columnWidth = (int) (8 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 10; // extrapolate from font size
break; break;
default: default:
// just assume Calibri // just assume Calibri
$columnWidth = (int) (8.26 * String::countCharacters($columnText)); $columnWidth = (int) (8.26 * StringHelper::countCharacters($columnText));
$columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size $columnWidth = $columnWidth * $fontSize / 11; // extrapolate from font size
break; break;
} }