Allow resizing a Cache without clearing queued glyphs
The documentation for Cache::cache_queued
says "Caches the queued glyphs. If this is unsuccessful, the queue is untouched". It would be nice to use this to write code like
for (font, gly) in glyphs {
cache.queue_glyph(font, gly);
}
while cache.cache_queued(...).is_err() {
cache.resize(double(cache.dimensions()));
}
However there is no way to increase the size of the cache without losing the queue, so we have to recreate the queue each time
It also occurs to me that set_position_tolerance
and set_scale_tolerance
are not quite equivalent to recreating the cache since they do not touch the queue. Maybe they could be un-deprecated with a performance warning?
Edited by Andrew Hickman