Patent ID: 7743325

Claim:
A method for fitting text to at least one shape in a graphic, the method comprising: determining at least one property associated with the text, wherein the at least one property associated with the text comprises one of the following: alignment, margin, and spacing; modifying the at least one property associated with the text, wherein modifying the at least one property associated with the text is based on a defined association between the at least one property and the at least one shape in the graphic; defining at least one initial constraint and at least one constraint rule for fitting the text to the at least one shape, the at least one constraint rule and the at least one initial constraint being defined for at least one of the following: the at least one shape and a set of shapes, wherein defining the least one initial constraint comprises attaching a shared propagator to the at least one initial constraint that propagates a state of the at least one initial constraint to at least one layout node; applying the at least one initial constraint to fit the text within the at least one shape; detecting that the text did not fit within the at least one shape; in response to detecting that the text did not fit within the at least one shape, applying the at least one constraint rule to modify at least one initial constraint; reapplying the modified at least one initial constraint to the at least one shape to create a new layout for the graphic; determining whether a diagram type associated with the graphic has been changed; in response to determining that the diagram type associated with the graphic has been changed, determining whether a change in the diagram type has caused a change in at least one of the following: a size of the at least one shape and a position of the at least one shape; in response to determining that the change in the diagram type has caused a change in at least one of the following: the size of the at least one shape, and the position of the at least one shape, determining whether the text within the at least one shape needs to be re-mapped; in response to determining that the text within the at least one shape need to be re-mapped, re-mapping the text to the at least one shape in the changed diagram type and applying at least one new constraint associated with the changed diagram type to the at least one property associated with the text, wherein applying the at least one new constraint associated with the changed diagram type to the at least one property is defined by the association of the at least one property to the at least one shape in the graphic, the at least one new constraint being defined as a result of the changed diagram type; and in response to applying the at least one new constraint associated with the changed diagram type to the at least one property associated with the text, displaying the graphic on a display screen.