Skip to main content
Shreelipi
Known Participant
August 18, 2016
Answered

Right align text

  • August 18, 2016
  • 1 reply
  • 422 views

I'm inserting text to textframe using InsertText() of SnpTextModelHelper.h , how can right align this text to the right,

Or is there any other API call for this ?

This topic has been closed for replies.
Correct answer vinothr

Consider creating a para style (or character style) that will have text right align set.

You can process kApplyTextStyleCmdBoss to apply a style.

Use IApplyStyleData and IRangeData(for text range)

Using IApplyStyleData you should set the style UID.

data->Set(strandClassID, styleUID)

strandClassID = kCharAttrStrandBoss or kParaAttrStrandBoss

styleUID = Your para or char style UID

1 reply

vinothr
vinothrCorrect answer
Inspiring
August 29, 2016

Consider creating a para style (or character style) that will have text right align set.

You can process kApplyTextStyleCmdBoss to apply a style.

Use IApplyStyleData and IRangeData(for text range)

Using IApplyStyleData you should set the style UID.

data->Set(strandClassID, styleUID)

strandClassID = kCharAttrStrandBoss or kParaAttrStrandBoss

styleUID = Your para or char style UID