ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
|
Static Public Member Functions | |
static static | setAutoSizeMethod ($pValue) |
Set autoSize method. More... | |
static | getAutoSizeMethod () |
Get autoSize method. More... | |
static | setTrueTypeFontPath ($pValue) |
Set the path to the folder containing .ttf files. More... | |
static | getTrueTypeFontPath () |
Get the path to the folder containing .ttf files. More... | |
static | calculateColumnWidth (\PhpOffice\PhpSpreadsheet\Style\Font $font, $cellText='', $rotation=0, ?\PhpOffice\PhpSpreadsheet\Style\Font $defaultFont=null) |
Calculate an (approximate) OpenXML column width, based on font size and text contained. More... | |
static | getTextWidthPixelsExact (string $text, \PhpOffice\PhpSpreadsheet\Style\Font $font, int $rotation=0) |
Get GD text width in pixels for a string of text in a certain font at a certain rotation angle. More... | |
static | getTextWidthPixelsApprox ($columnText, \PhpOffice\PhpSpreadsheet\Style\Font $font, $rotation=0) |
Get approximate width in pixels for a string of text in a certain font at a certain rotation angle. More... | |
static | fontSizeToPixels ($fontSizeInPoints) |
Calculate an (approximate) pixel size, based on a font points size. More... | |
static | inchSizeToPixels ($sizeInInch) |
Calculate an (approximate) pixel size, based on inch size. More... | |
static | centimeterSizeToPixels ($sizeInCm) |
Calculate an (approximate) pixel size, based on centimeter size. More... | |
static | getTrueTypeFontFileFromFont ($font) |
Returns the font path given the font. More... | |
static | getCharsetFromFontName ($name) |
Returns the associated charset for the font name. More... | |
static | getDefaultColumnWidthByFont (\PhpOffice\PhpSpreadsheet\Style\Font $font, $pPixels=false) |
Get the effective column width for columns without a column dimension or column with width -1 For example, for Calibri 11 this is 9.140625 (64 px). More... | |
static | getDefaultRowHeightByFont (\PhpOffice\PhpSpreadsheet\Style\Font $font) |
Get the effective row height for rows without a row dimension or rows with height -1 For example, for Calibri 11 this is 15 points. More... | |
Data Fields | |
const | AUTOSIZE_METHOD_APPROX = 'approx' |
const | AUTOSIZE_METHOD_EXACT = 'exact' |
const | CHARSET_ANSI_LATIN = 0x00 |
Character set codes used by BIFF5-8 in Font records. More... | |
const | CHARSET_SYSTEM_DEFAULT = 0x01 |
const | CHARSET_SYMBOL = 0x02 |
const | CHARSET_APPLE_ROMAN = 0x4D |
const | CHARSET_ANSI_JAPANESE_SHIFTJIS = 0x80 |
const | CHARSET_ANSI_KOREAN_HANGUL = 0x81 |
const | CHARSET_ANSI_KOREAN_JOHAB = 0x82 |
const | CHARSET_ANSI_CHINESE_SIMIPLIFIED = 0x86 |
const | CHARSET_ANSI_CHINESE_TRADITIONAL = 0x88 |
const | CHARSET_ANSI_GREEK = 0xA1 |
const | CHARSET_ANSI_TURKISH = 0xA2 |
const | CHARSET_ANSI_VIETNAMESE = 0xA3 |
const | CHARSET_ANSI_HEBREW = 0xB1 |
const | CHARSET_ANSI_ARABIC = 0xB2 |
const | CHARSET_ANSI_BALTIC = 0xBA |
const | CHARSET_ANSI_CYRILLIC = 0xCC |
const | CHARSET_ANSI_THAI = 0xDD |
const | CHARSET_ANSI_LATIN_II = 0xEE |
const | CHARSET_OEM_LATIN_I = 0xFF |
const | ARIAL = 'arial.ttf' |
Font filenames. More... | |
const | ARIAL_BOLD = 'arialbd.ttf' |
const | ARIAL_ITALIC = 'ariali.ttf' |
const | ARIAL_BOLD_ITALIC = 'arialbi.ttf' |
const | CALIBRI = 'CALIBRI.TTF' |
const | CALIBRI_BOLD = 'CALIBRIB.TTF' |
const | CALIBRI_ITALIC = 'CALIBRII.TTF' |
const | CALIBRI_BOLD_ITALIC = 'CALIBRIZ.TTF' |
const | COMIC_SANS_MS = 'comic.ttf' |
const | COMIC_SANS_MS_BOLD = 'comicbd.ttf' |
const | COURIER_NEW = 'cour.ttf' |
const | COURIER_NEW_BOLD = 'courbd.ttf' |
const | COURIER_NEW_ITALIC = 'couri.ttf' |
const | COURIER_NEW_BOLD_ITALIC = 'courbi.ttf' |
const | GEORGIA = 'georgia.ttf' |
const | GEORGIA_BOLD = 'georgiab.ttf' |
const | GEORGIA_ITALIC = 'georgiai.ttf' |
const | GEORGIA_BOLD_ITALIC = 'georgiaz.ttf' |
const | IMPACT = 'impact.ttf' |
const | LIBERATION_SANS = 'LiberationSans-Regular.ttf' |
const | LIBERATION_SANS_BOLD = 'LiberationSans-Bold.ttf' |
const | LIBERATION_SANS_ITALIC = 'LiberationSans-Italic.ttf' |
const | LIBERATION_SANS_BOLD_ITALIC = 'LiberationSans-BoldItalic.ttf' |
const | LUCIDA_CONSOLE = 'lucon.ttf' |
const | LUCIDA_SANS_UNICODE = 'l_10646.ttf' |
const | MICROSOFT_SANS_SERIF = 'micross.ttf' |
const | PALATINO_LINOTYPE = 'pala.ttf' |
const | PALATINO_LINOTYPE_BOLD = 'palab.ttf' |
const | PALATINO_LINOTYPE_ITALIC = 'palai.ttf' |
const | PALATINO_LINOTYPE_BOLD_ITALIC = 'palabi.ttf' |
const | SYMBOL = 'symbol.ttf' |
const | TAHOMA = 'tahoma.ttf' |
const | TAHOMA_BOLD = 'tahomabd.ttf' |
const | TIMES_NEW_ROMAN = 'times.ttf' |
const | TIMES_NEW_ROMAN_BOLD = 'timesbd.ttf' |
const | TIMES_NEW_ROMAN_ITALIC = 'timesi.ttf' |
const | TIMES_NEW_ROMAN_BOLD_ITALIC = 'timesbi.ttf' |
const | TREBUCHET_MS = 'trebuc.ttf' |
const | TREBUCHET_MS_BOLD = 'trebucbd.ttf' |
const | TREBUCHET_MS_ITALIC = 'trebucit.ttf' |
const | TREBUCHET_MS_BOLD_ITALIC = 'trebucbi.ttf' |
const | VERDANA = 'verdana.ttf' |
const | VERDANA_BOLD = 'verdanab.ttf' |
const | VERDANA_ITALIC = 'verdanai.ttf' |
const | VERDANA_BOLD_ITALIC = 'verdanaz.ttf' |
Static Public Attributes | |
static | $defaultColumnWidths |
Static Private Attributes | |
static | $autoSizeMethods |
static | $autoSizeMethod = self::AUTOSIZE_METHOD_APPROX |
static | $trueTypeFontPath = null |
|
static |
Calculate an (approximate) OpenXML column width, based on font size and text contained.
\PhpOffice\PhpSpreadsheet\Style\Font | $font | Font object |
RichText | string | $cellText | Text to calculate width |
int | $rotation | Rotation angle |
null | \PhpOffice\PhpSpreadsheet\Style\Font | $defaultFont | Font object |
Definition at line 227 of file Font.php.
References PhpOffice\PhpSpreadsheet\Shared\Drawing\pixelsToCellDimension().
Referenced by PhpOffice\PhpSpreadsheet\Worksheet\Worksheet\calculateColumnWidths().
|
static |
Calculate an (approximate) pixel size, based on centimeter size.
int | $sizeInCm | Font size (in centimeters) |
Definition at line 386 of file Font.php.
Referenced by PhpOffice\PhpSpreadsheet\Reader\Xlsx\toCSSArray().
|
static |
Calculate an (approximate) pixel size, based on a font points size.
int | $fontSizeInPoints | Font size (in points) |
Definition at line 362 of file Font.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Xls\sizeRow(), and PhpOffice\PhpSpreadsheet\Reader\Xlsx\toCSSArray().
|
static |
|
static |
Returns the associated charset for the font name.
string | $name | Font name |
Definition at line 528 of file Font.php.
References $name.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Font\writeFont().
|
static |
Get the effective column width for columns without a column dimension or column with width -1 For example, for Calibri 11 this is 9.140625 (64 px).
\PhpOffice\PhpSpreadsheet\Style\Font | $font | The workbooks default font |
bool | $pPixels | true = return column width in pixels, false = return in OOXML units |
Definition at line 554 of file Font.php.
Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\__construct(), and PhpOffice\PhpSpreadsheet\Shared\Xls\sizeCol().
|
static |
Get the effective row height for rows without a row dimension or rows with height -1 For example, for Calibri 11 this is 15 points.
\PhpOffice\PhpSpreadsheet\Style\Font | $font | The workbooks default font |
Definition at line 586 of file Font.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Xls\sizeRow().
|
static |
Get approximate width in pixels for a string of text in a certain font at a certain rotation angle.
string | $columnText | |
int | $rotation |
Definition at line 306 of file Font.php.
References PhpOffice\PhpSpreadsheet\Shared\StringHelper\countCharacters(), and PhpOffice\PhpSpreadsheet\Style\Alignment\TEXTROTATION_STACK_PHPSPREADSHEET.
|
static |
|
static |
Returns the font path given the font.
\PhpOffice\PhpSpreadsheet\Style\Font | $font |
Definition at line 398 of file Font.php.
References $name.
|
static |
|
static |
Calculate an (approximate) pixel size, based on inch size.
int | $sizeInInch | Font size (in inch) |
Definition at line 374 of file Font.php.
Referenced by PhpOffice\PhpSpreadsheet\Reader\Xlsx\toCSSArray().
|
static |
|
static |
Set the path to the folder containing .ttf files.
There should be a trailing slash. Typical locations on variout some platforms:
.
string | $pValue |
|
staticprivate |
|
staticprivate |
|
static |
Definition at line 124 of file Font.php.
Referenced by PhpOffice\PhpSpreadsheet\Shared\Drawing\cellDimensionToPixels(), and PhpOffice\PhpSpreadsheet\Shared\Drawing\pixelsToCellDimension().
|
staticprivate |
const PhpOffice\PhpSpreadsheet\Shared\Font::ARIAL = 'arial.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::ARIAL_BOLD = 'arialbd.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::ARIAL_BOLD_ITALIC = 'arialbi.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::ARIAL_ITALIC = 'ariali.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::AUTOSIZE_METHOD_APPROX = 'approx' |
const PhpOffice\PhpSpreadsheet\Shared\Font::AUTOSIZE_METHOD_EXACT = 'exact' |
const PhpOffice\PhpSpreadsheet\Shared\Font::CALIBRI = 'CALIBRI.TTF' |
const PhpOffice\PhpSpreadsheet\Shared\Font::CALIBRI_BOLD = 'CALIBRIB.TTF' |
const PhpOffice\PhpSpreadsheet\Shared\Font::CALIBRI_BOLD_ITALIC = 'CALIBRIZ.TTF' |
const PhpOffice\PhpSpreadsheet\Shared\Font::CALIBRI_ITALIC = 'CALIBRII.TTF' |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_ARABIC = 0xB2 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_BALTIC = 0xBA |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_CHINESE_SIMIPLIFIED = 0x86 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_CHINESE_TRADITIONAL = 0x88 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_CYRILLIC = 0xCC |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_GREEK = 0xA1 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_HEBREW = 0xB1 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_JAPANESE_SHIFTJIS = 0x80 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_KOREAN_HANGUL = 0x81 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_KOREAN_JOHAB = 0x82 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_LATIN = 0x00 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_LATIN_II = 0xEE |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_THAI = 0xDD |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_TURKISH = 0xA2 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_ANSI_VIETNAMESE = 0xA3 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_APPLE_ROMAN = 0x4D |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_OEM_LATIN_I = 0xFF |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_SYMBOL = 0x02 |
const PhpOffice\PhpSpreadsheet\Shared\Font::CHARSET_SYSTEM_DEFAULT = 0x01 |
const PhpOffice\PhpSpreadsheet\Shared\Font::COMIC_SANS_MS = 'comic.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::COMIC_SANS_MS_BOLD = 'comicbd.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::COURIER_NEW = 'cour.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::COURIER_NEW_BOLD = 'courbd.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::COURIER_NEW_BOLD_ITALIC = 'courbi.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::COURIER_NEW_ITALIC = 'couri.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::GEORGIA = 'georgia.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::GEORGIA_BOLD = 'georgiab.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::GEORGIA_BOLD_ITALIC = 'georgiaz.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::GEORGIA_ITALIC = 'georgiai.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::IMPACT = 'impact.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::LIBERATION_SANS = 'LiberationSans-Regular.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::LIBERATION_SANS_BOLD = 'LiberationSans-Bold.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::LIBERATION_SANS_BOLD_ITALIC = 'LiberationSans-BoldItalic.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::LIBERATION_SANS_ITALIC = 'LiberationSans-Italic.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::LUCIDA_CONSOLE = 'lucon.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::LUCIDA_SANS_UNICODE = 'l_10646.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::MICROSOFT_SANS_SERIF = 'micross.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::PALATINO_LINOTYPE = 'pala.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::PALATINO_LINOTYPE_BOLD = 'palab.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::PALATINO_LINOTYPE_BOLD_ITALIC = 'palabi.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::PALATINO_LINOTYPE_ITALIC = 'palai.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::SYMBOL = 'symbol.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TAHOMA = 'tahoma.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TAHOMA_BOLD = 'tahomabd.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TIMES_NEW_ROMAN = 'times.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TIMES_NEW_ROMAN_BOLD = 'timesbd.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TIMES_NEW_ROMAN_BOLD_ITALIC = 'timesbi.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TIMES_NEW_ROMAN_ITALIC = 'timesi.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TREBUCHET_MS = 'trebuc.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TREBUCHET_MS_BOLD = 'trebucbd.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TREBUCHET_MS_BOLD_ITALIC = 'trebucbi.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::TREBUCHET_MS_ITALIC = 'trebucit.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::VERDANA = 'verdana.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::VERDANA_BOLD = 'verdanab.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::VERDANA_BOLD_ITALIC = 'verdanaz.ttf' |
const PhpOffice\PhpSpreadsheet\Shared\Font::VERDANA_ITALIC = 'verdanai.ttf' |