On 15 May 2013 00:57, Igor Stasenko siguctua@gmail.com wrote:
Hi , Doru
i have only one question: why you put font binary data into compiled method? That means that in object memory it will be contained 3 times:
- 1 as source code
- 2 as big literal array
- 3 in freetype memory buffer
imo, #fontContents should be
fontContents ^ self url getContents ".. or whatever.. url is key here"
... or you can download the binaray data and put it into class var (lazy-initialized etc).. but do not hold binary data as source code.. this is really awful idea as to me. unless you worry that longevity of your file copy @ smalltalk-hub will be higher than longevity on site where you downloaded it from.
or even better, at class #initialize you forcefully downloading font from its original web site and put it into some class var. Since package is also downloaded from internet, there's no worry that font will be unavailable during installation (unless the site where it located changes file location). Like that, the package will contain just minimum necessary bits to install the font. And also, having url available, makes it easier for users to add own fonts by simply overriding it, without need of figuring out how to turn a binary file into method's source code.
-- Best regards, Igor Stasenko.