On May 15, 2013, at 1:11 AM, Igor Stasenko siguctua@gmail.com wrote:
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.
Do you care? Because I like the idea to have self contained package. We can do the inverse: remove the method once the fonts are installed?
I do not want to rely on a web connection to get the system working.
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.
I would provide a helper method that compile the contents into a method.
-- Best regards, Igor Stasenko.
-- Best regards, Igor Stasenko. _______________________________________________ Moose-dev mailing list Moose-dev@iam.unibe.ch https://www.iam.unibe.ch/mailman/listinfo/moose-dev