Try posting in the FM Scripting forum
I do not fully understand your question. If you are asking how to discover which fonts are actually in use within a specific document, that sounds a bit complicated. The Fonts pod does it very quickly, but I don't know how to replicate that easily. Maybe someone else does. Without any better idea, I would probably query the session for all font family names, then use F_ApiFind() to search the document for each. This doesn't seem like a very efficient approach, though. I apologize that I can't be of more help.
If get font of Document from each textrange,It is ok.
But it is slow, I want find solution get all font from Docmuent.
I'd try this approach:
- Get the fiont at the start of the document, and use it to initialize a list or hash of fonts that you've found.
- Create a text range that is the entire document.
- Get text items for the range, fetching only the item type that indicates a change in character properties.
- In the idata for each returned text item, see if the bit(s) are set indicating that the font has changed in a way that you find interesting (e.g. family, angle, weight). If so, get the changed font, and add it to the list or hash of fonts that you've found.
A warning that this is untested, and put together frommemory without looking at the API documentation. It might need further refinement, and I'll not be able to contribute any more to this thread myself. But I hope this gets you started.