Classes | Functions
Text Styles

Text Styles describe a collection of formatting properties, which can be applied to various elements. More...

Classes

struct  TextStyleOverrideFlags
 This structure is not intended to be used directly, and supports file storage. More...
 
struct  TextStyleFlags
 This structure is not intended to be used directly. More...
 
struct  TextStyle
 This structure is not intended to be used directly, and supports file storage. More...
 
struct  TextStylePropertyMask
 A BitMask of all textstyle properties Bit indices are enumerated by the TextStyleProperty enum. More...
 
struct  DgnTextStyle
 Class to manipulate a textstyle in a DgnFile. More...
 
struct  TextStyleIterator
 A forward iterator to go through the list of styles in a file. More...
 
struct  TextStyleCollection
 A collection of textstyles in a file. More...
 

Functions

int mdlTextStyle_addToFile (UInt32 *pNewTableEntryId, MdlTextStyle *pStyle, WCharCP pStyleName, bool bLockEntry)
 Add a text style to the file. More...
 
int mdlTextStyle_changeStyleName (WChar *pOldStyleName, WChar *pNewStyleName)
 Change the name of a text style. More...
 
int mdlTextStyle_copyTextStyleIntoTCB (MdlTextStyle *pTextStyle, UInt32 textStyleId)
 Copy the contents of the text style into the tcb. More...
 
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. More...
 
int mdlTextStyle_copy (MdlTextStyle **ppCopiedStyle, MdlTextStyle *pStyle)
 Copy the contents of one style into another. More...
 

Detailed Description

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

  1. Text Elements.
  2. Dimension styles.
  3. Dimension Element.
  4. Tag elements.
  5. 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

Function Documentation

int mdlTextStyle_addToFile ( UInt32 pNewTableEntryId,
MdlTextStyle *  pStyle,
WCharCP  pStyleName,
bool  bLockEntry 
)

Add a text style to the file.

Parameters
[out]pNewTableEntryIdid of the text style created
[in]pStyleTextstyle to add to the file
[in]pStyleNameName of the text style to add
[in]bLockEntryLock the entry in the file
Returns
ERROR if there is a style with the same name or if the operation fails SUCCESS otherwise
Remarks
Required Library: mdlbltin.lib
int mdlTextStyle_changeStyleName ( WChar *  pOldStyleName,
WChar *  pNewStyleName 
)

Change the name of a text style.

Parameters
[in]pOldStyleNameText style name to replace
[in]pNewStyleNameThe new text style name
Returns
SUCCESS if the style changed names
Remarks
Required Library: mdlbltin.lib
int mdlTextStyle_copy ( MdlTextStyle **  ppCopiedStyle,
MdlTextStyle *  pStyle 
)

Copy the contents of one style into another.

Parameters
[out]ppCopiedStyledestination style (allocated if *ppCopiedStyle = NULL)
[out]pStylesource style
Returns
SUCCESS if completed
Remarks
Required Library: mdlbltin.lib
int mdlTextStyle_copyTextStyleIntoTCB ( MdlTextStyle *  pTextStyle,
UInt32  textStyleId 
)

Copy the contents of the text style into the tcb.

Parameters
[in]pTextStyleText style to copy into the tcb
[in]textStyleIdID of the above text style 0 == style not in file
Returns
SUCCESS if completed
Remarks
Required Library: mdlbltin.lib
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]pTextStyleText style to copy into the tcb
[in]textStyleIdID of the above text style 0 == style not in file
[in]pflagsflags indicating which entries are copied
Returns
SUCCESS if completed
Remarks
Required Library: mdlbltin.lib

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.