note 56263 added to function.imageloadfont

From: Date: Mon, 29 Aug 2005 01:37:30 +0000
Subject: note 56263 added to function.imageloadfont
Groups: php.notes 
Request: Send a blank email to php-notes+get-94322@lists.php.net to get a copy of this message
Working under the assumption that the only 'architecture dependant' part of the font files is endianness, I wrote a quick and dirty Python script to convert between the two. It has only been tested on a single font on a single machine so don't bet your life on it working. All it does is swap the byte order of the first four ints. #!/usr/bin/env python f = open("myfont.gdf", "rb"); d = open("myconvertedfont.gdf", "wb"); for i in xrange(4): b = [f.read(1) for j in xrange(4)]; b.reverse(); d.write(''.join(b)); d.write(f.read()); I successfully used this script to convert anonymous.gdf, from one of the font links below, into something useable on Mac OS X. ---- Manual Page -- http://www.php.net/manual/en/function.imageloadfont.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56263 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56263&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56263&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56263&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56263&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56263&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56263&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56263&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94322) next »