SunshinePHP Developer Conference 2015

CairoContext::fontExtents

cairo_font_extents

(PECL cairo >= 0.1.0)

CairoContext::fontExtents -- cairo_font_extentsGet the font extents

Descrierea

Stil obiect-orientat (method):

public array CairoContext::fontExtents ( void )

Stil procedural:

array cairo_font_extents ( CairoContext $context )

Gets the font extents for the currently selected font.

Parametri

context

Description...

Valorile întoarse

An array containing the font extents for the current font.

Exemple

Example #1 Stil obiect-orientat

<?php

$sur 
= new CairoImageSurface(CairoFormat::ARGB325050);
$con = new CairoContext($sur);

var_dump($con->fontExtents());

?>

Exemplul de mai sus va afișa ceva similar cu:

array(5) {
  ["ascent"]=>
  float(10)
  ["descent"]=>
  float(3)
  ["height"]=>
  float(13.3125)
  ["max_x_advance"]=>
  float(26.65625)
  ["max_y_advance"]=>
  float(0)
}

Example #2 Stil procedural

<?php

$sur 
cairo_image_surface_create(CAIRO_FORMAT_ARGB325050);
$con cairo_create($sur);

var_dump(cairo_font_extents($con));

?>

Exemplul de mai sus va afișa ceva similar cu:

array(5) {
  ["ascent"]=>
  float(10)
  ["descent"]=>
  float(3)
  ["height"]=>
  float(13.3125)
  ["max_x_advance"]=>
  float(26.65625)
  ["max_y_advance"]=>
  float(0)
}

Vedeți de asemenea

  • Classname::Method()

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top