servo/font-kit

Potential font loading performance increase of >50%

leifniem opened this issue · 0 comments

Forgive me if this is wrong information or unorthodox, but for my first Rust project i have been utilizing font_kit and plaqyed around a little with the loading approach.

I have a 2GB folder with ~5.5k fonts, which loads in roundabout 50 seconds with the current implementation. Using jwalk and it's processing capabilities to only keep the relevant files and distinguishing between single and collection types by their file extension managed to get it down to ~11s using Font::from_path to read the files.

If i did research correctly collections should use the ttc or otc extensions only, which would make this approach viable, if not i'll happily stand corrected.

Thanks for this library it's great :)