Render label requests are coming from the next sources
Customer rendering of preview (saved in temporary file as it is impossible to identify customer berofe order issued. Temporary files are cleared by system)
When order is processed, customer and webmaster emails image attachements are used. Additionally each order label could be retrieved as URL with a special unique label marker
Background actions for rendering
Rendering of image is based on 'layers' abstraction. There are several type of layers - some applied to the whole picture, some render small object like text inside container, or image.
color or backgroundColor layers fill either background or all label objects with certain color
backgroundImage layer sets certain image as background
size layer allows to setup canvas size used
motif layer allows to setup an image inside the label. Specific top margin could be setup for motif layer
text layers allows to add different text blocks to label. The algorythm includes the such steps as:
definition of font type
setting up an initial free area of the text container
definition of font size to be used (based on available free space)
re-calculation of text container sizes (if there are several lines)
definition of horizontal offset for the certain block (if there are several lines)
setup correct vertical gaps (if there are several lines)