= A note on installing RoboFab from SVN for FontLab Studio on OSX Leopard = == Python 2.3.5 on Mac OSX Leopard == There is a special problem which occurs on Mac OSX Leopard in combination with FontLab Studio and Python 2.3. In short: FontLab Studio requires Python 2.3.5. Leopard ships with an up-to-date Python 2.5.1. But, fortunately, Apple also put the *framework* of Python 2.3.5 in the OS, but it can't be called from the commandline because a part is missing. == __file__ == A different problem, this time in FontLab Studio itself, makes it very difficult to run installer-like scripts in FontLab. Normally, Python interpreters, embedded or regular, include a variable named __file__ in the namespace, it contains the path to the file that's running. This allows scripts to find out where they are, and where they need to go. FontLab's Python interpreter does not have this __file__ variable, hence scripts have no way of finding out from where they've been launched. That puts an end to installing things from within FontLab. These two issues combined make it very difficult to actually install any Python packages specifically for FontLab. We can't use an external interpreter because it is missing, and we can't use the embedded interpreter because it misses an important variable. == What to do == The following steps describe a way to get things working. It's not entirely elegant, but that's how things go. So, assuming you already have a local copy of the robofab svn. 1. Download and run the all-in-one installer from http://robofab.com/download/index.html 2. Look into '''/Library/Python''' (so, not /Users/you/Library and also not /System/Library) 3. You will find two folders, '''2.3''' and '''2.5'''. These folders are specially there to make it easier to install packages for Python. 4. Open the '''2.3''' folder. It contains a folder named '''site-packages'''. 5. Open '''site-packages'''. It will contains items such as: * FontTools * FontTools.pth * Numeric * Numeric.pth * README * robofab.pth * RoboFab 6. Delete or remove the '''RoboFab''' folder (it is not as fresh as the svn version), but leave the '''robofab.pth''' file. Do not touch the other files. 7. Open '''robofab.pth''' in your favorite text editor. It will probably just say '''RoboFab''' 8. Replace it with the path to where you keep the svn robofab. It will say something like this: '''/Users/you/svn.robofab.com/trunk/robofab/Lib''' 9. Make sure the path points all the way to the Lib. 10. Open FontLab and test importing robofab in the Macro window: import robofab 11. If no complaints show up, it works! 12. If this gives you an '''ImportError''' it's most likely that the path in the robofab.pth file is somehow wrong.