Font adjustment method and device for cross-platform text display and storage equipment

By obtaining text content and character information, and automatically adjusting the text font size, it solves the problem of time-consuming and error-prone manual adjustment in cross-platform text display, improves adjustment accuracy and efficiency, and improves user experience.

CN119443044APending Publication Date: 2025-02-14SHENZHEN GREEN CONNECTION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411492961.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

When displaying text across platforms, users need to manually adjust the text size multiple times to adapt to the screen size and resolution of different devices, making adjustments time-consuming, error-prone and text may not be fully displayed, affecting the user experience.

Method used

By obtaining the text content and character information entered by the user, determine the text length under the target font, and automatically adjust the target font size according to the initial font size and text length to ensure that the text is fully displayed on devices on different platform platforms.

Benefits of technology

It improves the accuracy and efficiency of text font adjustment, realizes intelligent adjustment of text fonts, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443044A_ABST
    Figure CN119443044A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of text display, and discloses a font adjustment method and device for cross-platform text display and storage device.The method comprises the steps that text content input by a user on a target platform is obtained, and character information of the text content is read; according to the character information and the determined to-be-displayed target font, determining the text length of the text content under the target font; determining a target font size of the text content based on an initial font size and a text length of the target font according to the determined text content; and according to the target font size, rendering the text content to a text display device of the target platform, so that the text display device displays the text content. Visibly, by implementing the method and the device, the adjustment accuracy and the adjustment efficiency of the text fonts can be improved under the condition of displaying the text in a cross-platform manner, intelligent adjustment of the text fonts is facilitated, the display integrity of the text content is facilitated, and thus the use experience of a user is facilitated to be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text display, and in particular to a font adjustment method and device for cross-platform text display, and a storage device. Background Art

[0002] In modern mobile application development, text display needs to adapt to the screen size and resolution of various devices. When the text content exceeds the display area, the traditional solution is mainly for users to manually adjust the text size to adapt to the corresponding device.

[0003] However, in practice, it is found that when displaying text across platforms, the text size needs to be adjusted manually multiple times to adapt to the display devices of all platforms, which is time-consuming and error-prone, not intelligent enough, and can easily cause the text to be incompletely displayed on some display devices, affecting the user experience. It can be seen that it is particularly important to propose a technical solution to improve the accuracy and efficiency of adjusting text fonts when displaying text across platforms. Summary of the invention

[0004] The present invention provides a font adjustment method and device for cross-platform text display, and a storage device, which can improve the adjustment accuracy and adjustment efficiency of text fonts when displaying text across platforms, and is conducive to realizing intelligent adjustment of text fonts.

[0005] In order to solve the above technical problems, the first aspect of the present invention discloses a font adjustment method for cross-platform text display, the method comprising:

[0006] Obtaining text content input by the user on the target platform and reading character information of the text content;

[0007] Determine the text length of the text content in the target font according to the character information and the determined target font to be displayed;

[0008] Determining a target font size of the text content according to the determined initial font size of the text content based on the target font and the text length;

[0009] According to the target font size, the text content is rendered to a text display device of the target platform, so that the text display device displays the text content.

[0010] As an optional implementation manner, in the first aspect of the present invention, determining the target font size of the text content according to the determined initial font size of the text content and the text length includes:

[0011] Acquire display area information of the text display device, wherein the display area information includes display width and / or display height;

[0012] According to the determined initial font size of the text content, the text length, and the display area information, determining whether the text content meets a preset text overflow condition, and obtaining a first determination result;

[0013] When the first judgment result is no, determining the initial font size as the target font size of the text content;

[0014] When the first judgment result is yes, determining a candidate font size of the text content according to the display area information and the text length, and re-judging whether the text content meets a preset text overflow condition according to the candidate font size, the text length and the display area information, to obtain a second judgment result;

[0015] When the second judgment result is yes, the candidate font size is reduced by 1, and the operation of re-judging whether the text content meets the preset text overflow condition according to the candidate font size, the text length and the display area information to obtain the second judgment result is triggered, until the second judgment result is no;

[0016] The candidate font size when the second judgment result is no is determined as the target font size.

[0017] As an optional implementation, in the first aspect of the present invention, judging whether the text content satisfies a preset text overflow condition based on the determined initial font size of the text content and the display area information, and obtaining a first judgment result includes:

[0018] Predicting, based on the determined initial font size of the text content and the display area information, a space required for the text content when displayed in the text display device, wherein the space required for the text content includes a required width of the text and / or a required height of the text;

[0019] Determine whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or,

[0020] Determine whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition;

[0021] When at least one of the first condition and the second condition is satisfied, it is determined that the text content satisfies the text overflow condition, and the first judgment result is determined to be yes.

[0022] As an optional embodiment, in the first aspect of the present invention, the method further comprises:

[0023] Determining an initial font size of the text content based on the target font according to the display height in the display area information and a predetermined expected number of text lines;

[0024] The determining, according to the display height in the display area information and the predetermined expected number of text lines, of the initial font size of the text content based on the target font includes:

[0025] When the predetermined expected number of text lines is greater than 1, calculating the font size required for the text content according to the display height in the display area information, the expected number of text lines, and the predetermined default line spacing ratio of the target font;

[0026] According to the font size required by the text content, one of the font sizes with the smallest difference from the font size required by the text content is selected from a predetermined font size database as the initial font size of the text content based on the target font.

[0027] As an optional implementation, in the first aspect of the present invention, after determining the candidate font size of the text content according to the display area information and the text length, the method further includes:

[0028] Determining whether the current readability of the candidate font size meets a preset readability condition;

[0029] When it is determined that the candidate font size does not meet the preset readability condition, the operation of adjusting the font size of the target font is stopped, and readability abnormality prompt information matching the candidate font size is output to prompt the user that the current readability of the candidate font size does not meet the readability condition;

[0030] When it is determined that the candidate font size meets the readability condition, the operation of re-determining whether the text content meets the preset text overflow condition based on the candidate font size, the text length and the display area information to obtain a second judgment result is triggered.

[0031] As an optional implementation, in the first aspect of the present invention, the character information includes a character type and the number of characters of the corresponding character type;

[0032] And, determining the text length of the text content in the target font according to the character information and the predetermined target font to be displayed includes:

[0033] Determine, according to a predetermined target font to be displayed, a character spacing between each of the characters in all the characters corresponding to the character information in the target font;

[0034] According to the character information, all characters corresponding to the character information are grouped to obtain a plurality of character groups, wherein all characters in the same character group correspond to the same character type;

[0035] According to the target font and each of the character types, determining the character length of each character in the character group corresponding to the character type in the target font;

[0036] For each of the character groups, according to the number of characters in the character group and the character length of each character in the character group, the sum of the character lengths of the character group is calculated;

[0037] According to the character spacing between each character in all the characters and the sum of the character lengths of each character group in all the character groups, the overall character length of all the characters is calculated as the text length of the text content in the target font.

[0038] As an optional embodiment, in the first aspect of the present invention, the method further comprises:

[0039] Obtaining platform characteristics of the target platform;

[0040] According to the platform characteristics of the target platform, a matching font is selected from a font database that can be displayed by the text display device as a target font to be displayed.

[0041] A second aspect of the present invention discloses a font adjustment device for cross-platform text display, the device comprising:

[0042] The acquisition module is used to obtain the text content input by the user on the target platform;

[0043] A reading module, used for reading character information of the text content;

[0044] A determination module, configured to determine the text length of the text content in the target font according to the character information and the determined target font to be displayed;

[0045] The determination module is further used to determine the target font size of the text content according to the determined initial font size of the target font and the text length of the text content;

[0046] A rendering module is used to render the text content to a text display device of the target platform according to the target font size, so that the text display device displays the text content.

[0047] As an optional implementation, in the second aspect of the present invention, the determination module determines the target font size of the text content according to the determined initial font size of the text content and the text length, specifically including:

[0048] Acquire display area information of the text display device, wherein the display area information includes display width and / or display height;

[0049] According to the determined initial font size of the text content, the text length, and the display area information, determining whether the text content meets a preset text overflow condition, and obtaining a first determination result;

[0050] When the first judgment result is no, determining the initial font size as the target font size of the text content;

[0051] When the first judgment result is yes, determining a candidate font size of the text content according to the display area information and the text length, and re-judging whether the text content meets a preset text overflow condition according to the candidate font size, the text length and the display area information, to obtain a second judgment result;

[0052] When the second judgment result is yes, the candidate font size is reduced by 1, and the operation of re-judging whether the text content meets the preset text overflow condition according to the candidate font size, the text length and the display area information to obtain the second judgment result is triggered, until the second judgment result is no;

[0053] The candidate font size when the second judgment result is no is determined as the target font size.

[0054] As an optional implementation, in the second aspect of the present invention, the determination module determines whether the text content satisfies a preset text overflow condition based on the determined initial font size of the text content and the display area information, and the manner of obtaining the first judgment result specifically includes:

[0055] Predicting, based on the determined initial font size of the text content and the display area information, a space required for the text content when displayed in the text display device, wherein the space required for the text content includes a required width of the text and / or a required height of the text;

[0056] Determine whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or,

[0057] Determine whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition;

[0058] When at least one of the first condition and the second condition is satisfied, it is determined that the text content satisfies the text overflow condition, and the first judgment result is determined to be yes.

[0059] As an optional implementation, in the second aspect of the present invention, the determination module is further used to determine the initial font size of the text content based on the target font according to the display height in the display area information and the predetermined expected number of text lines;

[0060] The method in which the determination module determines the initial font size of the text content based on the target font according to the display height in the display area information and the predetermined expected number of text lines specifically includes:

[0061] When the predetermined expected number of text lines is greater than 1, calculating the font size required for the text content according to the display height in the display area information, the expected number of text lines, and the predetermined default line spacing ratio of the target font;

[0062] According to the font size required by the text content, one of the font sizes with the smallest difference from the font size required by the text content is selected from a predetermined font size database as the initial font size of the text content based on the target font.

[0063] As an optional implementation, in the second aspect of the present invention, the device further includes:

[0064] a judgment module, configured to judge whether the current readability of the candidate font size meets a preset readability condition after the determination module determines the candidate font size of the text content according to the display area information and the text length; when it is judged that the candidate font size meets the readability condition, trigger the determination module to execute the operation of re-judging whether the text content meets the preset text overflow condition according to the candidate font size, the text length and the display area information to obtain a second judgment result;

[0065] A stopping module, configured to stop the operation of adjusting the font size of the target font when it is determined that the candidate font size does not meet a preset readability condition;

[0066] The output module is used to output readability abnormality prompt information matching the candidate font size, so as to prompt the user that the current readability of the candidate font size does not meet the readability condition.

[0067] As an optional implementation, in the second aspect of the present invention, the character information includes a character type and the number of characters of the corresponding character type;

[0068] Furthermore, the determination module determines the text length of the text content in the target font according to the character information and the predetermined target font to be displayed, specifically including:

[0069] Determine, according to a predetermined target font to be displayed, a character spacing between each of the characters in all the characters corresponding to the character information in the target font;

[0070] According to the character information, all characters corresponding to the character information are grouped to obtain a plurality of character groups, wherein all characters in the same character group correspond to the same character type;

[0071] According to the target font and each of the character types, determining the character length of each character in the character group corresponding to the character type in the target font;

[0072] For each of the character groups, according to the number of characters in the character group and the character length of each character in the character group, the sum of the character lengths of the character group is calculated;

[0073] According to the character spacing between each character in all the characters and the sum of the character lengths of each character group in all the character groups, the overall character length of all the characters is calculated as the text length of the text content in the target font.

[0074] As an optional implementation, in the second aspect of the present invention, the acquisition module is further used to acquire the platform characteristics of the target platform;

[0075] And, the device also includes:

[0076] The selection module is used to select a matching font from a font database that can be displayed by the text display device according to the platform characteristics of the target platform as a target font to be displayed.

[0077] A third aspect of the present invention discloses a network attached storage device, the network attached storage device is communicatively connected to a text display device, the network attached storage device stores a memory having executable program code;

[0078] a processor coupled to the memory;

[0079] The processor calls the executable program code stored in the memory to execute the font adjustment method for cross-platform text display disclosed in the first aspect of the present invention.

[0080] The fourth aspect of the present invention discloses a computer storage medium, wherein the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the font adjustment method for cross-platform text display disclosed in the first aspect of the present invention.

[0081] The fifth aspect of the present invention discloses a font adjustment system for cross-platform text display, the system comprising the font adjustment device for cross-platform text display disclosed in the second aspect of the present invention, or the network attached storage device and the text display device disclosed in the third aspect of the present invention, the font adjustment device for cross-platform text display or the network attached storage device is installed with a computer application capable of executing the font adjustment method for cross-platform text display disclosed in the first aspect of the present invention.

[0082] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0083] The implementation of the present invention can obtain the text content input by the user on the target platform, read the character information of the text content, and determine the text length of the text content under the target font based on the character information and the determined target font to be displayed, which can improve the accuracy and efficiency of determining the text length of the text content. Subsequently, the target font size of the text content is determined based on the determined text content based on the initial font size of the target font and the text length, which can improve the accuracy and efficiency of determining the target font size of the text content. It can improve the adjustment accuracy and efficiency of the text font when displaying text across platforms, which is conducive to realizing intelligent adjustment of the text font. Then, according to the target font size, the text content is rendered to the text display device of the target platform so that the text display device displays the text content. The rendering accuracy of the text content to the text display device can be improved based on the accurately adjusted text font, which is conducive to improving the display integrity of the text content, thereby facilitating improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0084] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 creative work.

[0085] Figure 1It is a flow chart of a font adjustment method for cross-platform text display disclosed in an embodiment of the present invention;

[0086] Figure 2 It is a flowchart of another font adjustment method for cross-platform text display disclosed in an embodiment of the present invention;

[0087] Figure 3 It is a structural schematic diagram of a font adjustment device for cross-platform text display disclosed in an embodiment of the present invention;

[0088] Figure 4 It is a structural schematic diagram of another font adjustment device for cross-platform text display disclosed in an embodiment of the present invention;

[0089] Figure 5 It is a schematic diagram of the structure of a network attached storage device disclosed in an embodiment of the present invention;

[0090] Figure 6 It is a structural schematic diagram of a font adjustment system for cross-platform text display disclosed in an embodiment of the present invention;

[0091] Figure 7 It is a structural schematic diagram of another font adjustment system for cross-platform text display disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0092] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0093] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, device, product or end including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units that are not listed, or may optionally include other steps or units inherent to these processes, methods, products or ends.

[0094] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0095] The present invention discloses a font adjustment method and device for cross-platform text display, and a storage device, which can obtain the text content input by the user on the target platform, read the character information of the text content, and determine the text length of the text content under the target font according to the character information and the determined target font to be displayed, which can improve the accuracy and efficiency of determining the text length of the text content, and then determine the target font size of the text content based on the initial font size and text length of the target font according to the determined text content, which can improve the accuracy and efficiency of determining the target font size of the text content, and can improve the adjustment accuracy and efficiency of the text font when displaying text across platforms, which is conducive to realizing intelligent adjustment of the text font, and then render the text content to the text display device of the target platform according to the target font size, so that the text display device displays the text content, and can improve the rendering accuracy of the text content to the text display device based on the accurately adjusted text font, which is conducive to improving the display integrity of the text content, thereby helping to improve the user experience. The following are described in detail.

[0096] Embodiment 1

[0097] See also Figure 1 , Figure 1 1 is a flow chart of a font adjustment method for cross-platform text display disclosed in an embodiment of the present invention. Figure 1 The described font adjustment method for cross-platform text display may be developed in the Flutter framework, and the method may be applied to a font adjustment device for cross-platform text display, wherein the device may include a font adjustment device or a font adjustment server, wherein the font adjustment server may include a cloud server or a local server, which is not limited in the embodiments of the present invention. Figure 1 As shown, the font adjustment method for cross-platform text display may include the following operations:

[0098] 101. Obtain text content input by the user on the target platform, and read character information of the text content.

[0099] In the embodiment of the present invention, optionally, the character information includes a character type and the number of characters of the corresponding character type. The character type may include a combination of one or more letter types, number types, punctuation types, and special symbol types, which are not limited in the embodiment of the present invention.

[0100] 102. Determine the text length of the text content in the target font according to the character information and the determined target font to be displayed.

[0101] In the embodiment of the present invention, the text length refers to the width (or height) occupied by the text content when it is actually displayed under the condition of the target font and the determined initial font size of the text content based on the target font.

[0102] 103. Determine a target font size of the text content according to the determined text content based on the initial font size of the target font and the text length.

[0103] In an embodiment of the present invention, optionally, it is possible to determine whether the text content overflows the text display device based on the initial font size and the text length, obtain a determination result, and adjust the initial font size based on the determination result to obtain a target font size; further optionally, it is possible to predict the space occupied by the text content on the text display device based on the initial font size and the text length, and compare the predicted occupied space with the space that can be displayed by the text display device to obtain a comparison result, and then determine the adjustment requirement for the initial font size based on the comparison result, and determine the target font size based on the adjustment requirement.

[0104] 104. Render the text content to a text display device of the target platform according to the target font size, so that the text display device displays the text content.

[0105] It can be seen that implementation Figure 1The font adjustment method for cross-platform text display described can obtain the text content input by the user on the target platform, read the character information of the text content, and determine the text length of the text content under the target font based on the character information and the determined target font to be displayed, which can improve the accuracy and efficiency of determining the text length of the text content. Subsequently, the target font size of the text content is determined based on the determined text content based on the initial font size and text length of the target font, which can improve the accuracy and efficiency of determining the target font size of the text content. It can improve the adjustment accuracy and efficiency of the text font when displaying text across platforms, which is conducive to realizing intelligent adjustment of the text font. Then, according to the target font size, the text content is rendered to the text display device of the target platform so that the text display device displays the text content. The rendering accuracy of the text content to the text display device can be improved based on the accurately adjusted text font, which is conducive to improving the display integrity of the text content, thereby helping to improve the user experience.

[0106] In an optional embodiment, the above step 102 of determining the text length of the text content in the target font according to the character information and the predetermined target font to be displayed may include:

[0107] Determine, according to a predetermined target font to be displayed, a character spacing between each character in all characters corresponding to the character information in the target font;

[0108] According to the character information, all characters corresponding to the character information are grouped to obtain multiple character groups, and all characters in the same character group correspond to the same character type;

[0109] According to the target font and each character type, determining the character length of each character in the character group corresponding to the character type under the target font;

[0110] For each character group, according to the number of characters in the character group and the character length of each character in the character group, the sum of the character lengths of the character group is calculated;

[0111] According to the character spacing between each character in all characters and the sum of the character lengths of each character group in all character groups, the overall character length of all characters is calculated as the text length of the text content in the target font.

[0112] In the embodiment of the present invention, specifically, calculating the total character length of all characters as the text length of the text content in the target font according to the character spacing between each character in all characters and the sum of the character lengths of each character group in all character groups may include:

[0113] According to the text content, character sorting information of the text content is determined; according to the character sorting information, a target character spacing matching the character sorting information is screened out from the character spacing between each character in all characters;

[0114] The sum of the character lengths of each character group in all character groups and the sum of all target character spacings are calculated to obtain the overall character length of all characters as the text length of the text content in the target font. The target character spacing that matches the character sorting information may include the character spacing between the adjacent preceding characters and the adjacent following characters.

[0115] It can be seen that this optional embodiment can determine the character spacing between each character in all characters corresponding to the character information under the target font according to the predetermined target font to be displayed, which can improve the determination accuracy and efficiency of the character spacing between each character under the target font, and group all characters corresponding to the character information according to the character information to obtain multiple character groups, which can improve the grouping accuracy of the character information, and determine the character length of each character in the character group corresponding to the character type under the target font according to the target font and each character type, which can improve the determination accuracy and efficiency of the character length of each character of each character type under the target font, and then for each character group, calculate the sum of the character lengths of the character group according to the number of characters in the character group and the character length of each character in the character group, and calculate the overall character length of all characters according to the character spacing between each character in all characters and the sum of the character lengths of each character group in all character groups as the text length of the text content under the target font, which can improve the calculation accuracy and reliability of the text length of the text content based on the character spacing between each character and the character length of each type of character.

[0116] In another optional embodiment, the method may further include:

[0117] Get the platform characteristics of the target platform;

[0118] According to the platform characteristics of the target platform, a matching font is selected from a font database that can be displayed by the text display device as the target font to be displayed.

[0119] In an embodiment of the present invention, optionally, the platform characteristics of the target platform may include one or more combinations of the operating system of the target platform, the device characteristics of the text display device of the target platform, and the font rendering engine information of the target platform (such as Core Text, FreeType, DirectWrite, etc.). Among them, the operating system may be one of iOS, Android, Web, etc., and the operating systems of different types of platforms have different font rendering mechanisms and font libraries. For example, iOS and Android may use different system fonts (such as "San Francisco" for iOS and "Roboto" for Android) to ensure cross-platform consistency and localized experience. The device characteristics of the text display device may include one or more combinations of the resolution of the text display device, the screen size of the text display device, and the pixel density (DPI) of the text display device. According to the display characteristics of the text display device (such as resolution and DPI), appropriate font weight (thickness) and style (regular, italic, etc.) can be selected to optimize the readability of the text. For example, on a high DPI device, the font needs to be appropriately enlarged to ensure clear readability; on a low DPI device, a thinner font or a larger line spacing is required to prevent blur or overlap of characters. The character rendering engine information may include the anti-aliasing, sub-pixel rendering, and font smoothing processing methods of the character rendering engine. Among them, the anti-aliasing processing method can enable or optimize anti-aliasing on devices that support anti-aliasing to reduce the jagged effect of the font edge and make the font smoother; the sub-pixel rendering processing method can use sub-pixel rendering technology on display devices such as LCDs to improve the clarity and readability of text; the font smoothing processing method can adjust the font smoothing level as needed on certain platforms to obtain the best display effect, and the implementation of the present invention is not limited thereto.

[0120] It can be seen that this optional embodiment can obtain the platform characteristics of the target platform, and according to the platform characteristics of the target platform, select a matching font from the font database that can be displayed by the text display device as the target font to be displayed, which can improve the selection accuracy and selection efficiency of the target font, and is conducive to the accurate selection of suitable fonts based on platform characteristics in the case of cross-platform text display.

[0121] Embodiment 2

[0122] See also Figure 2 , Figure 2 1 is a flow chart of a font adjustment method for cross-platform text display disclosed in an embodiment of the present invention. Figure 2The described font adjustment method for cross-platform text display may be developed in the Flutter framework, and the method may be applied to a font adjustment device for cross-platform text display, wherein the device may include a font adjustment device or a font adjustment server, wherein the font adjustment server may include a cloud server or a local server, which is not limited in the embodiments of the present invention. Figure 2 As shown, the font adjustment method for cross-platform text display may include the following operations:

[0123] 201. Obtain text content input by a user on a target platform, and read character information of the text content.

[0124] 202. Determine the text length of the text content in the target font according to the character information and the determined target font to be displayed.

[0125] 203. Obtain display area information of the text display device.

[0126] In the embodiment of the present invention, optionally, the display area information includes display width and / or display height. Further optionally, the display area information may also include remaining displayable space of the text display device.

[0127] 204. Determine whether the text content satisfies a preset text overflow condition based on the determined initial font size, text length, and display area information of the text content, and obtain a first determination result.

[0128] In an embodiment of the present invention, optionally, the text overflow condition may include a first condition for comparing the required width of the text with the display width based on the initial font size and the display area information, may also include a second condition for comparing the required height of the text with the display height based on the initial font size and the display area information, and may also include a condition that combines the first condition and the second condition. Further optionally, when the display area information includes the remaining displayable space, the text overflow condition may also include a third condition for comparing the required space for text display based on the initial font size and the display area information with the remaining displayable space of the text display device, which is not limited in the embodiment of the present invention.

[0129] In the embodiment of the present invention, when the first judgment result of step 204 is no, step 205 is triggered to be executed; when the first judgment result of step 204 is yes, step 206 is triggered to be executed.

[0130] 205. Determine an initial font size as a target font size for the text content.

[0131] 206. Determine candidate font sizes for the text content according to the display area information and the text length.

[0132] In the embodiment of the present invention, specifically, determining the candidate font size of the text content according to the display area information and the text length may include: calculating the display width and the text length in the display area information to obtain the font size to be adjusted as the candidate font size of the text content. The calculation formula for the font size to be adjusted is as follows:

[0133] Adjusted Font Size=Container Width / Text Length;

[0134] Among them, Adjusted Font Size is used to indicate the font size that needs to be adjusted, Container Width is used to indicate the display width of the text display device, and Text Length is used to indicate the text length.

[0135] 207. Re-determine whether the text content meets a preset text overflow condition based on the candidate font size, text length, and display area information to obtain a second determination result.

[0136] In the embodiment of the present invention, for other descriptions of step 207, please refer to the detailed description of step 204, and the embodiment of the present invention will not be repeated.

[0137] In the embodiment of the present invention, when the second judgment result of step 207 is yes, step 208 is triggered to be executed; when the second judgment result of step 207 is no, step 209 is triggered to be executed.

[0138] 208. Reduce the candidate font size by 1.

[0139] In an embodiment of the present invention, after step 208, the execution of step 207 is triggered to re-judge whether the text content meets the preset text overflow condition based on the candidate font size, text length and display area information to obtain the second judgment result until the second judgment result is no.

[0140] 209. Determine the candidate font size when the second judgment result is no as the target font size.

[0141] 210. Render the text content to a text display device of the target platform according to the target font size, so that the text display device displays the text content.

[0142] In the embodiment of the present invention, for other descriptions of step 201, step 202 and step 210, please refer to the detailed description of step 101, step 102 and step 104 in the first embodiment, and the embodiment of the present invention will not be repeated.

[0143] It can be seen that implementation Figure 2The font adjustment method for cross-platform text display described can obtain the text content input by the user on the target platform, read the character information of the text content, and determine the text length of the text content under the target font based on the character information and the determined target font to be displayed, which can improve the accuracy and efficiency of determining the text length of the text content. Subsequently, the target font size of the text content is determined based on the determined text content based on the initial font size and text length of the target font, which can improve the accuracy and efficiency of determining the target font size of the text content. It can improve the adjustment accuracy and efficiency of the text font when displaying text across platforms, which is conducive to realizing intelligent adjustment of the text font. Then, according to the target font size, the text content is rendered to the text display device of the target platform so that the text display device displays the text content. The rendering accuracy of the text content to the text display device can be improved based on the accurately adjusted text font, which is conducive to improving the display integrity of the text content, thereby helping to improve the user experience. In addition, it is also possible to obtain the display area information of the text display device, and determine whether the text content meets the preset text overflow condition based on the determined initial font size, text length and display area information of the text content, and obtain a first judgment result. It is possible to improve the judgment accuracy and efficiency of whether the text content meets the text overflow condition based on the initial font size, text length and display area information. When the first judgment result is no, the initial font size is determined as the target font size of the text content, which can improve the determination speed and efficiency of the target font size when the text does not overflow. When the first judgment result is yes, the candidate font size of the text content is determined based on the display area information and the text length, which improves the determination accuracy and reliability of the candidate font size. Subsequently, based on the candidate font size, text length and display area information, it is re-determined whether the text content meets the preset text overflow condition to obtain a second judgment result. When the second judgment result is yes, the candidate font size is reduced by 1, and the operation of re-determining whether the text content meets the preset text overflow condition to obtain the second judgment result based on the candidate font size, text length and display area information is triggered until the second judgment result is no, and the candidate font size when the second judgment result is no is determined as the target font size. This can improve the accuracy and efficiency of font size adjustment based on the display area information and text length when the text overflows, and the accuracy and reliability of the font size finally determined can be improved by repeated judgment of the adjusted font size.

[0144] In an optional embodiment, the above step 204 determines whether the text content meets a preset text overflow condition based on the determined initial font size of the text content and the display area information to obtain a first determination result, which may include:

[0145] Predicting the space required for displaying the text content in a text display device according to the determined initial font size of the text content and the display area information, where the space required for the text content includes a required width of the text and / or a required height of the text;

[0146] Determine whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or,

[0147] Determine whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition;

[0148] When at least one of the first condition and the second condition is satisfied, it is determined that the text content satisfies the text overflow condition, and the first judgment result is determined to be yes.

[0149] In an embodiment of the present invention, specifically, in a case where the text overflow condition only includes a first condition of whether the required width of the text is greater than the display width in the display area information, when the first condition is not met, it is determined that the text content does not meet the text overflow condition, and the first judgment result is determined to be no; in a case where the text overflow condition only includes a second condition of whether the required height of the text is greater than the display height in the display area information, when the second condition is not met, it is determined that the text content does not meet the text overflow condition, and the first judgment result is determined to be no.

[0150] In an embodiment of the present invention, specifically, when both the first condition and the second condition are not met, and when the display area information also includes the remaining displayable space of the text display device, the first spatial area of ​​the remaining displayable space of the text display device is calculated, and the second spatial area of ​​the space required for displaying the text content in the text display device is calculated, and the second spatial area is divided by the first spatial area to obtain the area ratio of the second spatial area to the first spatial area, and it is determined whether the area ratio is greater than 1, which is recorded as the third condition; wherein, when the third condition is met, it is determined that the text content meets the text overflow condition, and the first judgment result is determined to be yes; when the third condition is not met, it is determined that the text content does not meet the text overflow condition, and the first judgment result is determined to be no.

[0151] In an embodiment of the present invention, specifically, the execution priority of the first condition and the execution priority of the second condition are both greater than the execution priority of the third condition. This can improve the speed and efficiency of determining whether the text content satisfies the text overflow condition based on the first condition and / or the second condition, and can improve the accuracy and reliability of determining whether the text content does not satisfy the text overflow condition based on the third condition.

[0152] It can be seen that this optional embodiment can predict the space required for the text content when it is displayed in the text display device (the space required for the text content includes the required width of the text and / or the required height of the text) based on the determined initial font size of the text content and the display area information, and can improve the prediction accuracy and prediction efficiency of the space required for the text content, and judge whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or, judge whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition; and when at least one of the first condition and the second condition is met, it is determined that the text content meets the text overflow condition, and the first judgment result is determined to be yes, which can improve the accuracy and reliability of the judgment of whether the text content meets the text overflow condition, and by providing multiple conditions, the flexibility and diversity of the judgment of whether the text content meets the text overflow condition can be improved.

[0153] In another optional embodiment, the method may further include:

[0154] Determine an initial font size of the text content based on the target font according to the display height in the display area information and the predetermined expected number of text lines;

[0155] The initial font size of the text content based on the target font is determined according to the display height in the display area information and the predetermined expected number of text lines, including:

[0156] When the predetermined expected number of text lines is greater than 1, the font size required for the text content is calculated according to the display height in the display area information, the expected number of text lines, and the predetermined default line spacing ratio of the target font;

[0157] According to the font size required by the text content, one of the font sizes with the smallest difference from the font size required by the text content is selected from a predetermined font size database as the initial font size of the text content based on the target font.

[0158] In the embodiment of the present invention, specifically, the calculation formula for the font size required for the text content is as follows:

[0159] The font size required for text content = display height / (expected number of text lines * default line spacing ratio).

[0160] For example, assuming that the calculated font size required for the text content is 10.4, and the font size database contains font sizes including 8, 9, 10, 10.5, 11, and 12, then the font size 10.5 with the smallest difference from 10.4 is determined as the initial font size of the text content based on the target font.

[0161] It can be seen that this optional embodiment can calculate the font size required for the text content based on the display height in the display area information, the expected number of text lines and the predetermined default line spacing ratio of the target font when the predetermined expected number of text lines is greater than 1, thereby improving the calculation accuracy and efficiency of the font size required for the text content. According to the font size required for the text content, one of the font sizes with the smallest difference from the font size required for the text content is screened out from a predetermined font size database as the initial font size of the text content based on the target font, thereby improving the screening accuracy and reliability of the initial font size.

[0162] In yet another optional embodiment, after determining the candidate font sizes of the text content according to the display area information and the text length in step 206, the method may further include:

[0163] Determining whether the current readability of the candidate font size meets a preset readability condition;

[0164] When it is determined that the candidate font size does not meet the preset readability condition, the operation of adjusting the font size of the target font is stopped, and readability abnormality prompt information matching the candidate font size is output to prompt the user that the current readability of the candidate font size does not meet the readability condition;

[0165] When it is determined that the candidate font size meets the readability condition, an operation is triggered to re-determine whether the text content meets the preset text overflow condition based on the candidate font size, text length and display area information to obtain a second judgment result.

[0166] In the embodiment of the present invention, specifically, determining whether the current readability of the candidate font size meets a preset readability condition may include:

[0167] Determine whether the candidate font size is greater than or equal to a preset minimum font and less than or equal to a preset maximum font;

[0168] When it is determined that the candidate font size is greater than or equal to the minimum font and is less than or equal to the maximum font, determining that the current readability of the candidate font size meets a preset readability condition;

[0169] When it is determined that the candidate font size is smaller than the minimum font, or larger than the maximum font, it is determined that the current readability of the candidate font size does not meet the preset readability condition.

[0170] It can be seen that this optional embodiment can, after determining the candidate font size of the text content, first judge the readability of the candidate font size. When it is judged that the readability of the candidate font size is poor, stop adjusting the font size and output corresponding prompt information to the user, which is conducive to promptly prompting the user that the current font size affects the user's reading. When it is judged that the readability of the candidate font size is good, it triggers the subsequent operation of re-judging whether it overflows the text display device, which is conducive to improving the display integrity of the text content while ensuring the readability of the text content.

[0171] Embodiment 3

[0172] See also Figure 3 , Figure 3 1 is a schematic diagram of a font adjustment device for cross-platform text display disclosed in an embodiment of the present invention. Figure 3 The method involved in the font adjustment device for cross-platform text display described may be developed in the Flutter framework, and the device may include a font adjustment device or a font adjustment server, wherein the font adjustment server may include a cloud server or a local server, which is not limited in the embodiment of the present invention. Figure 3 As shown, the font adjustment device for cross-platform text display may include:

[0173] The acquisition module 301 is used to acquire the text content input by the user on the target platform;

[0174] The reading module 302 is used to read the character information of the text content;

[0175] The determination module 303 is used to determine the text length of the text content in the target font according to the character information and the determined target font to be displayed;

[0176] The determination module 303 is further used to determine the target font size of the text content based on the determined text content and the initial font size of the target font and the text length;

[0177] The rendering module 304 is used to render the text content to the text display device of the target platform according to the target font size, so that the text display device displays the text content.

[0178] It can be seen that implementation Figure 3The font adjustment device for cross-platform text display described can obtain the text content input by the user on the target platform, read the character information of the text content, and determine the text length of the text content under the target font based on the character information and the determined target font to be displayed, which can improve the accuracy and efficiency of determining the text length of the text content, and then determine the target font size of the text content based on the determined text content based on the initial font size and text length of the target font, which can improve the accuracy and efficiency of determining the target font size of the text content, and can improve the adjustment accuracy and efficiency of the text font when displaying text across platforms, which is conducive to realizing intelligent adjustment of the text font, and then render the text content to the text display device of the target platform according to the target font size, so that the text display device displays the text content, and can improve the rendering accuracy of the text content to the text display device based on the accurately adjusted text font, which is conducive to improving the display integrity of the text content, thereby helping to improve the user experience.

[0179] In an optional embodiment, the determination module 303 determines the target font size of the text content according to the determined initial font size and text length of the text content, and the method may specifically include:

[0180] Acquire display area information of a text display device, where the display area information includes display width and / or display height;

[0181] According to the determined initial font size, text length, and display area information of the text content, determining whether the text content meets a preset text overflow condition, and obtaining a first determination result;

[0182] When the first judgment result is no, determining an initial font size as a target font size of the text content;

[0183] When the first judgment result is yes, determine the candidate font size of the text content according to the display area information and the text length, and re-judge whether the text content meets the preset text overflow condition according to the candidate font size, the text length and the display area information to obtain a second judgment result;

[0184] When the second judgment result is yes, the candidate font size is reduced by 1, and the operation of re-judging whether the text content meets the preset text overflow condition according to the candidate font size, text length and display area information to obtain the second judgment result is triggered, until the second judgment result is no;

[0185] The candidate font size when the second judgment result is no is determined as the target font size.

[0186] It can be seen that this optional embodiment can obtain the display area information of the text display device, and judge whether the text content meets the preset text overflow condition based on the determined initial font size, text length and display area information of the text content, and obtain a first judgment result. It can improve the judgment accuracy and efficiency of whether the text content meets the text overflow condition based on the initial font size, text length and display area information. When the first judgment result is no, the initial font size is determined as the target font size of the text content, which can improve the determination speed and efficiency of the target font size when the text does not overflow. When the first judgment result is yes, the candidate font size of the text content is determined according to the display area information and the text length, which improves the determination accuracy and feasibility of the candidate font size. reliability, and then re-judge whether the text content meets the preset text overflow condition based on the candidate font size, text length and display area information to obtain a second judgment result. When the second judgment result is yes, the candidate font size is reduced by 1, and the operation of re-judging whether the text content meets the preset text overflow condition based on the candidate font size, text length and display area information to obtain the second judgment result is triggered, until the second judgment result is no, the candidate font size when the second judgment result is no is determined as the target font size, which can improve the accuracy and efficiency of adjusting the font size based on the display area information and text length when the text overflows, and the accuracy and reliability of the font size finally determined can be improved by repeatedly judging the adjusted font size.

[0187] In this optional embodiment, as an optional implementation, the determination module 303 determines whether the text content meets the preset text overflow condition according to the determined initial font size of the text content and the display area information, and the manner of obtaining the first judgment result specifically includes:

[0188] Predicting the space required for displaying the text content in a text display device according to the determined initial font size of the text content and the display area information, where the space required for the text content includes a required width of the text and / or a required height of the text;

[0189] Determine whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or,

[0190] Determine whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition;

[0191] When at least one of the first condition and the second condition is satisfied, it is determined that the text content satisfies the text overflow condition, and the first judgment result is determined to be yes.

[0192] It can be seen that this optional implementation can predict the space required for the text content when it is displayed in the text display device (the space required for the text content includes the required width of the text and / or the required height of the text) based on the determined initial font size of the text content and the display area information, and can improve the prediction accuracy and efficiency of the space required for the text content, and determine whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or, determine whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition; and when at least one of the first condition and the second condition is met, determine that the text content meets the text overflow condition, and determine that the first judgment result is yes, which can improve the accuracy and reliability of the judgment of whether the text content meets the text overflow condition, and by providing multiple conditions, it can improve the flexibility and diversity of the judgment of whether the text content meets the text overflow condition.

[0193] In this optional embodiment, as another optional implementation, the determination module 303 is further used to determine the initial font size of the text content based on the target font according to the display height in the display area information and the predetermined expected number of text lines;

[0194] The method in which the determination module 303 determines the initial font size of the text content based on the target font according to the display height in the display area information and the predetermined expected number of text lines specifically includes:

[0195] When the predetermined expected number of text lines is greater than 1, the font size required for the text content is calculated according to the display height in the display area information, the expected number of text lines, and the predetermined default line spacing ratio of the target font;

[0196] According to the font size required by the text content, one of the font sizes with the smallest difference from the font size required by the text content is selected from a predetermined font size database as the initial font size of the text content based on the target font.

[0197] It can be seen that this optional implementation can calculate the font size required for the text content based on the display height in the display area information, the expected number of text lines and the predetermined default line spacing ratio of the target font when the predetermined expected number of text lines is greater than 1, thereby improving the calculation accuracy and efficiency of the font size required for the text content. According to the font size required for the text content, one of the font sizes with the smallest difference from the font size required for the text content is screened out from a predetermined font size database as the initial font size of the text content based on the target font, thereby improving the screening accuracy and reliability of the initial font size.

[0198] In this optional embodiment, as another optional implementation, as Figure 4As shown, Figure 4 is a schematic diagram of the structure of another font adjustment device for cross-platform text display disclosed in an embodiment of the present invention, such as Figure 4 As shown, the device may also include:

[0199] The judging module 305 is used to judge whether the current readability of the candidate font size meets the preset readability condition after the determining module 303 determines the candidate font size of the text content according to the display area information and the text length; when it is judged that the candidate font size meets the readability condition, trigger the determining module 303 to perform an operation of re-judging whether the text content meets the preset text overflow condition according to the candidate font size, the text length and the display area information to obtain a second judgment result;

[0200] A stop module 306 is used to stop the operation of adjusting the font size of the target font when it is determined that the candidate font size does not meet the preset readability condition;

[0201] The output module 307 is used to output readability abnormality prompt information matching the candidate font size, so as to prompt the user that the current readability of the candidate font size does not meet the readability condition.

[0202] It can be seen that this optional implementation method can, after determining the candidate font size of the text content, first judge the readability of the candidate font size. When it is judged that the readability of the candidate font size is poor, stop adjusting the font size and output corresponding prompt information to the user, which is conducive to promptly prompting the user that the current font size affects the user's reading. When it is judged that the readability of the candidate font size is good, it triggers the subsequent operation of re-judgment of whether it overflows the text display device, which is conducive to improving the display integrity of the text content while ensuring the readability of the text content.

[0203] In another optional embodiment, the character information includes the character type and the number of characters of the corresponding character type. And the determination module 303 determines the text length of the text content in the target font according to the character information and the predetermined target font to be displayed, specifically including:

[0204] Determine, according to a predetermined target font to be displayed, a character spacing between each character in all characters corresponding to the character information in the target font;

[0205] According to the character information, all characters corresponding to the character information are grouped to obtain multiple character groups, and all characters in the same character group correspond to the same character type;

[0206] According to the target font and each character type, determining the character length of each character in the character group corresponding to the character type under the target font;

[0207] For each character group, according to the number of characters in the character group and the character length of each character in the character group, the sum of the character lengths of the character group is calculated;

[0208] According to the character spacing between each character in all characters and the sum of the character lengths of each character group in all character groups, the overall character length of all characters is calculated as the text length of the text content in the target font.

[0209] It can be seen that this optional embodiment can determine the character spacing between each character in all characters corresponding to the character information under the target font according to the predetermined target font to be displayed, which can improve the determination accuracy and efficiency of the character spacing between each character under the target font, and group all characters corresponding to the character information according to the character information to obtain multiple character groups, which can improve the grouping accuracy of the character information, and determine the character length of each character in the character group corresponding to the character type under the target font according to the target font and each character type, which can improve the determination accuracy and efficiency of the character length of each character of each character type under the target font, and then for each character group, calculate the sum of the character lengths of the character group according to the number of characters in the character group and the character length of each character in the character group, and calculate the overall character length of all characters according to the character spacing between each character in all characters and the sum of the character lengths of each character group in all character groups as the text length of the text content under the target font, which can improve the calculation accuracy and reliability of the text length of the text content based on the character spacing between each character and the character length of each type of character.

[0210] In yet another optional embodiment, the acquisition module 301 is further used to acquire the platform characteristics of the target platform. Figure 4 As shown, the device may also include:

[0211] The selection module 308 is used to select a matching font from a font database that can be displayed by the text display device according to the platform characteristics of the target platform as the target font to be displayed.

[0212] It can be seen that this optional embodiment can obtain the platform characteristics of the target platform, and according to the platform characteristics of the target platform, select a matching font from the font database that can be displayed by the text display device as the target font to be displayed, which can improve the selection accuracy and selection efficiency of the target font, and is conducive to the accurate selection of suitable fonts based on platform characteristics in the case of cross-platform text display.

[0213] Embodiment 4

[0214] See also Figure 5 , Figure 5 Schematic diagram of the structure of a network attached storage device disclosed in an embodiment of the present invention. Figure 5 As shown, the network attached storage device is communicatively connected to a text display device, and the network attached storage device stores a memory 401 of executable program code;

[0215] a processor 402 coupled to the memory 401;

[0216] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the font adjustment method for cross-platform text display described in the first embodiment of the present invention or the second embodiment of the present invention.

[0217] Embodiment 5

[0218] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps in the font adjustment method for cross-platform text display described in Embodiment 1 or Embodiment 2 of the present invention.

[0219] Embodiment 6

[0220] See also Figure 6 , Figure 6 Schematic diagram of a font adjustment system for cross-platform text display disclosed in an embodiment of the present invention. Figure 6 As shown, the system includes the font adjustment device for cross-platform text display described in the third embodiment of the present invention, and the font adjustment device for cross-platform text display is installed with a computer application capable of executing the font adjustment method for cross-platform text display described in the first embodiment of the present invention or the second embodiment of the present invention; or,

[0221] See also Figure 7 , Figure 7 FIG. 1 is a schematic diagram of another font adjustment system for cross-platform text display disclosed in an embodiment of the present invention. Figure 7 As shown, the system includes a network attached storage device 40 and a text display device 50 described in Embodiment 4 of the present invention, and the network attached storage device 40 is installed with a computer application that can execute the font adjustment method for cross-platform text display described in Embodiment 1 or Embodiment 2 of the present invention.

[0222] Embodiment 7

[0223] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps in the font adjustment method for cross-platform text display described in Embodiment 1 or Embodiment 2.

[0224] The device embodiments described above are only illustrative, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, i.e., they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative work.

[0225] Through the specific description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution can be essentially or partly contributed to the prior art in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.

[0226] Finally, it should be noted that the font adjustment method, device, and storage device for cross-platform text display disclosed in the embodiments of the present invention are only preferred embodiments of the present invention, and are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A font adjustment method for cross-platform text display, characterized in that: The method comprises: Obtaining text content input by the user on the target platform and reading character information of the text content; Determine the text length of the text content in the target font according to the character information and the determined target font to be displayed; Determining a target font size of the text content according to the determined initial font size of the text content based on the target font and the text length; According to the target font size, the text content is rendered to a text display device of the target platform, so that the text display device displays the text content.

2. The font adjustment method for cross-platform text display according to claim 1, characterized in that: The step of determining a target font size of the text content according to the determined initial font size of the text content and the text length includes: Acquire display area information of the text display device, wherein the display area information includes display width and / or display height; According to the determined initial font size of the text content, the text length, and the display area information, determining whether the text content meets a preset text overflow condition, and obtaining a first determination result; When the first judgment result is no, determining the initial font size as the target font size of the text content; When the first judgment result is yes, determining a candidate font size of the text content according to the display area information and the text length, and re-judging whether the text content meets a preset text overflow condition according to the candidate font size, the text length and the display area information, to obtain a second judgment result; When the second judgment result is yes, the candidate font size is reduced by 1, and the operation of re-judging whether the text content meets the preset text overflow condition according to the candidate font size, the text length and the display area information to obtain the second judgment result is triggered, until the second judgment result is no; The candidate font size when the second judgment result is no is determined as the target font size.

3. The font adjustment method for cross-platform text display according to claim 2, characterized in that: The determining, based on the determined initial font size of the text content and the display area information, whether the text content satisfies a preset text overflow condition to obtain a first determination result includes: Predicting, based on the determined initial font size of the text content and the display area information, a space required for the text content when displayed in the text display device, wherein the space required for the text content includes a required width of the text and / or a required height of the text; Determine whether the required width of the text is greater than the display width in the display area information, which is recorded as the first condition; or, Determine whether the required height of the text is greater than the display height in the display area information, which is recorded as the second condition; When at least one of the first condition and the second condition is satisfied, it is determined that the text content satisfies the text overflow condition, and the first judgment result is determined to be yes.

4. The font adjustment method for cross-platform text display according to claim 2, characterized in that: The method further comprises: Determining an initial font size of the text content based on the target font according to the display height in the display area information and a predetermined expected number of text lines; The determining, according to the display height in the display area information and the predetermined expected number of text lines, of the initial font size of the text content based on the target font includes: When the predetermined expected number of text lines is greater than 1, calculating the font size required for the text content according to the display height in the display area information, the expected number of text lines, and the predetermined default line spacing ratio of the target font; According to the font size required by the text content, one of the font sizes with the smallest difference from the font size required by the text content is selected from a predetermined font size database as the initial font size of the text content based on the target font.

5. The font adjustment method for cross-platform text display according to any one of claims 2 to 4, characterized in that: After determining the candidate font size of the text content according to the display area information and the text length, the method further includes: Determining whether the current readability of the candidate font size meets a preset readability condition; When it is determined that the candidate font size does not meet the preset readability condition, the operation of adjusting the font size of the target font is stopped, and readability abnormality prompt information matching the candidate font size is output to prompt the user that the current readability of the candidate font size does not meet the readability condition; When it is determined that the candidate font size meets the readability condition, the operation of re-determining whether the text content meets the preset text overflow condition based on the candidate font size, the text length and the display area information to obtain a second judgment result is triggered.

6. The font adjustment method for cross-platform text display according to any one of claims 1 to 4, characterized in that: The character information includes the character type and the number of characters of the corresponding character type; And, determining the text length of the text content in the target font according to the character information and the predetermined target font to be displayed includes: Determine, according to a predetermined target font to be displayed, a character spacing between each of the characters in all the characters corresponding to the character information in the target font; According to the character information, all characters corresponding to the character information are grouped to obtain a plurality of character groups, wherein all characters in the same character group correspond to the same character type; According to the target font and each of the character types, determining the character length of each character in the character group corresponding to the character type in the target font; For each of the character groups, according to the number of characters in the character group and the character length of each character in the character group, the sum of the character lengths of the character group is calculated; According to the character spacing between each character in all the characters and the sum of the character lengths of each character group in all the character groups, the overall character length of all the characters is calculated as the text length of the text content in the target font.

7. The font adjustment method for cross-platform text display according to any one of claims 1 to 4, characterized in that: The method further comprises: Obtaining platform characteristics of the target platform; According to the platform characteristics of the target platform, a matching font is selected from a font database that can be displayed by the text display device as a target font to be displayed.

8. A font adjustment device for cross-platform text display, characterized in that: The device comprises: The acquisition module is used to obtain the text content input by the user on the target platform; A reading module, used for reading character information of the text content; A determination module, configured to determine the text length of the text content in the target font according to the character information and the determined target font to be displayed; The determination module is further configured to determine a target font size of the text content according to the determined initial font size of the target font and the text length of the text content; A rendering module is used to render the text content to a text display device of the target platform according to the target font size, so that the text display device displays the text content.

9. A network attached storage device, characterized in that: The network attached storage device is communicatively connected to a text display device, and the network attached storage device stores a memory having executable program codes; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the font adjustment method for cross-platform text display as described in any one of claims 1-7.

10. A computer storage medium, characterized in that: The computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the font adjustment method for cross-platform text display as described in any one of claims 1-7.

11. A font adjustment system for cross-platform text display, characterized in that: The system includes the font adjustment device for cross-platform text display as described in claim 8, or the network attached storage device and text display device as described in claim 9, and the font adjustment device for cross-platform text display or the network attached storage device is installed with a computer application capable of executing the method as described in any one of claims 1-7.