TextNode Font MDL function

I have the SDK installed on my machine and have done some preliminary looking around.  Is there a MDL function that would allow me to programmatically change the font of a text node?  If so, what is that MDL function?

Parents
  • Is there a MDL function that would allow me to programmatically change the font of a text node?

    mdlTextNode_extract() and mdlTextNode_extractWide() get information about a text node element.  The TextParamWide argument has the font no. as a member.

    There's no function to set the TextParamWide values in an existing text node element.  Follow these patterns instead:

    • The MDL idiom is to setup value parameters, create a new text node element, and then add to the DGN model. 
    • If you're 'editing' an existing text node, then read the node, extract its TextParamWide value, set the font no. then add to the DGN model.  Delete the existing node element.  I'm not sure how or if that will affect the node's component text elements.
    possibly every text in text node can have different parameters or text style assigned

    Jan hits the nail on the head!  The text values stored in the text node are not necessarily used by its constituent text elements.  Each text element may have its own symbology.

    Whatever, these days it's preferable to use a text style for each text element.  To put things in perspective, the text API went through a dramatic change.  The header file for CONNECT says this about TextParamWide: This structure should be considered deprecated; if possible, use TextStringProperties or RunProperties instead.

    I would focus on the invidual text elements in the text node, and set the text style for each element.  Ignore the possibly redundant symbology information stored in the text node.

     
    Regards, Jon Summers
    LA Solutions

Reply
  • Is there a MDL function that would allow me to programmatically change the font of a text node?

    mdlTextNode_extract() and mdlTextNode_extractWide() get information about a text node element.  The TextParamWide argument has the font no. as a member.

    There's no function to set the TextParamWide values in an existing text node element.  Follow these patterns instead:

    • The MDL idiom is to setup value parameters, create a new text node element, and then add to the DGN model. 
    • If you're 'editing' an existing text node, then read the node, extract its TextParamWide value, set the font no. then add to the DGN model.  Delete the existing node element.  I'm not sure how or if that will affect the node's component text elements.
    possibly every text in text node can have different parameters or text style assigned

    Jan hits the nail on the head!  The text values stored in the text node are not necessarily used by its constituent text elements.  Each text element may have its own symbology.

    Whatever, these days it's preferable to use a text style for each text element.  To put things in perspective, the text API went through a dramatic change.  The header file for CONNECT says this about TextParamWide: This structure should be considered deprecated; if possible, use TextStringProperties or RunProperties instead.

    I would focus on the invidual text elements in the text node, and set the text style for each element.  Ignore the possibly redundant symbology information stored in the text node.

     
    Regards, Jon Summers
    LA Solutions

Children
No Data