#LOGFONT to FontFile
Extract and copy the corresponding OTF/TTF/TTC font file from a LOGFONT struct generated by the user input in a CFontDialog on Windows platform.
Support most fonts of English and Chinese.
The idea is:
- Scan all "font name/file name" matches in registry.
- Scan font folder path in registry.
- Scan all font files(TTF/OTF/TTC) for their other names beside the registered one.
- Make a dictionary of "font name/file path" matches.
- When given a LOGFONT, search for its lfFaceName in the dictionary.
- Use FILE to copy font files to a target folder.
Complemented in a rather simple straight-forward way. For a better structured solution WATCH THIS.
References:
