Text line height adjustment method, device, electronic device and readable storage medium

By obtaining and using the row height mapping table to automatically adjust the text line height in the UI design draft, the problem of manual cross-platform modification is solved, and the unified display effect of the design draft on different platforms is achieved.

CN114417783BActive Publication Date: 2025-08-05上海瑞家信息技术有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111670127.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-08-05
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

In UI design drafts designed on different platforms, the line height of text elements needs to be manually modified one by one, resulting in waste of resources and omissions, affecting the restoration of the design draft.

Method used

By obtaining the row height mapping table of the target platform, determining the row height value of the text element to be adjusted in the target design draft based on the input, and using the mapping table for automatic batch adjustment, achieving high uniformity of text lines across platforms.

Benefits of technology

It improves the restore degree of UI design drafts on multiple platforms, reduces the steps of manual modification, and improves design efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417783B_ABST
    Figure CN114417783B_ABST
Patent Text Reader

Abstract

The present invention provides a text line height adjustment method, device, electronic device and storage medium, which relate to the field of UI interface design. The method is applied to a preset drawing application, and the method includes: obtaining a line height mapping table corresponding to a target platform; in response to a received first input for a target design draft, determining the line height value of a text element corresponding to the first input in the target design draft, wherein the target design draft is a user interface UI design draft of a preset application for display on the target platform, and the target design draft is located in the design interface of the preset drawing application; adjusting the line height of the text element corresponding to the first input according to the line height mapping table and the line height value. Therefore, it can solve the problem in the related art that for each platform, manual repeated adjustment is required to modify the line height of each text element in the design draft one by one.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of UI interface design, and in particular to a text line height adjustment method, device, electronic device and readable storage medium. Background Art

[0002] In existing technologies, UI (User Interface) designers, while collaborating with developers on different platforms (iOS, Android), often find that the line height of the same font size is inconsistent across platforms. To improve the fidelity of design drafts across platforms, designers need to determine the line height of text elements in the design draft based on the platform's font line height correspondence and manually modify the height of each text element in the design draft. In actual application, due to the large number of platforms and text elements in the design draft, a significant amount of design resources is required. Furthermore, manual modifications inevitably lead to omissions, resulting in a significant number of UI issues during development.

[0003] To address the above-mentioned problems, no effective technical solutions have been proposed so far. Summary of the Invention

[0004] Embodiments of the present invention provide a text line height adjustment method, device, electronic device and readable storage medium to solve the problem in related technologies that the line height of each text element in a design draft needs to be manually modified one by one for each platform.

[0005] In order to solve the above-mentioned technical problems, the present invention is achieved as follows:

[0006] In a first aspect, an embodiment of the present invention provides a method for adjusting text line height, which is applied to a preset drawing application, the method comprising: obtaining a line height mapping table corresponding to a target platform; in response to a received first input for a target design draft, determining a line height value of a text element corresponding to the first input in the target design draft, wherein the target design draft is a user interface UI design draft of a preset application displayed on the target platform, and the target design draft is located in the design interface of the preset drawing application; adjusting the line height of the text element corresponding to the first input according to the line height mapping table and the line height value.

[0007] Furthermore, the obtaining of the row height mapping table corresponding to the target platform includes: determining platform information of the target platform in response to the received second input for the target design draft; and obtaining the row height mapping table according to the platform information.

[0008] Furthermore, determining the line height value of the text element corresponding to the first input in the target design draft includes: determining the content to be adjusted corresponding to the first input in the target design draft in response to the first input; traversing the content to be adjusted to obtain multiple different first line height values corresponding to multiple groups of text elements.

[0009] Furthermore, the adjusting the row height of the text elements according to the row height mapping table and the row height value includes: determining multiple second row height values according to the multiple first row height values and the row height mapping table; and adjusting the row height of the multiple groups of text elements according to the multiple second row height values.

[0010] Furthermore, the target design draft includes at least one artboard, and determining the content to be adjusted corresponding to the first input in the target design draft includes: when the first input corresponds to at least one target artboard, determining the text elements in the at least one target artboard as the content to be adjusted; or, when the first input corresponds to partial content in a target artboard, determining the text elements corresponding to the partial content as the content to be adjusted.

[0011] In the second aspect, an embodiment of the present invention further provides a text line height adjustment device, which is applied to a preset drawing application, and the device includes: an acquisition module, used to obtain a line height mapping table corresponding to the target platform; a determination module, used to determine the line height value of the text element corresponding to the first input in the target design draft in response to a first input received for the target design draft, wherein the target design draft is a user interface UI design draft of a preset application displayed on the target platform, and the target design draft is located in the design interface of the preset drawing application; an adjustment module, used to adjust the line height of the text element corresponding to the first input according to the line height mapping table and the line height value.

[0012] Furthermore, the acquisition module includes: a first determination unit, configured to determine platform information of the target platform in response to the received second input for the target design draft; and an acquisition unit, configured to acquire the row height mapping table according to the platform information.

[0013] Furthermore, the determination module includes: a receiving unit, used to determine the content to be adjusted corresponding to the first input in the target design draft in response to the first input; a traversal unit, used to traverse the content to be adjusted to obtain multiple different first line height values corresponding to multiple groups of text elements.

[0014] Furthermore, the adjustment module includes: a second determination unit, used to determine multiple second row height values based on the multiple first row height values and the row height mapping table; an adjustment unit, used to adjust the row heights of the multiple groups of text elements according to the multiple second row height values.

[0015] Furthermore, the target design draft includes at least one artboard, wherein the receiving unit includes: a determination subunit, used to determine the text elements in the at least one target artboard as the content to be adjusted when the first input corresponds to the at least one target artboard; or, used to determine the text elements corresponding to the partial content in a target artboard as the content to be adjusted when the first input corresponds to the partial content.

[0016] In a third aspect, an embodiment of the present invention further provides an electronic device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the text line height adjustment method as described in the first aspect are implemented.

[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the text line height adjustment method as described in the first aspect are implemented.

[0018] In an embodiment of the present invention, a line height mapping table corresponding to the target platform is obtained; in response to a received first input for a target design draft, the line height value of the text element corresponding to the first input in the target design draft is determined, wherein the target design draft is a user interface UI design draft of a preset application for display on the target platform, and the target design draft is located in the design interface of a preset drawing application; the line height of the text element corresponding to the first input is adjusted according to the line height mapping table and the line height value. Even for multiple platforms, for each platform, the line height of the text element corresponding to the first input in the target design draft can be automatically adjusted in batches according to the line height value of the text element corresponding to the first input in the target design draft and the line height mapping table of the target platform, which can effectively improve the restoration degree of the UI design draft on multiple platforms and improve the efficiency of the development process of the design draft for multiple platforms. It further solves the problem in the related art that the line height of each text element in the design draft needs to be manually modified one by one for each platform.

[0019] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are specifically listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0021] Figure 1 is a flowchart of a method for adjusting text line height in an embodiment of the present invention;

[0022] Figure 2 is a flowchart of another method for adjusting text line height in an embodiment of the present invention;

[0023] Figure 3 It is a structural diagram of a text line height adjustment device in an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0025] Example 1

[0026] According to an embodiment of the present invention, a text line height adjustment method is provided, which is applied to a preset drawing application, such as Figure 1 As shown, the method may specifically include the following steps:

[0027] S102, obtaining a row height mapping table corresponding to the target platform;

[0028] Specifically, the target design draft is a design draft that is manually designed in a preset drawing application and is used to be published to at least one platform. The target design draft is a UI design draft of an application preset in the platform. Usually, the target design draft includes picture elements, audio and video elements, and text elements. Among them, the line height of the text elements in the target design draft has been set during the design, but before the preset application is published to the target platform (one or more), the line height of the text elements in the original design draft needs to be modified according to the display effect of the platform to maintain the original display effect of the text elements in the original design draft on the platform. Among them, for each target platform, steps S102 to S106 are executed.

[0029] In addition, the target platform in this embodiment includes but is not limited to an operating system (such as iOS, Android, etc.), a browser, and an application, and can also be a combination of an operating system, a browser, and an application. The display effects of the same target design draft in different operating systems and different browsers may be different, so it is necessary to adjust the text line height of the target design draft for different operating systems or different browsers to preserve the original display effect of the target design draft.

[0030] In this embodiment, the target platform's platform information is used to obtain a row height mapping table corresponding to the target platform. The row height of the text element selected by the user's first input in the target platform is then determined, and the row height of the text element corresponding to the user's first input in the target design draft is adjusted according to the row height mapping table corresponding to the target platform. This ensures that the display effect of the target design draft in the target platform after the row height adjustment is consistent with the display effect in the preset drawing application before the row height adjustment.

[0031] The line height mapping table in this embodiment can be stored in a database of a preset drawing application and can be called by a preset plug-in in the preset drawing application. The line height mapping table is used to represent the mapping relationship between the original text line height of the target design in the preset drawing application and the displayed text line height on the target platform. The text line height of the target design on the target platform can be obtained from the line height mapping table based on the original text line height, thereby preserving the original display effect of the target design in the preset drawing application.

[0032] Optionally, in this embodiment, obtaining the row height mapping table corresponding to the target platform includes but is not limited to: determining the platform information of the target platform in response to the received second input for the target design draft; and obtaining the row height mapping table based on the platform information.

[0033] It should be noted that the second input can be a preset plug-in that operates within a preset drawing application, or a preset plug-in that operates directly within the design interface of the preset drawing application. The second input includes, but is not limited to, directly entering the target platform's platform information into the preset plug-in input box, selecting the target platform option for the preset plug-in, and other operations. In this embodiment, the target platform's platform information is obtained by receiving the user's second input.

[0034] In actual application scenarios, platform information includes but is not limited to operating system, operating system version, browser, browser version, and other information. The platform information can be pre-set or input or specified by the user. After obtaining the platform information of the target platform, a row height mapping table corresponding to the platform information can be obtained based on multiple pre-stored row height mapping lists. Each target platform can correspond to a row height mapping list. If the row height mapping lists of at least two platforms are the same, then at least two platforms can be mapped to the row height mapping list.

[0035] For example, if the platform information of the target platform indicates that the target platform is the iOS system, the row height mapping table corresponding to the iOS system can be obtained. For another example, if the platform information of the target platform indicates that the target platform is the Google Chrome in the Android system, the row height mapping table corresponding to the Google Chrome in the Android system can be obtained.

[0036] Through the above embodiment, the corresponding line height mapping table is obtained by using the platform information determined by the second input to achieve the adaptation of the text line height of the target design draft in different platforms, thereby achieving the original text display effect of the target design draft in different platforms.

[0037] S104, in response to receiving a first input for a target design draft, determining a line height value of a text element corresponding to the first input in the target design draft, wherein the target design draft is a user interface UI design draft of a preset application for display on the target platform, and the target design draft is located in a design interface of the preset drawing application.

[0038] By responding to the first input of the target design draft, the text elements corresponding to the first input in the target design draft can be traversed to determine the line height value of the text element corresponding to the first input, and then the line height of the text element corresponding to the first input can be adjusted according to the line height mapping table corresponding to the target platform.

[0039] In this embodiment, the first input includes but is not limited to a selection operation on a text element or an artboard in the target design draft. By determining that the first input is a selection operation on a text element or an artboard in the target design draft, the text element that needs to have its text line height adjusted is determined.

[0040] It should be noted that the first input may be a selection operation for all text elements in the target design draft, or may be a selection operation based on some text elements in the target design draft.

[0041] In this embodiment, the line height value of the text element can be determined based on the font size of the characters in the text element, or it can be determined based on the size of the pixel value occupied by the text element in the target design draft. The specific method for determining the line height value has mature practices in the relevant technology and will not be described in detail in this embodiment.

[0042] Optionally, in this embodiment, in response to the first input, the content to be adjusted corresponding to the first input in the target design draft is determined; and the content to be adjusted is traversed to obtain multiple different first line height values corresponding to multiple groups of text elements.

[0043] In this embodiment, the first input includes, but is not limited to, selecting a text element or an artboard in the target design draft. The first input may be performed via a preset plug-in, or directly selecting a text element or an artboard in the target design draft in a preset drawing application.

[0044] In one example, a preset drawing application includes a preset plug-in. By detecting a selection operation applied to the preset plug-in, in response to the selection operation applied to the preset plug-in, a target design draft of a design interface in the preset drawing application is selected. By selecting a text element in the target design draft, the selected text element is determined to be the content to be adjusted.

[0045] In actual application scenarios, text elements in a target design draft can be grouped according to font size. The target design draft includes one or more groups of text elements with different font sizes. Each font size corresponds to a line height, and the line height values of multiple groups of text elements are different.

[0046] In this implementation, it is possible to determine that the text element selected by the first input is the content to be adjusted, traverse the text elements in the content to be adjusted, obtain the line height values of the text elements in the content to be adjusted, and then group the text elements in the content to be adjusted according to the font size or line height value, group the text elements with the same font size or the same line height value into a group, and obtain multiple different first line height values corresponding to multiple groups of text elements. Further, determine the line height value of each group of text elements separately.

[0047] In one example, if the content to be adjusted is the target design draft, the text elements in the target design draft are traversed to obtain font size 13 and font size 18. The text elements are then grouped to obtain a group of text elements with font size 13 and a group of text elements with font size 18. According to the Android system's line height mapping table, the line height of font size 13 in the Android system is 18 points, and the line height of font size 18 in the Android system is 25 points.

[0048] Through the above embodiment, in response to the first input, the content to be adjusted corresponding to the first input in the target design draft is determined; the content to be adjusted is traversed to obtain multiple different first line height values corresponding to multiple groups of text elements, so as to realize batch acquisition of the line height values of the text elements corresponding to the first input.

[0049] This embodiment does not limit the order of step S102 and step S104.

[0050] S106: Adjust the row height of the text element corresponding to the first input according to the row height mapping table and the row height value.

[0051] After determining the row height mapping table and the row height value of the text element corresponding to the first input, the row height value of the text element is converted based on the row height value of the text element and compared with the row height mapping table to obtain the row height value of the text element corresponding to the first input in the target design draft on the target platform. The text element corresponding to the first input is then adjusted based on the row height value on the target platform. Thus, when the adjusted target design draft is published on the target platform, the target design draft can maintain its original display effect in the preset drawing application.

[0052] Optionally, in this embodiment, the line height of text elements is adjusted according to the line height mapping table and the line height value, including but not limited to: determining multiple second line height values based on multiple first line height values and the line height mapping table; adjusting the line height of multiple groups of text elements according to the multiple second line height values.

[0053] Specifically, in this embodiment, after traversing the target design draft to determine the content to be adjusted, multiple groups of text elements corresponding to multiple first-line height values in the content to be adjusted are obtained, and each group of text elements corresponds to a first-line height value, and the above-mentioned multiple first-line height values are all different. Then, based on the mapping relationship between the multiple first-line height values and the multiple second-line height values in the line height mapping table corresponding to the target platform, multiple second-line height values mapped by the multiple first-line height values in the line height mapping table are obtained, and then for each group of text elements, the line height corresponding to the first-line height value of each group of text elements is adjusted to the line height indicated by the second-line height value corresponding to the first-line height value. It should be noted that the above-mentioned first-line height value and second-line height value are for distinction, and are not intended to limit the line height values corresponding to the text elements.

[0054] In one example, if the target design draft includes a set of text elements in a size 13 font and a set of text elements in a size 18 font, where the line height of the size 13 font is 18 points and the line height of the size 18 font is 25 points, and assuming the target platform is Android, according to the Android system's line height mapping table, the line height of the size 13 font in Android is determined to be 19 points and the line height of the size 18 font in Android is determined to be 26 points.

[0055] In addition, in this embodiment, the content to be adjusted in the target design draft is selected through the first input, and then a plurality of different first line height values in the content to be adjusted are determined, and the platform information of the target platform is obtained according to the second input, and then the line height mapping table corresponding to the target platform is determined, and a plurality of different second line height values corresponding to the plurality of different first line height values are determined; finally, based on the third input, it is determined to adjust the line height of the text elements in the content to be adjusted.

[0056] It should be noted that when receiving the first input and the second input for the target design draft, the target design draft is in an optional or editable state. By receiving the third input, the line height mapping table and multiple different second line height values can be determined to adjust the line height of the text elements in the content to be adjusted.

[0057] The third input includes but is not limited to a confirmation operation on a preset plug-in in a preset drawing application, or a confirmation operation on a target design draft in a preset drawing application.

[0058] Through the above example, multiple second row height values are determined based on multiple first row height values and a row height mapping table; the row heights of multiple groups of text elements are adjusted based on the multiple second row height values to achieve batch row height adjustment of text elements with different row heights in the target design draft.

[0059] Optionally, in this embodiment, the target design draft may include at least one artboard, and determining the content to be adjusted corresponding to the first input in the target design draft may include but is not limited to: when the first input corresponds to at least one target artboard, determining the text elements in the at least one target artboard as the content to be adjusted; or, when the first input corresponds to partial content in a target artboard, determining the text elements corresponding to the partial content as the content to be adjusted.

[0060] In actual application scenarios, a target design draft in a drawing application typically consists of one or more parts. For example, the target design draft includes multiple artboards, with text elements distributed across one or more of the artboards. The user's desired content to be adjusted in the target design draft can be determined based on the user's first input. In this embodiment, the content to be adjusted can be based on artboards or text elements, for example, selecting a text element of a certain font size as the content to be adjusted, or selecting a text element at a certain position within the artboard as the content to be adjusted.

[0061] In one example, a first input applied to a target design draft is received, the first input corresponding to at least one target artboard. An artboard in the target design draft is selected, and text elements in the at least one target artboard corresponding to the first input are determined as content to be adjusted. The process can traverse each artboard separately and adjust the line height of the text elements in each artboard individually, or it can traverse multiple artboards and then uniformly adjust the line height of the text elements in the multiple artboards.

[0062] In another example, a first input corresponds to a portion of content (multiple different portions) in a target artboard, and is used to select a portion of text elements in the target artboard. The portion of content (multiple different portions of text elements) in the target artboard corresponding to the first input is determined based on the first input, and the text elements corresponding to the portion of content are determined as content to be adjusted. For example, multiple portions of text elements in the same artboard are determined as content to be adjusted.

[0063] In another example, the first input corresponds to part of the content (the same part) in a target canvas, and is used to select part of the text elements (the same part of the text elements) in the target canvas. By receiving the font size or line height value of the text element corresponding to the first input, the text element corresponding to the font size or the line height value in the target design draft is determined to be the content to be adjusted.

[0064] Through the above examples, when the first input corresponds to at least one target artboard, the text elements in the at least one target artboard are determined as the content to be adjusted; or, when the first input corresponds to part of the content in a target artboard, the text elements corresponding to the part of the content are determined as the content to be adjusted, so that the line height of the text elements in the target design draft can be adjusted in batches and flexibly.

[0065] Through this embodiment, even for multiple platforms, for each platform, the line height of the text elements corresponding to the first input in the target design draft can be automatically adjusted in batches based on the line height value of the text elements corresponding to the first input in the target design draft and the line height mapping table of the target platform. This can effectively improve the restoration of UI design drafts on multiple platforms and improve the efficiency of the design draft development process for multiple platforms. This further solves the problem in related technologies of manually modifying the line height of each text element in the design draft for each platform.

[0066] Example 2

[0067] A text line height adjustment method provided by an embodiment of the present invention is described in detail. The method is applied to the Sketch drawing software. A line height adjustment plug-in is preset in the Sketch drawing software, such as Figure 2 As shown, the following steps may be specifically included:

[0068] S201, obtaining platform information of the target platform;

[0069] Specifically, there is a target design draft in the Sketch drawing software, and user input acting on a line height adjustment plug-in in the Sketch drawing software is received. For example, the user input includes platform information of the target platform, and the platform information is the iOS operating system.

[0070] S202, obtaining a row height mapping table corresponding to the target platform according to the platform information;

[0071] Specifically, based on the platform information, a corresponding row height mapping table in the target platform iOS operating system is obtained from the database of the sketch drawing software.

[0072] S203, obtaining the content of the target design draft selected by the user;

[0073] Specifically, the target design manuscript of the sketch drawing software includes multiple artboards. According to the target artboard selected by the user, the text elements in the target artboard are traversed, and the line heights of the text elements in the target artboard are determined respectively.

[0074] S204, obtaining the corresponding row height from the row height mapping table;

[0075] Specifically, according to the line height of the text element in the target artboard, a corresponding line height is selected from the line height mapping table.

[0076] S205: Modify the text height in the target drawing board.

[0077] Specifically, the line height of the text element in the target artboard is adjusted according to the corresponding line height selected from the line height mapping table.

[0078] Through the above embodiment, even for multiple platforms, the line heights of text elements corresponding to the first input in the target design draft can be automatically adjusted in batches based on the line height values of the text elements corresponding to the first input in the target design draft and the target platform's line height mapping table. This effectively improves the fidelity of UI design drafts across multiple platforms and increases the efficiency of the design draft development process for multiple platforms. This further solves the problem in related technologies of manually modifying the line height of each text element in the design draft for each platform.

[0079] Example 3

[0080] A text line height adjustment device provided by an embodiment of the present invention is introduced in detail.

[0081] Reference Figure 3 , shows a structural schematic diagram of a text line height adjustment device in an embodiment of the present invention.

[0082] The application loading device according to the embodiment of the present invention includes: an acquisition module 30 , a determination module 32 , and an adjustment module 34 .

[0083] The functions of each module and the interactions between them are introduced in detail below.

[0084] An acquisition module 30 is used to obtain a row height mapping table corresponding to a target platform;

[0085] a determination module 32 configured to, in response to a received first input for a target design draft, determine a line height value of a text element in the target design draft corresponding to the first input, wherein the target design draft is a user interface (UI) design draft of a preset application for display on the target platform, and the target design draft is located in a design interface of the preset drawing application;

[0086] The adjustment module 34 is configured to adjust the row height of the text element corresponding to the first input according to the row height mapping table and the row height value.

[0087] Optionally, in this embodiment, the acquisition module 30 includes:

[0088] A first determining unit, configured to determine platform information of the target platform in response to a received second input for the target design draft;

[0089] An acquiring unit is configured to acquire the row height mapping table according to the platform information.

[0090] Optionally, in this embodiment, the determining module 32 includes:

[0091] a receiving unit, configured to determine, in response to the first input, content to be adjusted in the target design draft corresponding to the first input;

[0092] The traversal unit is used to traverse the content to be adjusted to obtain multiple different first line height values corresponding to multiple groups of text elements.

[0093] Optionally, in this embodiment, the adjustment module 34 includes:

[0094] a second determining unit, configured to determine a plurality of second row height values according to the plurality of first row height values and the row height mapping table;

[0095] An adjusting unit is configured to adjust the row heights of the plurality of groups of text elements according to the plurality of second row height values.

[0096] Optionally, in this embodiment, the target design draft includes at least one drawing board, wherein the receiving unit includes:

[0097] A determination subunit is used to determine, when the first input corresponds to at least one target artboard, a text element in the at least one target artboard as the content to be adjusted; or, when the first input corresponds to partial content in a target artboard, to determine, when the first input corresponds to partial content, a text element corresponding to the partial content as the content to be adjusted.

[0098] Moreover, in an embodiment of the present invention, a line height mapping table corresponding to the target platform is obtained; in response to the received first input for the target design draft, the line height value of the text element corresponding to the first input in the target design draft is determined; and the line height of the text element corresponding to the first input is adjusted according to the line height mapping table and the line height value. Even for multiple platforms, for each platform, the line height of the text elements corresponding to the first input in the target design draft can be automatically adjusted in batches according to the line height value of the text element corresponding to the first input in the target design draft and the line height mapping table of the target platform, which can effectively improve the restoration degree of the UI design draft on multiple platforms and improve the efficiency of the development process of the design draft for multiple platforms. It further solves the problem in the related art that the line height of each text element in the design draft needs to be manually modified one by one for each platform.

[0099] Example 4

[0100] Preferably, an embodiment of the present invention further provides an electronic device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the above-mentioned text line height adjustment method when executed by the processor.

[0101] Optionally, in this embodiment, the memory is configured to store program codes for executing the following steps:

[0102] S1, obtain the row height mapping table corresponding to the target platform;

[0103] S2, in response to receiving a first input for a target design draft, determining a line height value of a text element in the target design draft corresponding to the first input, wherein the target design draft is a user interface (UI) design draft of a preset application for display on the target platform, and the target design draft is located in a design interface of the preset drawing application;

[0104] S3: Adjust the row height of the text element corresponding to the first input according to the row height mapping table and the row height value.

[0105] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiment 1, and this embodiment will not be described in detail here.

[0106] Example 5

[0107] The embodiment of the present invention further provides a storage medium. Optionally, in this embodiment, the readable storage medium stores a program or instruction, which, when executed by a processor, implements the steps of the text line height adjustment method as described in embodiment 1.

[0108] Optionally, in this embodiment, the storage medium is configured to store program codes for executing the following steps:

[0109] S1, obtain the row height mapping table corresponding to the target platform;

[0110] S2, in response to receiving a first input for a target design draft, determining a line height value of a text element in the target design draft corresponding to the first input, wherein the target design draft is a user interface (UI) design draft of a preset application for display on the target platform, and the target design draft is located in a design interface of the preset drawing application;

[0111] S3: Adjust the row height of the text element corresponding to the first input according to the row height mapping table and the row height value.

[0112] Optionally, the storage medium is further configured to store program codes for executing the steps included in the method in the above embodiment 1, which will not be described in detail in this embodiment.

[0113] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.

[0114] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiment 1, and this embodiment will not be described in detail here.

[0115] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or apparatus comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or apparatus comprising the element.

[0116] Through the above description of the embodiments, those skilled in the art will clearly understand that the methods of the above embodiments can be implemented using software plus the necessary general-purpose hardware platform. Of course, hardware can also be used, but in many cases the former is the more preferred implementation method. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, or optical disk) and includes a number of instructions for enabling a terminal (such as a mobile phone, computer, server, air conditioner, or network device) to execute the methods described in the various embodiments of the present invention.

[0117] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are protected by the present invention.

[0118] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0119] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0120] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0121] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0123] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes various media that can store program code, such as a USB flash drive, a mobile hard drive, ROM, RAM, a magnetic disk, or an optical disk.

[0124] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for adjusting text line height, characterized in that: Applied to a preset drawing application, the design interface of the preset drawing application displays a target design draft, the target design draft is used to be published to multiple target platforms, the line height of text elements of the target design draft displayed in the design interface of the preset drawing application has been set, and before publishing the target design draft, for each of the target platforms, the method includes: Obtaining a row height mapping table corresponding to the target platform, the row height mapping table being stored in a database of the preset drawing application and called by a preset plug-in in the preset drawing application, the row height mapping table being used to represent a mapping relationship between an original text row height of a target design draft in the preset drawing application and a displayed text row height on the target platform; the row height mapping table corresponding to at least two of the multiple target platforms; In response to a received first input for a target design draft, determining a line height value of a text element corresponding to the first input in the target design draft, wherein the target design draft is a user interface (UI) design draft of a preset application for display on the target platform; The row height of the text element corresponding to the first input is adjusted according to the row height mapping table and the row height value.

2. The method according to claim 1, characterized in that The obtaining of the row height mapping table corresponding to the target platform includes: In response to the received second input for the target design draft, determining platform information of the target platform; The row height mapping table is obtained according to the platform information.

3. The method according to claim 1, characterized in that Determining the line height of the text element corresponding to the first input in the target design draft includes: In response to the first input, determining content to be adjusted in the target design draft corresponding to the first input; The content to be adjusted is traversed to obtain a plurality of different first line height values corresponding to a plurality of groups of text elements.

4. The method according to claim 3, characterized in that The adjusting the row height of the text element according to the row height mapping table and the row height value includes: Determine a plurality of second row height values according to the plurality of first row height values and the row height mapping table; The row heights of the multiple groups of text elements are adjusted according to the multiple second row height values.

5. The method according to claim 3, characterized in that The target design draft includes at least one artboard, and determining the content to be adjusted corresponding to the first input in the target design draft includes: In a case where the first input corresponds to at least one target artboard, determining a text element in the at least one target artboard as the content to be adjusted; or In a case where the first input corresponds to a portion of content in a target artboard, a text element corresponding to the portion of content is determined as the content to be adjusted.

6. A text line height adjustment device, characterized in that: Applied to a preset drawing application, the design interface of the preset drawing application displays a target design draft, the target design draft is used to be published to multiple target platforms, the line height of text elements of the target design draft displayed in the design interface of the preset drawing application has been set, and before publishing the target design draft, for each of the target platforms, the device includes: an acquisition module, configured to acquire a row height mapping table corresponding to a target platform, the row height mapping table being stored in a database of the preset drawing application and being called by a preset plug-in in the preset drawing application, the row height mapping table being configured to represent a mapping relationship between an original text row height of a target design draft in the preset drawing application and a displayed text row height on the target platform; the row height mapping table corresponding to at least two of the multiple target platforms; a determination module configured to, in response to a received first input for a target design draft, determine a line height value of a text element in the target design draft corresponding to the first input, wherein the target design draft is a user interface (UI) design draft of a preset application for display on the target platform, and the target design draft is located in a design interface of the preset drawing application; An adjustment module is configured to adjust the row height of the text element corresponding to the first input according to the row height mapping table and the row height value.

7. The device according to claim 6, characterized in that The acquisition module includes: A first determining unit, configured to determine platform information of the target platform in response to a received second input for the target design draft; An acquiring unit is configured to acquire the row height mapping table according to the platform information.

8. The device according to claim 6, characterized in that The determination module includes: a receiving unit, configured to determine, in response to the first input, content to be adjusted in the target design draft corresponding to the first input; The traversal unit is used to traverse the content to be adjusted to obtain multiple different first line height values corresponding to multiple groups of text elements.

9. The device according to claim 8, characterized in that The adjustment module includes: a second determining unit, configured to determine a plurality of second row height values according to the plurality of first row height values and the row height mapping table; An adjusting unit is configured to adjust the row heights of the plurality of groups of text elements according to the plurality of second row height values.

10. The device according to claim 8, characterized in that The target design draft includes at least one drawing board, wherein the receiving unit includes: a determining subunit, configured to, when the first input corresponds to at least one target artboard, determine a text element in the at least one target artboard as the content to be adjusted; or For determining, when the first input corresponds to a portion of content in a target artboard, a text element corresponding to the portion of content as the content to be adjusted.

11. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the text line height adjustment method according to any one of claims 1 to 5 are implemented.

12. A readable storage medium, characterized in that: The readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the text line height adjustment method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Character display effect previewing method, device and equipment, and storage medium

    CN111506378A

  • Localized multi-language adaptation setting method and device, equipment and storage medium

    CN113778582A