class Font extends AbstractDateTimed (View source)

Fonts are entities which store each webfont file for a font-family and a font-variant.

Constants

REGULAR

ITALIC

BOLD

BOLD_ITALIC

LIGHT

LIGHT_ITALIC

MIME_DEFAULT

MIME_SVG

MIME_TTF

MIME_OTF

MIME_WOFF

MIME_WOFF2

MIME_EOT

Properties

protected $id from AbstractEntity
protected DateTime $createdAt from AbstractDateTimed
protected DateTime $updatedAt from AbstractDateTimed
static array $variantToHuman Get readable variant association
protected $variant
protected UploadedFile $eotFile
protected UploadedFile $woffFile
protected UploadedFile $woff2File
protected UploadedFile $otfFile
protected UploadedFile $svgFile

Methods

int
getId()

No description

setId(int $id)

No description

getCreatedAt()

No description

setCreatedAt(DateTime $createdAt)

No description

getUpdatedAt()

No description

setUpdatedAt(DateTime $updatedAt)

No description

preUpdate()

No description

prePersist()

No description

resetDates()

Set creation and update date to now.

string
getReadableVariant()

Get a readable string to describe current font variant.

integer
getVariant()

No description

$this
setVariant(integer $variant)

No description

array
getFontVariantInfos()

Return font variant information for CSS font-face into a simple array.

string
getEOTFilename()

No description

$this
setEOTFilename(string $eotFilename)

No description

string
getWOFFFilename()

No description

$this
setWOFFFilename(string $woffFilename)

No description

string
getWOFF2Filename()

No description

$this
setWOFF2Filename(string $woff2Filename)

No description

string
getOTFFilename()

No description

$this
setOTFFilename(string $otfFilename)

No description

string
getSVGFilename()

No description

$this
setSVGFilename(string $svgFilename)

No description

string
getName()

No description

$this
setName(string $name)

No description

string
getHash()

No description

$this
setHash(string $hash)

No description

$this
generateHashWithSecret(string $secret)

No description

string
getFolder()

No description

string
getEOTRelativeUrl()

No description

string
getEOTAbsolutePath() deprecated

No description

string
getWOFFRelativeUrl()

No description

string
getWOFFAbsolutePath() deprecated

No description

string
getWOFF2RelativeUrl()

No description

string
getWOFF2AbsolutePath() deprecated

No description

string
getOTFRelativeUrl()

No description

string
getOTFAbsolutePath() deprecated

No description

string
getSVGRelativeUrl()

No description

string
getSVGAbsolutePath() deprecated

No description

string
getDescription()

No description

$this
setDescription(string $description)

No description

__construct()

Create a new Font and generate a random folder name.

static string
getFilesFolder() deprecated

No description

static string
getFilesFolderName() deprecated

No description

getHandler()

No description

UploadedFile
getEotFile()

Gets the value of eotFile.

setEotFile(UploadedFile $eotFile = null)

Sets the value of eotFile.

UploadedFile
getWoffFile()

Gets the value of woffFile.

setWoffFile(UploadedFile $woffFile = null)

Sets the value of woffFile.

UploadedFile
getWoff2File()

Gets the value of woff2File.

setWoff2File(UploadedFile $woff2File = null)

Sets the value of woff2File.

UploadedFile
getOtfFile()

Gets the value of otfFile.

setOtfFile(UploadedFile $otfFile = null)

Sets the value of otfFile.

UploadedFile
getSvgFile()

Gets the value of svgFile.

setSvgFile(UploadedFile $svgFile = null)

Sets the value of svgFile.

Details

int getId()

Return Value

int

AbstractEntity setId(int $id)

Parameters

int $id

Return Value

AbstractEntity

DateTime getCreatedAt()

Return Value

DateTime

AbstractEntity setCreatedAt(DateTime $createdAt)

Parameters

DateTime $createdAt

Return Value

AbstractEntity

DateTime getUpdatedAt()

Return Value

DateTime

AbstractEntity setUpdatedAt(DateTime $updatedAt)

Parameters

DateTime $updatedAt

Return Value

AbstractEntity

preUpdate()

prePersist()

AbstractEntity resetDates()

Set creation and update date to now.

Return Value

AbstractEntity

string getReadableVariant()

Get a readable string to describe current font variant.

Return Value

string

integer getVariant()

Return Value

integer

$this setVariant(integer $variant)

Parameters

integer $variant

Return Value

$this

array getFontVariantInfos()

Return font variant information for CSS font-face into a simple array.

  • style
  • weight

Return Value

array

string getEOTFilename()

Return Value

string

$this setEOTFilename(string $eotFilename)

Parameters

string $eotFilename

Return Value

$this

string getWOFFFilename()

Return Value

string

$this setWOFFFilename(string $woffFilename)

Parameters

string $woffFilename

Return Value

$this

string getWOFF2Filename()

Return Value

string

$this setWOFF2Filename(string $woff2Filename)

Parameters

string $woff2Filename

Return Value

$this

string getOTFFilename()

Return Value

string

$this setOTFFilename(string $otfFilename)

Parameters

string $otfFilename

Return Value

$this

string getSVGFilename()

Return Value

string

$this setSVGFilename(string $svgFilename)

Parameters

string $svgFilename

Return Value

$this

string getName()

Return Value

string

$this setName(string $name)

Parameters

string $name

Return Value

$this

string getHash()

Return Value

string

$this setHash(string $hash)

Parameters

string $hash

Return Value

$this

$this generateHashWithSecret(string $secret)

Parameters

string $secret

Return Value

$this

string getFolder()

Return Value

string

string getEOTRelativeUrl()

Return Value

string

string getEOTAbsolutePath() deprecated

deprecated Use Assets package service instead. Will be removed in Standard Edition.

Return Value

string

string getWOFFRelativeUrl()

Return Value

string

string getWOFFAbsolutePath() deprecated

deprecated Use Assets package service instead. Will be removed in Standard Edition.

Return Value

string

string getWOFF2RelativeUrl()

Return Value

string

string getWOFF2AbsolutePath() deprecated

deprecated Use Assets package service instead. Will be removed in Standard Edition.

Return Value

string

string getOTFRelativeUrl()

Return Value

string

string getOTFAbsolutePath() deprecated

deprecated Use Assets package service instead. Will be removed in Standard Edition.

Return Value

string

string getSVGRelativeUrl()

Return Value

string

string getSVGAbsolutePath() deprecated

deprecated Use Assets package service instead. Will be removed in Standard Edition.

Return Value

string

string getDescription()

Return Value

string

$this setDescription(string $description)

Parameters

string $description

Return Value

$this

__construct()

Create a new Font and generate a random folder name.

static string getFilesFolder() deprecated

deprecated Use Kernel::getFontsFilesPath() whenever it’s possible. This will be removed in Standard Edition.

Return Value

string Return absolute path to fonts folder. This path should be protected.

static string getFilesFolderName() deprecated

deprecated Use Kernel::getFontsFilesBasePath() whenever it’s possible. This will be removed in Standard Edition.

Return Value

string

FontHandler getHandler()

Return Value

FontHandler

UploadedFile getEotFile()

Gets the value of eotFile.

Return Value

UploadedFile

Font setEotFile(UploadedFile $eotFile = null)

Sets the value of eotFile.

Parameters

UploadedFile $eotFile the eot file

Return Value

Font

UploadedFile getWoffFile()

Gets the value of woffFile.

Return Value

UploadedFile

Font setWoffFile(UploadedFile $woffFile = null)

Sets the value of woffFile.

Parameters

UploadedFile $woffFile the woff file

Return Value

Font

UploadedFile getWoff2File()

Gets the value of woff2File.

Return Value

UploadedFile

Font setWoff2File(UploadedFile $woff2File = null)

Sets the value of woff2File.

Parameters

UploadedFile $woff2File the woff2 file

Return Value

Font

UploadedFile getOtfFile()

Gets the value of otfFile.

Return Value

UploadedFile

Font setOtfFile(UploadedFile $otfFile = null)

Sets the value of otfFile.

Parameters

UploadedFile $otfFile the otf file

Return Value

Font

UploadedFile getSvgFile()

Gets the value of svgFile.

Return Value

UploadedFile

Font setSvgFile(UploadedFile $svgFile = null)

Sets the value of svgFile.

Parameters

UploadedFile $svgFile the svg file

Return Value

Font