Skip to content

Instantly share code, notes, and snippets.

View duncanjbrown's full-sized avatar
🍃

Duncan Brown duncanjbrown

🍃
View GitHub Profile
@duncanjbrown
duncanjbrown / imagettftext_tracking.php
Created June 15, 2012 08:41
Adjust text tracking with PHP/FreeType
<?php
/**
* This is based on the work of ryan at retronetworks dot com
* Who posted the original function on the PHP manual.
* I had occasion to find the pixel width of the created string so now
* a) the function returns the length
* and b) there's a stripped-down imagettfbbox which does the same thing
*
* Ryan's original code: http://www.php.net/manual/en/function.imagettfbbox.php#51373