[mxcad_2d API documentation] (../README. md)/[2d] (../modules/2d. md)/MxCADBaseCustomizaText
Class: MxCADBaseCustomText
2d.MxCADBaseCustomText
Represents the base class for custom text elements, used to define layout calculations and entity generation for text nodes.
Description
MxCADBaseCustomizaText is an abstract base class responsible for providing width and height calculation and entity creation interfaces for custom text nodes. The implementation class that inherits this class can calculate the size based on the content of the text node and generate the corresponding McDbEntity or McDbCCustoms Entity entity. Instructions:
- Inherit MxCADBaseCustomizaText and implement type, calculate, and create methods.
- Calculate layout data such as width and height based on text nodes in Calculate.
- Generate a printable entity array in create based on the calculation results and positions.
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new MxCADBaseCustomText()
Properties
type
• Abstract type: string
type
Methods
calculate
▸ Abstract calculate(entity, textNode): MxCADCustomTextCalculateData
Calculate layout data
Parameters
| Name | Type |
|---|---|
entity | MxCADMText |
textNode | MarksStyleText |
Returns
MxCADCustomTextCalculateData
create
▸ Abstract create(entity, textNode, calculateData, renderData): (McDbEntity | McDbCustomEntity)[]
Create entity
Parameters
| Name | Type |
|---|---|
entity | MxCADMText |
textNode | MarksStyleText |
calculateData | MxCADCustomTextCalculateData |
renderData | CreateData |
Returns
(McDbEntity | McDbCustomEntity)[]
