Hi Kovid,
thanks for explaining the algorithms. Now I understand (hopefully) a bit better why calibre can't find the font.
I need to read all the other stuff from @nabsltd once more to get his input sorted in my head too.
Your idea for having a fall back mechanism and better information about a font what cant be found is a much better as it is for now.
I have maybe a addition idea for some when in the future. The main problem is, if I understood you correct, to know what matching font is really available in an operating system and that it is not a good idea to scan a complete font repository for each embedding action. This I can fully understand.
I don't know how much work it is, but what is, if you create an internal cache file of all fonts with a possibility that a user can activate manually a new/updating query with maybe as well the opportunity to provide additional path information for a not standard location in addition. This has for you the benefit not to initialize a time and resource consuming system wide search every time for a font and you have all needed information available on one place. As user I can initialize an update if needed and have no problem with timing issues as I know that will take some time to do that job. I guess, most users do not often change fonts so the information in a cache file are normally valid for a longer time frame. Only an idea.
Best regards,
DivingDuck