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

How to detect line change (SDK, C++)

Community Beginner ,
Apr 13, 2022 Apr 13, 2022

Copy link to clipboard

Copied

Hi

 

I'm trying to find the line flow change after inserting ruby text. I've tried these steps.

- By checking textspan before and after; waxLine->GetTextSpan; but return same value; also called invalidateruns.

- Then waxRun->GetCharCount

- Then waxGlyphs->GetGlyphAt last index

- also tried with few x, y offset calls

 

all returns same result before and after. Please refer the attached screen shot and suggest how to detect the line change.

 

thank you

 

TOPICS
SDK

Views

222

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

correct answers 1 Correct answer

Guide , Apr 13, 2022 Apr 13, 2022

The composer is a program that produces the wax structure of composed text, considering actual text, styles, attributes including your ruby, and the place to get filled (frames subdivided into parcels, tiles and so forth).

Composition works in an idle task (nowadays one would call that async) so you have to wait for completion before accessing the output structure "wax". E.g. You add a character at page 1, causing reflow on pages 1 thru 300 trickle thru until the portion of text relevant to you o

...

Votes

Translate

Translate
Guide ,
Apr 13, 2022 Apr 13, 2022

Copy link to clipboard

Copied

The composer is a program that produces the wax structure of composed text, considering actual text, styles, attributes including your ruby, and the place to get filled (frames subdivided into parcels, tiles and so forth).

Composition works in an idle task (nowadays one would call that async) so you have to wait for completion before accessing the output structure "wax". E.g. You add a character at page 1, causing reflow on pages 1 thru 300 trickle thru until the portion of text relevant to you on page 301 is reached and updated. Using an idle task means the application remains responsive (even with CPU power 20 years ago) so the user can type another character and everything starts over. You wait for composer completion via an observer.

The alternative would mean to force composition - e.g. when the composition results such as text coordinates, line wraps etc. is to be displayed in UI, or a script refers to them. In that case the scripting subsystem / UI controller triggers a forced recompose until that portion of text. Your program can do the same, search the SDK for methods named "recompose".

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
Community Beginner ,
Apr 13, 2022 Apr 13, 2022

Copy link to clipboard

Copied

Thank you Dirk for the imm response. Sure, will try that.. so after recompose the same textspan is right approach?

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
Guide ,
Apr 13, 2022 Apr 13, 2022

Copy link to clipboard

Copied

You can try a cheap experiment without much new programming:

 

After your change of the ruby don't expect immediate result, e.g. just insert a return to abort your routine.

 

Let InDesign reach the event loop and idle processing, so the user interface does the composition and updates the layout window to reflect your first changes.

 

When you then trigger your wax calls by a separate button or menu action, you should then receive the expected results. If so, you nailed it and can consider the architectural options from above.

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
Community Beginner ,
Apr 13, 2022 Apr 13, 2022

Copy link to clipboard

Copied

LATEST

It worked thank you bro!

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