[squeak-dev] Re: [Pharo-project] freetype plugin on os-x squeak v5.0
-> goes to 5.1
John M McIntosh
johnmci at smalltalkconsulting.com
Sat Dec 26 04:23:53 UTC 2009
Ok after a day of slugging thru bits between way too much turkey I reworked the freetype plugin code so that it now works with 64bit VMs running 32bit images.
There was a slight mistruth in the freetype header.
/* <Type> */
/* FT_Pos */
/* <Description> */
/* The type FT_Pos is a 32-bit integer used to store vectorial */
/* coordinates. Depending on the context, these can represent */
/* distances in integer font units, or 16.16, or 26.6 fixed float */
/* pixel coordinates. */
typedef signed long FT_Pos;
Yes sure it's a 32bit number stored in a 64bit integer. Unfortunately when you map that to your handy IntegerArray instance, you get whiteness.
There were of course a few other places where "Oops" oops is a object reference, it's NOT a memory address, it can become one if you use the proper routine tho.
Once that was all corrected then it works.
I'm not able to check the FT2Plugin changes in yet because of a missing password.
Now in order to make this all work I had to recompile the Squeak VM so that it exposes the object memory base memory address so the plugin can find it.
So you'll find 5.1 at...
at the usual places, look in the experimental folder for the "64bit" directory then for the 64bit VM 32 bit image directory "32bitImage*64bitVM"
and the zipped VM "Squeak 64/32 5.1b1.app.zip"
Confirmation that it works elsewhere than my computer is welcome. PS yes please check on 32bit intel, 32/64bit intel, and 32bit powerpc.
I'll build a 64bit version for 64bit images at some point in the future, but I think I'll look at the hostmenu logic first to get mac menus back.
On 2009-12-20, at 6:16 PM, John M McIntosh wrote:
> Ok, I spent a good 4 hours here working through issues.
> Unfortunately the plugin just assumes an oops reference is a pointer (it's not), and that the squeak word size is (4), it might not be,
> and the occasional FreeType variable is that an int or long? FreeType defines their own var types so their code isn't confused, but we are...
> Plus a sprinkling of self cCode: to do magic transformations between oops pointers and instance pointer values transformed to an int, or is that a long...
> So it will be sometime yet before I get it working with a 64bit VM and 32bit image.
> On 2009-12-17, at 3:16 AM, Henrik Johansen wrote:
>> On Dec 17, 2009, at 11:09 01AM, John M McIntosh wrote:
>>> Now I need someone to tell me where it fails when running as a 64bit VM with a 32bit image.
>>> No doubt there is a primitive call that needs to be changed, but I'm a bit too tired now to
>>> sort thru how the heck the FreeType class works to find out where it fails. (Silently I might add...)
> John M. McIntosh <johnmci at smalltalkconsulting.com> Twitter: squeaker68882
> Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
John M. McIntosh <johnmci at smalltalkconsulting.com> Twitter: squeaker68882
Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com
More information about the Squeak-dev