Show: inherited
Table of Contents


Package: Default

This class represents an abstract front metric service.



Constant  ASCII_BLANK = 32

the ASCII code for the blank, i.e. " "


Propertyprivatestring  $fontMetricsTemplate= ''fontMetrics.tpl''

the file name where the template for the font metric HTML file is stored

Default value'fontMetrics.tpl'Details


methodpublic__construct( ) : void

This method acts as the constructor of the class

methodprotectedcreateHtml( \Utils\Graphics2D\Shapes\Styles\TextStyle $textStyle, \Utils\URL\Url $fontMetricServiceEndpoint ) : string

This method creates html code which is either opened as static file (@see FontMetricSocketService) or served dynamically (@see FontMetricWebServerService).

The html code of the template is complated, and a span element for each of the first 255 charachters of the current text style are added. The javascript code embedded in the template html code gets the width of each span element (i.e. the width of each character) and sends this information bach to the registered service endpoint.

Name Type Description
$textStyle \Utils\Graphics2D\Shapes\Styles\TextStyle

the text style for which the html should be created

$fontMetricServiceEndpoint \Utils\URL\Url

the service endpoint to which the result should be sent to

Type Description
string the generated html code
methodpublicexecute( \Utils\Graphics2D\Shapes\Styles\TextStyle $textStyle, \Utils\Font\FontManager $fontManager ) : void

This method executes the respective service.

Name Type Description
$textStyle \Utils\Graphics2D\Shapes\Styles\TextStyle

the text style for which the font definition is needed

$fontManager \Utils\Font\FontManager

the font manager to which the font definition is added to

Documentation was generated by DocBlox 0.15.1.