Highlighted

How can get list fonts of document in FrameMaker by FDK?

Enthusiast ,
Jul 13, 2015

Copy link to clipboard

Copied

Ex:  Get lists of families of a Session

UIntT i, j; F_StringsT families, weights, variations, angles; F_FontsT perms;

/* Get lists of families, variations, weights, and angles. */

families = F_ApiGetStrings(0, FV_SessionId, FP_FontFamilyNames);

weights = F_ApiGetStrings(0, FV_SessionId, FP_FontWeightNames);

variations = F_ApiGetStrings(0, FV_SessionId, FP_FontVariationNames);

angles = F_ApiGetStrings(0, FV_SessionId, FP_FontAngleNames);

But i change SessionID by DocID, It can't resturn values.

I want get list font using in a document.

How can get list fonts of document in FrameMaker by FDK?

TOPICS
Scripting

Views

433

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

How can get list fonts of document in FrameMaker by FDK?

Enthusiast ,
Jul 13, 2015

Copy link to clipboard

Copied

Ex:  Get lists of families of a Session

UIntT i, j; F_StringsT families, weights, variations, angles; F_FontsT perms;

/* Get lists of families, variations, weights, and angles. */

families = F_ApiGetStrings(0, FV_SessionId, FP_FontFamilyNames);

weights = F_ApiGetStrings(0, FV_SessionId, FP_FontWeightNames);

variations = F_ApiGetStrings(0, FV_SessionId, FP_FontVariationNames);

angles = F_ApiGetStrings(0, FV_SessionId, FP_FontAngleNames);

But i change SessionID by DocID, It can't resturn values.

I want get list font using in a document.

How can get list fonts of document in FrameMaker by FDK?

TOPICS
Scripting

Views

434

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Jul 13, 2015 0
Adobe Community Professional ,
Jul 14, 2015

Copy link to clipboard

Copied

Try posting in the FM Scripting forum

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 14, 2015 0
Mentor ,
Jul 15, 2015

Copy link to clipboard

Copied

diatranthanhoa,

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.

Russ

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 15, 2015 1
Enthusiast ,
Jul 16, 2015

Copy link to clipboard

Copied

If get font of Document from each textrange,It is ok.

But it is slow, I want find solution get all font from Docmuent.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 16, 2015 0
Contributor ,
Jul 23, 2015

Copy link to clipboard

Copied

I'd try this approach:

  1. Get the fiont at the start of the document, and use it to initialize a list or hash of fonts that you've found.
  2. Create a text range that is the entire document.
  3. Get text items for the range, fetching only the item type that indicates a change in character properties.
  4. 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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Jul 23, 2015 0