'lo,
I had almost the same problem (could be because I kinda borrowed some of this code in one of my scripts ;) ). The problem seemed to be Font::TTF::Font, $n->release() did the trick.
Don't forget that in your example you change the original reference, so you don't have any method 'release' anymore (I forgot that initially).
This brought back memory usage from ~25mb (crash at 1020 fonts) to ~6mb (all my fonts, 1035).my $n = Font::TTF::Font->open($f) || $f; $tmp = $n->{name} || $f if ref $n; $tmp = $tmp->read->find_name(4) || $f if ref $n; $n->release() if ref $n;
december
PS: Where did you find the find_name(4) reference? I haven't found any documentation about the exact usage of find_name and the meaning of its $nid parameter...
In reply to Re: TrueType font gallery
by december
in thread TrueType font gallery
by Juerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |