• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Enthusiast ,
Jul 13, 2015 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

555

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
community guidelines
Community Expert ,
Jul 14, 2015 Jul 14, 2015

Copy link to clipboard

Copied

Try posting in the FM Scripting forum

Votes

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
community guidelines
Mentor ,
Jul 15, 2015 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

Votes

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
community guidelines
Enthusiast ,
Jul 16, 2015 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.

Votes

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
community guidelines
Contributor ,
Jul 23, 2015 Jul 23, 2015

Copy link to clipboard

Copied

LATEST

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.

Votes

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
community guidelines