Categories
Snaps
Search
Register
Contact
API
Get text height, width
Make your bounding box calculating life easier.
define("F_SIZE", 8); define("F_FONT", "arial.ttf"); function get_bbox($text){ return imagettfbbox(F_SIZE, 0, F_FONT, $text); } function text_height ($text) { $box = get_bbox($text); $height = $box[3] - $box[5]; return $height; } function text_width ($text) { $box = get_bbox($text); $width = $box[4] - $box[6]; return $width; }
Usage
string text_* -> int
Comments
Add your comment
Search
Login
Coder: fireshark
View more snaps from fireshark
View fireshark's profile
Rate this snap
Rating:
0
/ 5 (
0
votes) 1502 views
Custom class generator
Selected snaps:
None selected yet.
Hot PHP snaps
PHP image slideshow auto
PHP pagination class
Bootstrap PHP code
Clean URL
PHP ffmpeg Upload Script
Rijndael 256 bit encryption using mcrypt
generate a preview image from an FLV file on-the-fly, or to save
Median calculator
Partners
PHP Site
PHPSnips
Comments