A dynamic layout method, system and medium for water wash mark printing
By constructing dependencies between layout elements and pre-layout processing, the layout of the care label is dynamically adjusted, solving the layout problems caused by content changes in traditional systems. This achieves correct line breaks for multilingual text and center positioning of barcodes, improving printing accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- XIAMEN XINDA LIANKE INFORMATION TECH CO LTD
- Filing Date
- 2026-01-09
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional wash label printing systems cannot adapt to dynamic changes in content, resulting in overlapping, obscuring, or misaligned layout elements, especially when dealing with line breaks in multilingual text and barcode positioning.
By constructing dependencies between layout elements and combining pre-layout with character-level width calculation, the position of elements is dynamically adjusted to achieve semantically correct line breaks in multilingual text and center positioning of barcodes.
It achieves full automation of the water-washable label process, from content adaptation to automatic layout adjustment, improving the accuracy and efficiency of batch printing and ensuring the semantic integrity of multilingual text and the stability of barcode recognition.
Smart Images

Figure CN121478210B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of care label printing technology, and in particular to a dynamic layout method, system and medium for care label printing. Background Technology
[0002] Traditional label layout systems typically rely on static template frameworks to handle dynamic content. However, in the field of automated printing of care labels, these systems suffer from the following technical shortcomings when dealing with label generation tasks involving dynamically changing content:
[0003] Traditional label layout systems use a fixed coordinate mechanism, where the position and height of each element are fixed during the template design phase. This static framework cannot respond to changes in content dimensions caused by data updates. As a result, when a variable text element increases in the number of lines or expands in content, the layout elements below it cannot automatically sense the height change of the preceding elements and adjust their positions accordingly. This leads to overlapping, occlusion, or layout structure errors between elements. These layout defects are particularly prominent in multilingual text line wrapping and barcode positioning scenarios.
[0004] For line break handling in multilingual text, existing technologies generally employ greedy algorithms based on spaces as delimiters. However, when dealing with languages like German and Finnish, which have long compound word structures, this approach tends to forcibly truncate at non-semantic boundaries within compound words, disrupting lexical integrity. For languages like Chinese and Japanese, which do not use spaces as delimiters, the lack of effective semantic unit recognition means it can only rely on the number of characters or bytes for mechanical segmentation, resulting in line breaks that do not conform to linguistic conventions. This inappropriate line break mechanism directly leads to highly abnormal changes in text elements, further exacerbating the aforementioned layout disorder problem.
[0005] Regarding barcode generation and positioning, existing technologies generate barcode output images with a fixed width or use a fixed offset for positioning. When the length of the bound variable data changes, short content barcode images cannot fully utilize the preset container width of the layout element, while long content barcode images may exceed the preset container boundary of the layout element. The existing static positioning method not only fails to ensure that the barcode remains horizontally centered within the specified container, but also causes a decrease in the recognition success rate of scanning devices due to barcode area offset.
[0006] In summary, existing technologies lack an intelligent dynamic layout method suitable for washing label printing, and cannot achieve full-process automation from content adaptation to automatic layout adjustment. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a dynamic layout method for printing washable labels, comprising the following steps:
[0008] Retrieve the definition data of the artwork template, including the initial attributes of multiple layout elements; layout elements include text elements and barcode elements;
[0009] The layout elements are sorted in ascending order based on the absolute value of their initial vertical coordinate distance from the top of the canvas to determine the rendering order.
[0010] The dependency relationships between layout elements are built based on the rendering order, which is used to identify the responsive element corresponding to each layout element; wherein, the rendering order of the responsive element is after the rendering order of the layout element.
[0011] Obtain the tag data to be rendered, including multilingual text data and variable data;
[0012] The layout elements are traversed sequentially. For text elements, line breaks are performed based on the corresponding multilingual text data, using pre-layout and character-level width calculations to determine their actual height. For barcode elements, center positioning is performed based on the corresponding variable data to determine their horizontal position.
[0013] Identify triggering elements whose actual occupied height differs from their initial occupied height;
[0014] Calculate the change in the height of the triggering element, and dynamically adjust the vertical coordinates of the corresponding response element based on the dependency relationship and the change in height.
[0015] Generate and output the print artwork for the care label.
[0016] Optionally, dependencies between layout elements can be built based on the rendering order, including:
[0017] Traverse the layout elements in their rendering order;
[0018] For the current layout element, identify the layout element that is located after it in the rendering order and whose initial position satisfies the preset spatial relationship with the bottom area of the current layout element, and mark it as the responsive element of the current layout element to build the dependency relationship between layout elements.
[0019] Optionally, preset spatial relationships include adjacency or overlap in the vertical direction.
[0020] Optional initial attributes include initial vertical coordinates, initial placeholder height, initial barcode width, initial text box width, font style, and font size.
[0021] Optionally, line wrapping can be performed using pre-layout and pixel-level width calculations, including:
[0022] The engine that supports multilingual word segmentation rules is invoked to pre-format the multilingual text data and generate an initial array of text lines;
[0023] Perform a character-level width calculation on each line of text in the initial text line array to obtain the text rendering width;
[0024] The text rendering width is compared with the initial width of the text box. If the text rendering width is less than or equal to the initial width of the text box, the initial text line array is used as the text line break result; if the text rendering width is greater than the initial width of the text box, the text line break is adjusted and the updated text line array is used as the text line break result.
[0025] Optional, adjust text line breaks as follows:
[0026] If the text rendering width is greater than the initial width of the text box, the reference width used for pre-layout processing will be gradually reduced.
[0027] After each reduction of the reference width, the engine that supports multilingual word segmentation rules is called again to pre-typeset the multilingual text data to obtain the updated text line array;
[0028] Perform a character-level width calculation on each line of text in the updated text line array to obtain the updated text rendering width;
[0029] If the updated text rendering width is less than or equal to the current reference width, and the split point conforms to the semantic segmentation rules of the target language, then the text line break adjustment ends; otherwise, repeat the above steps until the updated text rendering width is less than or equal to the current reference width, and the split point conforms to the semantic segmentation rules of the target language.
[0030] Optionally, centering and positioning processing can be performed based on the corresponding variable data, including:
[0031] Generate barcode images based on variable data;
[0032] Parse the barcode image to obtain its dynamically changing barcode rendering width based on the encoding standard and data length;
[0033] Obtain the initial width of the barcode as a positioning reference.
[0034] The horizontal centering offset is calculated using a preset formula and then assigned to the horizontal coordinate parameter of the barcode element.
[0035] Optionally, based on dependencies and changes in placeholder height, the vertical coordinates of the response element corresponding to the triggering element can be dynamically adjusted, including:
[0036] Based on dependencies, find one or more response elements corresponding to the triggering element;
[0037] Based on the change in the occupied height, update the vertical coordinate parameters of each responsive element; if the responsive element itself is also the trigger element of another layout element, then recursively trigger the adjustment of the vertical coordinates of the next level responsive element.
[0038] Corresponding to the dynamic layout method for printing care labels, the present invention provides a dynamic layout system for printing care labels, comprising:
[0039] The definition data acquisition module is used to acquire the definition data of the artwork template, including the initial attributes of multiple layout elements; the layout elements include text elements and barcode elements;
[0040] The rendering order determination module is used to sort layout elements in ascending order based on the absolute value of their initial vertical coordinate distance from the top of the canvas, in order to determine the rendering order of the layout elements.
[0041] The dependency building module is used to build dependencies between layout elements based on the rendering order, and to identify the corresponding response element for each layout element; wherein the rendering order of the response element is after the rendering order of the layout element.
[0042] The tag data acquisition module is used to acquire tag data to be rendered, including multilingual text data and variable data;
[0043] The dynamic layout module is used to sequentially traverse layout elements. For text elements, it performs line wrapping based on the corresponding multilingual text data through pre-layout and character-level width calculation to determine their actual height. For barcode elements, it performs center positioning based on the corresponding variable data to determine their horizontal position.
[0044] The dynamic adjustment module is used to identify trigger elements whose actual occupy height is different from the initial occupy height; calculate the change in the occupy height of the trigger element, and dynamically adjust the vertical coordinates of the response element corresponding to the trigger element based on the dependency relationship and the change in occupy height.
[0045] The print artwork generation module is used to generate and output print artwork for wash label.
[0046] In addition, to achieve the above objectives, the present invention also provides a computer-readable storage medium storing a dynamic layout program for printing care labels, wherein the dynamic layout program for printing care labels, when executed by a processor, implements the steps of the dynamic layout method for printing care labels as described above.
[0047] Compared with the prior art, the present invention has the following beneficial effects:
[0048] (1) By building dependencies, the linkage between layout elements is realized, which solves the problem of element overlap caused by rigid layout in traditional systems; by adopting a combination of pre-layout and character-level width calculation for line break processing, the semantic destruction of line breaks in multilingual texts in compound words or languages without spaces is solved; by performing centering and positioning processing based on dynamic data, the positioning problem of barcodes being unable to be automatically centered due to length changes is solved; thus, the entire process of water washing label from content self-adaptation to automatic layout adjustment is automated, improving the accuracy and efficiency of batch printing.
[0049] (2) By using the automated construction logic of dependency relationships, the accuracy of response element identification is improved, ensuring that only layout elements that are truly affected are included in the adjustment scope, thus reducing invalid calculations.
[0050] (3) By defining the criteria for determining spatial relationships, layout elements with layout relationships can be accurately identified, avoiding redundant adjustments or omissions due to misjudgment.
[0051] (4) By combining word segmentation engine pre-typesetting with character-level width calculation, the recognition and accurate width measurement of semantic units of multilingual text are realized, and the ability of line break processing to adapt to language characteristics is improved.
[0052] (5) By iteratively reducing the reference width and re-segmenting words at the semantic boundaries, the final line break result satisfies the text box width constraint and retains semantic integrity, avoiding ambiguity caused by forced truncation.
[0053] (6) It realizes dynamic parsing of barcode width and automatic calculation of horizontal centering, solves the visual offset problem of barcodes of different lengths, and improves the stability of scanning device recognition.
[0054] (7) By using a recursive adjustment mechanism, we can ensure that all response elements on the multi-level dependency chain can respond correctly to height changes, avoid the chain overlap problem in the multi-level layout, and realize the dynamic layout adjustment of deep linkage. Attached Figure Description
[0055] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this invention, illustrate exemplary embodiments of the invention and are used to explain the invention, but do not constitute an undue limitation of the invention. In the drawings:
[0056] Figure 1 This is a simplified flowchart of an embodiment of the dynamic layout method for printing wash label according to the present invention;
[0057] Figure 2 This is a schematic diagram of the layout effect of an embodiment of the dynamic layout method for printing wash label according to the present invention;
[0058] Figure 3This is a schematic diagram of another layout effect of an embodiment of the dynamic layout method for printing wash label according to the present invention;
[0059] Figure 4 This is a framework diagram of an embodiment of the dynamic layout system for printing wash label according to the present invention. Detailed Implementation
[0060] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0061] like Figure 1 As shown, a dynamic layout method for printing washable labels according to the present invention includes the following steps:
[0062] Retrieve the definition data of the artwork template, including the initial attributes of multiple layout elements; layout elements include text elements and barcode elements;
[0063] The layout elements are sorted in ascending order based on the absolute value of their initial vertical coordinate distance from the top of the canvas to determine the rendering order.
[0064] The dependency relationships between layout elements are built based on the rendering order, which is used to identify the responsive element corresponding to each layout element; wherein, the rendering order of the responsive element is after the rendering order of the layout element.
[0065] Obtain the tag data to be rendered, including multilingual text data and variable data;
[0066] The layout elements are traversed sequentially. For text elements, line breaks are performed based on the corresponding multilingual text data, using pre-layout and character-level width calculations to determine their actual height. For barcode elements, center positioning is performed based on the corresponding variable data to determine their horizontal position.
[0067] Identify triggering elements whose actual occupied height differs from their initial occupied height;
[0068] Calculate the change in the height of the triggering element, and dynamically adjust the vertical coordinates of the corresponding response element based on the dependency relationship and the change in height.
[0069] Generate and output the print artwork for the care label.
[0070] This invention solves the problem of element overlap caused by rigid layout in traditional systems by building dependency relationships to achieve linkage between layout elements; it solves the semantically destructive line breaks problem in multilingual texts with compound words or languages without spaces by using pre-layout and character-level width calculation for line break processing; it solves the problem of barcodes not being able to automatically center due to length changes by performing centering and positioning processing based on dynamic data; thus, it realizes the full automation of the washing label process from content self-adaptation to automatic layout adjustment, improving the accuracy and efficiency of batch printing.
[0071] In this embodiment, the dependency relationships between layout elements are constructed based on the rendering order, including:
[0072] Traverse the layout elements in their rendering order;
[0073] For the current layout element, identify the layout element that is located after it in the rendering order and whose initial position satisfies the preset spatial relationship with the bottom area of the current layout element, and mark it as the responsive element of the current layout element to build the dependency relationship between layout elements.
[0074] In other embodiments, dependencies may also be built based on user settings. For example, user settings may include:
[0075] During the design phase, users can select the "Affect elements below" option in the element properties panel through the editor interface;
[0076] Alternatively, during the design phase, users can create connecting lines between layout elements by dragging and dropping.
[0077] Alternatively, during the design phase, users can select the element above them from a specified list that they want to follow.
[0078] This invention improves the accuracy of response element identification by automating the dependency construction logic, ensuring that only truly affected layout elements are included in the adjustment scope, and reducing invalid calculations.
[0079] In this embodiment, the preset spatial relationship includes adjacency or overlap in the vertical direction.
[0080] This invention uses a defined criterion for determining spatial relationships to accurately identify layout elements that are related in layout, thus avoiding redundant adjustments or omissions caused by misjudgment.
[0081] In this embodiment, the initial attributes include the initial vertical coordinates, initial placeholder height, initial barcode width, initial text box width, font style, and font size.
[0082] This invention combines word segmentation engine pre-typesetting with character-level width calculation to achieve the recognition and accurate width measurement of semantic units in multilingual texts, thereby improving the adaptability of line break processing to language characteristics.
[0083] In this embodiment, line wrapping is performed through pre-layout and character-level width calculation, including:
[0084] Call an engine that supports multilingual word segmentation rules (including spaces in English, compound word structures in German, and morpheme boundaries in Japanese) (such as the built-in word segmentation engine in fabric.js) to pre-format the multilingual text data and generate an initial array of text lines (within the initial width);
[0085] Perform a character-level width calculation on each line of text in the initial text line array (i.e., calculate the width occupied by each character one by one, and sum them up to get the rendering width of the text line), and obtain the text rendering width;
[0086] The text rendering width is compared with the initial width of the text box. If the text rendering width is less than or equal to the initial width of the text box, the initial text line array is used as the text line break result; if the text rendering width is greater than the initial width of the text box, the text line break is adjusted and the updated text line array is used as the text line break result.
[0087] In this embodiment, the text line breaks are adjusted as follows:
[0088] If the text rendering width is greater than the initial width of the text box, the reference width used for pre-layout processing will be gradually reduced.
[0089] After each reduction of the reference width, the engine that supports multilingual word segmentation rules is called again to pre-typeset the multilingual text data to obtain the updated text line array;
[0090] Perform a character-level width calculation on each line of text in the updated text line array to obtain the updated text rendering width;
[0091] If the updated text rendering width is less than or equal to the current reference width, and the split points conform to the semantic segmentation rules of the target language, then the text line break adjustment ends; otherwise, repeat the above steps until the updated text rendering width is less than or equal to the current reference width, and the split points conform to the semantic segmentation rules of the target language. A split point conforming to the semantic segmentation rules of the target language means that the split point is a semantically correct boundary point (e.g., at word connections or between morphemes).
[0092] Please refer to Figure 2 This invention effectively avoids erroneous line breaks in German compound words and Chinese phrases using traditional layout methods, maintaining semantic integrity and effectively preventing layout overlap. It should be noted that... Figure 2These diagrams are merely illustrative of the layout effect of the present invention and do not constitute an improper limitation of the present invention.
[0093] This invention ensures that the final line break result satisfies the text box width constraint and retains semantic integrity by iteratively reducing the reference width and re-segmenting words at the semantic boundary, thus avoiding ambiguity caused by forced truncation.
[0094] In this embodiment, centering and positioning processing is performed based on the corresponding variable data, including:
[0095] Generate barcode images based on variable data (such as product codes and logistics traceability codes);
[0096] Parse the barcode image to obtain its dynamically changing barcode rendering width based on the encoding standard (e.g., Code 128) and data length;
[0097] Obtain the initial width of the barcode (or the total width of the container containing the barcode element) as a positioning reference.
[0098] The horizontal centering offset is calculated using a preset formula and assigned to the horizontal coordinate parameter of the barcode element; the preset formula is as follows:
[0099] Where Y is the horizontal center offset, Z is the initial width of the barcode, and W is the rendering width of the barcode.
[0100] This invention achieves dynamic parsing of barcode width and automatic calculation of horizontal centering, solves the visual offset problem of barcodes of different lengths, and improves the stability of scanning device recognition.
[0101] In this embodiment, based on the dependency relationship and the change in placeholder height, the vertical coordinates of the response element corresponding to the trigger element are dynamically adjusted, including:
[0102] Based on dependencies, find one or more response elements corresponding to the triggering element;
[0103] Based on the change in place height, update the vertical coordinate parameters of each response element (e.g., move the distance corresponding to the change in place height along the vertical direction); if the response element itself is also the trigger element of another layout element, then recursively trigger the adjustment of the vertical coordinates of the next level response element.
[0104] Please refer to Figure 3 When the product name text changes from a single line (left image) to a double line (right image), the text below it, barcodes, and other elements automatically shift downwards, effectively preventing layout overlap. It should be noted that... Figure 3This is merely a layout illustration of the present invention. Although the trademarks and barcodes in the illustration are partially obscured, this does not affect the display of the layout effect of the present invention and does not constitute an improper limitation of the present invention.
[0105] This invention uses a recursive adjustment mechanism to ensure that all response elements in a multi-level dependency chain can correctly respond to height changes, avoiding the chain overlap problem in multi-level layouts and achieving dynamic layout adjustment with deep linkage.
[0106] like Figure 4 As shown, the present invention also provides a dynamic layout system for printing wash label, comprising:
[0107] The definition data acquisition module 10 is used to acquire the definition data of the artwork template, including the initial attributes of multiple layout elements; the layout elements include text elements and barcode elements;
[0108] The rendering order determination module 20 is used to sort the layout elements in ascending order based on the absolute value of their initial vertical coordinate distance from the top of the canvas, so as to determine the rendering order of the layout elements.
[0109] The dependency building module 30 is used to build dependencies between layout elements based on the rendering order, and to identify the corresponding response element for each layout element; wherein the rendering order of the response element is after the rendering order of the layout element.
[0110] The tag data acquisition module 40 is used to acquire the tag data to be rendered, including multilingual text data and variable data;
[0111] The dynamic layout module 50 is used to sequentially traverse layout elements. For text elements, based on the corresponding multilingual text data, line wrapping is performed through pre-layout and character-level width calculation to determine their actual height. For barcode elements, center positioning is performed based on the corresponding variable data to determine their horizontal position.
[0112] The dynamic adjustment module 60 is used to identify trigger elements whose actual occupy height is different from the initial occupy height; calculate the change in the occupy height of the trigger element; and dynamically adjust the vertical coordinates of the response element corresponding to the trigger element based on the dependency relationship and the change in occupy height.
[0113] The print artwork generation module 70 is used to generate and output the print artwork for the wash label.
[0114] This invention also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the memory described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores at least one instruction, which is loaded and executed by a processor to implement... Figure 1 The diagram illustrates a dynamic layout method for printing wash label. The computer-readable storage medium may be a read-only memory, a hard disk, or an optical disk, etc.
[0115] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments and storage medium embodiments, since they are basically similar to method embodiments, the descriptions are relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0116] Furthermore, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0117] The foregoing description illustrates and describes preferred embodiments of the present invention. It should be understood that the present invention is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the inventive concept by means of the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention should be within the protection scope of the appended claims.
Claims
1. A dynamic layout method for printing wash label, characterized in that, Includes the following steps: Retrieve the definition data of the artwork template, including the initial attributes of multiple layout elements; the layout elements include text elements and barcode elements; the initial attributes include initial vertical coordinates, initial placeholder height, initial width of the barcode, initial width of the text box, font style and font size; The layout elements are sorted in ascending order based on the absolute value of their initial vertical coordinate distance from the top of the canvas to determine the rendering order. The dependency relationships between layout elements are built based on the rendering order, which is used to identify the responsive element corresponding to each layout element; wherein, the rendering order of the responsive element is after the rendering order of the layout element. Obtain the tag data to be rendered, including multilingual text data and variable data; the variable data includes product item numbers and / or logistics traceability codes; The layout elements are traversed sequentially. For text elements, line breaks are performed based on the corresponding multilingual text data through pre-layout and character-level width calculation to determine their actual height. For barcode elements, center positioning is performed based on the corresponding variable data to determine their horizontal position. Character-level width calculation refers to calculating the width occupied by each character. Identify triggering elements whose actual occupied height differs from their initial occupied height; Calculate the change in the height of the triggering element, and dynamically adjust the vertical coordinates of the corresponding response element based on the dependency relationship and the change in height. Generate and output the print artwork for the care label; Line break processing is performed through pre-layout and character-level width calculation, including: calling an engine that supports multilingual word segmentation rules to pre-layout multilingual text data and generate an initial text line array; performing character-level width calculation on each line of text in the initial text line array to obtain the text rendering width; comparing the text rendering width with the initial width of the text box; if the text rendering width is less than or equal to the initial width of the text box, the initial text line array is used as the text line break result; if the text rendering width is greater than the initial width of the text box, the text line break is adjusted, and the updated text line array is used as the text line break result. Centering and positioning processing is performed based on the corresponding variable data, including: generating a barcode image based on the variable data; parsing the barcode image to obtain its dynamically changing barcode rendering width based on the encoding standard and data length; obtaining the initial width of the barcode as a positioning reference; calculating the horizontal centering offset using a preset formula and assigning it to the horizontal coordinate parameter of the barcode element; Dependencies between layout elements are built based on rendering order, including: Traverse the layout elements in their rendering order; For the current layout element, identify the layout element that is located after it in the rendering order and whose initial position satisfies the preset spatial relationship with the bottom area of the current layout element, and mark it as the responsive element of the current layout element to build the dependency relationship between layout elements.
2. The dynamic layout method for printing washable labels according to claim 1, characterized in that, Preset spatial relationships include vertical adjacency or overlap.
3. The dynamic layout method for printing washable labels according to claim 1, characterized in that, Adjust the text line breaks as follows: If the text rendering width is greater than the initial width of the text box, the reference width used for pre-layout processing will be gradually reduced. After each reduction of the reference width, the engine that supports multilingual word segmentation rules is called again to pre-typeset the multilingual text data to obtain the updated text line array; Perform a character-level width calculation on each line of text in the updated text line array to obtain the updated text rendering width; If the updated text rendering width is less than or equal to the current reference width, and the split point conforms to the semantic segmentation rules of the target language, then the text line break adjustment ends; otherwise, repeat the above steps until the updated text rendering width is less than or equal to the current reference width, and the split point conforms to the semantic segmentation rules of the target language.
4. The dynamic layout method for printing wash label according to claim 1, characterized in that, Based on dependencies and changes in placeholder height, dynamically adjust the vertical coordinates of the response element corresponding to the trigger element, including: Based on dependencies, find one or more response elements corresponding to the triggering element; Based on the change in the occupied height, update the vertical coordinate parameters of each responsive element; if the responsive element itself is also the trigger element of another layout element, then recursively trigger the adjustment of the vertical coordinates of the next level responsive element.
5. A dynamic layout system for printing care labels, characterized in that, include: Define the data acquisition module, which is used to acquire the definition data of the artwork template, including the initial attributes of multiple layout elements; Layout elements include text elements and barcode elements; Initial attributes include initial vertical coordinates, initial placeholder height, initial barcode width, initial text box width, font style, and font size; The rendering order determination module is used to sort layout elements in ascending order based on the absolute value of their initial vertical coordinate distance from the top of the canvas, in order to determine the rendering order of the layout elements. The dependency construction module is used to build dependencies between layout elements based on the rendering order, and to identify the corresponding response element for each layout element; wherein the rendering order of the response element is after the rendering order of the layout element; building dependencies between layout elements based on the rendering order includes: traversing the layout elements according to their rendering order; for the current layout element, identifying the layout element that is located after it in the rendering order and whose initial position satisfies a preset spatial relationship with the bottom area of the current layout element, and marking it as the response element of the current layout element, so as to build dependencies between layout elements; The tag data acquisition module is used to acquire the tag data to be rendered, including multilingual text data and variable data; the variable data includes product item numbers and / or logistics traceability codes. The dynamic layout module iterates through layout elements sequentially. For text elements, it performs line wrapping based on the corresponding multilingual text data, using pre-layout and character-level width calculation to determine their actual height. For barcode elements, it performs center positioning based on the corresponding variable data to determine their horizontal position. Character-level width calculation refers to calculating the width occupied by each character individually. The line wrapping process, using pre-layout and character-level width calculation, includes: calling an engine that supports multilingual word segmentation rules to pre-layout the multilingual text data, generating an initial text line array; and performing character-level width calculation on each line of text in the initial text line array to obtain the text rendering width. The text rendering width is compared with the initial width of the text box. If the text rendering width is less than or equal to the initial width of the text box, the initial text line array is used as the text line break result. If the text rendering width is greater than the initial width of the text box, the text line break is adjusted, and the updated text line array is used as the text line break result. Centering and positioning processing is performed based on the corresponding variable data, including: generating a barcode image based on the variable data; parsing the barcode image to obtain its dynamically changing barcode rendering width based on the encoding standard and data length; obtaining the initial width of the barcode as the positioning reference; calculating the horizontal centering offset using a preset formula and assigning it to the horizontal coordinate parameter of the barcode element. The dynamic adjustment module is used to identify trigger elements whose actual occupy height is different from the initial occupy height; calculate the change in the occupy height of the trigger element, and dynamically adjust the vertical coordinates of the response element corresponding to the trigger element based on the dependency relationship and the change in occupy height. The print artwork generation module is used to generate and output print artwork for wash label.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a dynamic layout program for printing care labels, which, when executed by a processor, implements the steps of the dynamic layout method for printing care labels as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and system for processing text advertisement
CN102999512A
Automatic label typesetting and layout method and system, electronic equipment and storage medium
CN116663088A