Dynamic layout method and system for washing label printing and medium

By constructing dependencies between layout elements and pre-layout processing, the layout of the care label is dynamically adjusted, solving the problems of layout disorder and unstable barcode positioning caused by dynamic content changes in traditional systems, and achieving efficient and accurate care label printing.

CN121478210AActive Publication Date: 2026-02-06XIAMEN XINDA LIANKE INFORMATION TECH CO LTD

Patent Information

Application Number
CN202610025985.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-09
Publication Date
2026-02-06
Estimated Expiration
2046-01-09

AI Technical Summary

Technical Problem

Traditional wash label printing systems cannot adapt to dynamic content changes, resulting in overlapping, obscuring, or misaligned layout elements, especially in scenarios involving multilingual text line breaks and barcode positioning.

Method used

By establishing dependencies between layout elements and combining pre-layout with character-level width calculation, the vertical coordinates and horizontal positions of elements are dynamically adjusted to achieve adaptive layout.

Benefits of technology

It achieves full automation of the water care label process, from content adaptation to automatic layout adjustment, improving the accuracy and efficiency of batch printing and solving the problems of semantically destructive line breaks in multilingual text and unstable barcode positioning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121478210A_ABST
    Figure CN121478210A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic layout method and system for washing label printing and a medium, and the method comprises the steps: obtaining definition data of a draft template, including initial attributes of a plurality of layout elements; determining a rendering sequence of the layout elements; constructing a dependency relationship among the layout elements based on the rendering sequence, wherein the dependency relationship is used for identifying a response element corresponding to each layout element; obtaining label data to be rendered, wherein the label data comprises multi-language text data and variable data; traversing the layout elements in sequence, and performing line feed processing on the text elements based on the corresponding multi-language text data to determine the actual occupation height of the text elements; for the bar code element, performing centering positioning processing based on the corresponding variable data, and determining the horizontal position of the bar code element; identifying the trigger element with the actual occupation height different from the initial occupation height; calculating the placeholder height variation of the trigger element, and dynamically adjusting the vertical coordinate of the response element corresponding to the trigger element based on the dependency relationship and the placeholder height variation; and generating and outputting a printed draft of the washing label.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of water washing mark label printing, and in particular to a dynamic layout method, system and medium for water washing mark printing. BACKGROUND

[0002] Traditional label layout systems usually process dynamic content based on static template frameworks, but in the field of automatic printing of water washing mark labels, the system has the following technical defects when dealing with label generation tasks with dynamically changing content: Because the traditional label layout system uses a fixed coordinate mechanism, the position and height of each element are fixed in the template design stage. This static framework cannot respond to changes in content dimensions caused by data updates, resulting in the inability of layout elements below variable text elements to automatically perceive changes in the height of previous elements and adjust their positions when the number of lines or content of the variable text elements increases, thereby causing overlapping, blocking or layout structure disorder between elements. The above layout defects are particularly prominent in the scenarios of multi-language text wrapping and barcode positioning.

[0003] For the wrapping of multi-language text, existing technologies generally use a greedy algorithm based on space separators to perform line breaking. However, this processing method is prone to forced truncation at non-semantic boundaries within compound words when dealing with languages such as German and Finnish that have long compound word structures, which destroys the integrity of the words. For languages such as Chinese and Japanese that do not have space separators, the lack of effective semantic unit recognition capability forces them to rely on character count or byte count for mechanical cutting, resulting in wrapping positions that do not conform to language habits. This inappropriate wrapping mechanism directly causes abnormal changes in the height of text elements, further exacerbating the layout disorder problem.

[0004] In terms of barcode generation and positioning, the width of the barcode output image generated by existing technologies is fixed or positioned with a fixed offset. When the length of the bound variable data changes, short content barcode images cannot fully utilize the preset container width of the layout elements, while long content barcode images may exceed the preset container boundaries of the layout elements. The static positioning method of existing technologies not only cannot ensure that the barcode always remains horizontally centered within the specified container, but also causes the scanning device to have a lower recognition success rate due to the offset of the barcode region.

[0005] In summary, existing technologies lack an intelligent dynamic layout method suitable for water washing mark label printing, and cannot achieve full-process automation from content adaptation to layout automatic adjustment. SUMMARY

[0006] To solve the above technical problems, the present application provides a dynamic layout method for water washing mark printing, which includes the following steps: Obtaining definition data of the artwork template, including initial attributes of a plurality of layout elements; the layout elements include text elements and barcode elements; Performing ascending order sorting based on absolute values of distances of initial vertical coordinates from a top of the canvas, to determine a rendering order of the layout elements; Constructing a dependency relationship among the layout elements based on the rendering order, to identify a response element corresponding to each layout element; wherein the rendering order of the response element is after the rendering order of the layout element; Obtaining label data to be rendered, including multilingual text data and variable data; Sequentially traversing the layout elements, for the text elements, performing line break processing through pre-layout and glyph-level width calculation based on the corresponding multilingual text data, to determine actual occupied heights thereof; for the barcode elements, performing center positioning processing based on the corresponding variable data, to determine horizontal positions thereof; Identifying a trigger element whose actual occupied height is different from an initial occupied height; Calculating an occupied height change amount of the trigger element, and dynamically adjusting a vertical coordinate of a response element corresponding to the trigger element based on the dependency relationship and the occupied height change amount; Generating and outputting a print artwork of the laundry label.

[0007] Optionally, constructing the dependency relationship among the layout elements based on the rendering order comprises: Traversing the layout elements according to the rendering order thereof; For a current layout element, identifying a layout element that is after the current layout element in the rendering order and whose initial position meets a preset spatial relationship with a bottom region of the current layout element, marking the layout element as a response element of the current layout element, to construct the dependency relationship among the layout elements.

[0008] Optionally, the preset spatial relationship includes a vertical direction adjacent relationship or an overlapping relationship.

[0009] Optionally, the initial attributes include an initial vertical coordinate, an initial occupied height, a barcode initial width, a text box initial width, a font style and a font size.

[0010] Optionally, performing the line break processing through pre-layout and glyph-level width calculation comprises: Calling an engine supporting multilingual tokenization rules to perform pre-layout processing on the multilingual text data, to generate an initial text line array; Performing glyph-level width calculation on each line of text in the initial text line array, to obtain a 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 division result; if the text rendering width is greater than the initial width of the text box, the text line division is adjusted, and the updated text line array is used as the text line division result.

[0011] Optionally, the text line division is adjusted, and the adjustment specifically comprises: If the text rendering width is greater than the initial width of the text box, the reference width used for the pre-layout processing is gradually reduced; After each reduction of the reference width, the engine supporting the multi-language word segmentation rule is called again to perform the pre-layout processing on the multi-language text data, and an updated text line array is obtained; The character-level width calculation is performed on each line of text in the updated text line array, and an updated text rendering width is obtained; If the updated text rendering width is less than or equal to the current reference width, and the segmentation point meets the semantic segmentation rule of the target language, the text line division adjustment is ended; otherwise, the above steps are repeated until the condition is met.

[0012] Optionally, the centering positioning processing is performed based on the corresponding variable data, comprising: A barcode image is generated according to the variable data; The barcode image is parsed to obtain a barcode rendering width dynamically changed based on a coding standard and a data length; The initial width of the barcode is obtained as a positioning reference datum; A horizontal centering offset is calculated through a preset formula, and the horizontal centering offset is assigned to a horizontal coordinate parameter of the barcode element.

[0013] Optionally, based on the dependency relationship and the placeholder height change amount, the vertical coordinates of the response elements corresponding to the trigger element are dynamically adjusted, comprising: Based on the dependency relationship, one or more response elements corresponding to the trigger element are found; According to the placeholder height change amount, the vertical coordinate parameters of each response element are updated; wherein, if the response element itself is also a trigger element of another layout element, the vertical coordinate adjustment of the next level of response element is recursively triggered.

[0014] Corresponding to the dynamic layout method for water washing mark printing, the application provides a dynamic layout system for water washing mark printing, comprising: A definition data acquisition module is configured to acquire definition data of a graphic template, including initial attributes of a plurality of layout elements; the layout elements include text elements and barcode elements; A rendering order determination module is configured to perform ascending order sorting based on absolute values of distances of initial vertical coordinates from the top of a canvas, so as to determine a rendering order of the layout elements; 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. The tag data acquisition module is used to acquire tag data to be rendered, including multilingual text data and variable data; 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. 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.

[0015] 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.

[0016] Compared with the prior art, the present invention has the following beneficial effects: (1) By building dependencies to achieve linkage between layout elements, the problem of element overlap caused by rigid layout in traditional systems is solved; 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 problem of barcodes not being able 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.

[0017] (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.

[0018] (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.

[0019] (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.

[0020] (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.

[0021] (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.

[0022] (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

[0023] 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: Figure 1 This is a simplified flowchart of an embodiment of the dynamic layout method for printing wash label according to the present invention; 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; Figure 3 This 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; 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

[0024] 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.

[0025] like Figure 1 As shown, a dynamic layout method for printing washable labels according to the present invention includes the following steps: Retrieve the definition data of the artwork template, including the initial attributes of multiple layout elements; layout elements include text elements and barcode elements; 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 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. 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.

[0026] 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.

[0027] In this embodiment, the dependency relationships between layout elements are constructed based on the 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.

[0028] In other embodiments, dependencies may also be built based on user settings. For example, user settings may include: During the design phase, users can select the "Affect elements below" option in the element properties panel through the editor interface; Alternatively, during the design phase, users can create connecting lines between layout elements by dragging and dropping. Alternatively, during the design phase, users can select the element above them from a specified list that they want to follow.

[0029] 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.

[0030] In this embodiment, the preset spatial relationship includes adjacency or overlap in the vertical direction.

[0031] 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.

[0032] 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.

[0033] 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.

[0034] In this embodiment, line wrapping is performed through pre-layout and character-level width calculation, including: 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); 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; 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.

[0035] In this embodiment, the text line breaks are adjusted 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 condition is met. The split point conforms to the semantic segmentation rules of the target language, that is, the split point is a semantically correct boundary point (e.g., word connection, between morphemes).

[0036] 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 2 These diagrams are merely illustrative of the layout effect of the present invention and do not constitute an improper limitation of the present invention.

[0037] 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.

[0038] In this embodiment, centering and positioning processing is performed based on the corresponding variable data, including: Generate barcode images based on variable data (such as product codes and logistics traceability codes); Parse the barcode image to obtain its dynamically changing barcode rendering width based on the encoding standard (e.g., Code 128) and data length; Obtain the initial width of the barcode (or the total width of the container containing the barcode element) as a positioning reference. 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: Where Y is the horizontal center offset, Z is the initial width of the barcode, and W is the rendering width of the barcode.

[0039] 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.

[0040] 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: Based on dependencies, find one or more response elements corresponding to the triggering element; 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.

[0041] Please refer toFigure 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 3 This is merely a layout effect illustration of the present invention. Although the trademarks and barcodes in the illustration are partially obscured, it does not affect the display of the layout effect of the present invention and does not constitute an improper limitation of the present invention.

[0042] 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.

[0043] like Figure 4 As shown, the present invention also provides a dynamic layout system for printing wash label, comprising: 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; 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. 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. The tag data acquisition module 40 is used to acquire the tag data to be rendered, including multilingual text data and variable data; 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. 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. The print artwork generation module 70 is used to generate and output the print artwork for the wash label.

[0044] 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.

[0045] 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.

[0046] 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.

[0047] 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 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. 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.

2. The dynamic layout method for printing washable labels according to claim 1, characterized in that, 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.

3. The dynamic layout method for printing washable labels according to claim 2, characterized in that, Preset spatial relationships include vertical adjacency or overlap.

4. The dynamic layout method for printing wash label 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 segmentation 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 condition is met.

5. The dynamic layout method for printing washable labels 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.

6. 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 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. The tag data acquisition module is used to acquire tag data to be rendered, including multilingual text data and variable data; The dynamic layout module sequentially traverses layout elements. For text elements, based on the corresponding multilingual text data, it performs line wrapping 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. The line wrapping through 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; performing character-level width calculation on each line of text in the initial text line array to obtain the text rendering width; and then merging the text rendering width with the initial text box width. The initial width is compared. If the rendered text 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 rendered text 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.

7. 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 5.

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

  • Vertical character display method and device

    CN117236280A

  • Medical record text typesetting method and system, storage medium and electronic equipment

    CN117371446A

  • Language-driven automated text formatting

    CN117561516A

Cited By

  • A method for converting general printing instructions into device-specific instructions

    CN122331847A