Merge pull request #900 from ValentinNikolaev/patch-2
Fix: replace String with StringHelper in Font
This commit is contained in:
		
						commit
						14c9fac305
					
				| @ -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; | ||||||
|         } |         } | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Progi1984
						Progi1984