\PhpOffice\CommonFont

Font

Summary

Methods
Properties
Constants
fontSizeToPixels()
inchSizeToPixels()
centimeterSizeToPixels()
centimeterSizeToTwips()
inchSizeToTwips()
pixelSizeToTwips()
pointSizeToTwips()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

fontSizeToPixels()

fontSizeToPixels(integer  $fontSizeInPoints = 12) : integer

Calculate an (approximate) pixel size, based on a font points size

Parameters

integer $fontSizeInPoints

Font size (in points)

Returns

integer —

Font size (in pixels)

inchSizeToPixels()

inchSizeToPixels(integer  $sizeInInch = 1) : integer

Calculate an (approximate) pixel size, based on inch size

Parameters

integer $sizeInInch

Font size (in inch)

Returns

integer —

Size (in pixels)

centimeterSizeToPixels()

centimeterSizeToPixels(integer  $sizeInCm = 1) : integer

Calculate an (approximate) pixel size, based on centimeter size

Parameters

integer $sizeInCm

Font size (in centimeters)

Returns

integer —

Size (in pixels)

centimeterSizeToTwips()

centimeterSizeToTwips(integer  $sizeInCm = 1) : double

Convert centimeter to twip

Parameters

integer $sizeInCm

Returns

double

inchSizeToTwips()

inchSizeToTwips(integer  $sizeInInch = 1) : double

Convert inch to twip

Parameters

integer $sizeInInch

Returns

double

pixelSizeToTwips()

pixelSizeToTwips(integer  $sizeInPixel = 1) : double

Convert pixel to twip

Parameters

integer $sizeInPixel

Returns

double

pointSizeToTwips()

pointSizeToTwips(integer  $sizeInPoint = 1) : integer

Calculate twip based on point size, used mainly for paragraph spacing

Parameters

integer $sizeInPoint

Size in point

Returns

integer —

Size (in twips)