Text Styles describe a collection of formatting properties, which can be applied to various elements.
More...
Text Styles describe a collection of formatting properties, which can be applied to various elements.
They provide a easy way to manage a set of formatting properties across multiple elements. If an element is created with a textstyle and if the style is modified and saved to the file the change gets propagated to all text elements. The following elements supports textstyles
-
Text Elements.
-
Dimension styles.
-
Dimension Element.
-
Tag elements.
-
Note elements.
Textstyle overrides
It is possible for an element to have a formatting property which is different from the style. In such a scenario you will need to add an override to the element so that the overriden formatting value is not lost when a style propagation occurs. The element creation API of each type would take care of this.
Typical workflow
int mdlTextStyle_addToFile |
( |
UInt32 * |
pNewTableEntryId, |
|
|
MdlTextStyle * |
pStyle, |
|
|
WCharCP |
pStyleName, |
|
|
bool |
bLockEntry |
|
) |
| |
Add a text style to the file.
- Parameters
-
[out] | pNewTableEntryId | id of the text style created |
[in] | pStyle | Textstyle to add to the file |
[in] | pStyleName | Name of the text style to add |
[in] | bLockEntry | Lock the entry in the file |
- Returns
- ERROR if there is a style with the same name or if the operation fails SUCCESS otherwise
int mdlTextStyle_changeStyleName |
( |
WChar * |
pOldStyleName, |
|
|
WChar * |
pNewStyleName |
|
) |
| |
Change the name of a text style.
- Parameters
-
[in] | pOldStyleName | Text style name to replace |
[in] | pNewStyleName | The new text style name |
- Returns
- SUCCESS if the style changed names
int mdlTextStyle_copy |
( |
MdlTextStyle ** |
ppCopiedStyle, |
|
|
MdlTextStyle * |
pStyle |
|
) |
| |
Copy the contents of one style into another.
- Parameters
-
[out] | ppCopiedStyle | destination style (allocated if *ppCopiedStyle = NULL) |
[out] | pStyle | source style |
- Returns
- SUCCESS if completed
int mdlTextStyle_copyTextStyleIntoTCB |
( |
MdlTextStyle * |
pTextStyle, |
|
|
UInt32 |
textStyleId |
|
) |
| |
Copy the contents of the text style into the tcb.
- Parameters
-
[in] | pTextStyle | Text style to copy into the tcb |
[in] | textStyleId | ID of the above text style 0 == style not in file |
- Returns
- SUCCESS if completed
int mdlTextStyle_copyTextStyleIntoTCBEx |
( |
MdlTextStyle * |
pTextStyle, |
|
|
UInt32 |
textStyleId, |
|
|
DgnPlatform::TextStyleOverrideFlags * |
pflags |
|
) |
| |
Copy the contents of the text style into the tcb copying only those entries set in the flags passed in.
- Parameters
-
[in] | pTextStyle | Text style to copy into the tcb |
[in] | textStyleId | ID of the above text style 0 == style not in file |
[in] | pflags | flags indicating which entries are copied |
- Returns
- SUCCESS if completed