Font character weight automatic matching method based on intelligent recommendation and related device
By automatically identifying and matching missing font weights in design documents during UI software design, and recommending alternative font weights using predefined rules, the problem of time-consuming and error-prone font weight selection is solved, achieving efficient design consistency and reducing human error.
Patent Information
- Application Number
- CN202410934293.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-08
AI Technical Summary
In UI software design, the process of selecting and matching font weights is time-consuming and error-prone, especially when devices are changed or fonts are lost, requiring manual replacement and leading to design inconsistencies.
By identifying missing font weight information in design documents, the system recommends similar or identical alternative font weights using predefined matching rules, and performs matching and batch replacement according to a preset order, reducing manual selection time.
It improves design efficiency, reduces design errors, shortens subsequent revision and proofreading time, and ensures design consistency.
Smart Images

Figure CN118916542A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software design, and in particular to a method for automatically matching font weights based on intelligent recommendation and a related device. Background Art
[0002] In UI software design, the selection and matching of font weights are crucial to ensure the consistency and professionalism of the design draft. Fonts may be missing when changing devices, resetting fonts, or opening external shared design files. When a specific font weight is missing in the design tool, designers are often required to manually select similar alternative font weights one by one to reduce visual differences. The above process is time-consuming and error-prone. In addition, when the designer needs to edit the text content in the design file, if the font is missing, the text cannot be edited, and the missing font needs to be replaced. Usually, after the user chooses to replace the font, the first weight in the font weight list is selected by default, which may cause the replaced font weight to not match the original design draft, and the font weight needs to be modified again to achieve the desired effect.
[0003] To solve the above problem, the present invention proposes an automatic font weight matching method based on intelligent recommendation, which recommends alternative font weights that are the same or similar to the missing font weight information through predefined matching rules, so as to reduce the time for designers to manually search and select suitable font weights. Summary of the invention
[0004] In view of the above problems, a font weight automatic matching method based on intelligent recommendation and related devices are proposed to reduce the time for designers to manually search and select appropriate font weights.
[0005] According to one aspect of the present invention, a method for automatic font weight matching based on intelligent recommendation is provided, comprising:
[0006] Identify missing font weight information for the current page, all pages, and / or user-selected style elements in a design document;
[0007] Recommending a substitute font weight that is the same as or similar to the missing font weight information through a predefined matching rule; wherein, after determining a substitute font that is the same as the missing font, matching a substitute font weight that is the same as or similar to the missing font weight according to a preset weight matching order;
[0008] The substitute font weight is applied to the design document to complete batch replacement of missing font weights.
[0009] In an optional manner, the identifying missing font weight information of the current page, all pages and / or a specific style element selected by the user in the design document further includes:
[0010] Reading a text layer tree of the design document to identify the font weight information of each style element information; wherein the text layer tree includes page information and corresponding style element information;
[0011] For any style element, query whether its font weight information exists in the system font library. If not, the font weight status of the style element is considered as missing in the design environment;
[0012] Lists missing font weights for the current page, all pages, and / or user-selected style elements.
[0013] In an optional manner, the predefined matching rule further includes:
[0014] Matching a font weight with the same weight as the missing font weight in the font family to which the missing font weight belongs; if the match fails, searching for the font weight closest to the missing font weight in the font family;
[0015] If the font weight closest to the font is not found in the font family, a match is performed in other font families with similar styles.
[0016] In an optional manner, matching a replacement weight that is the same as or similar to the missing weight according to a preset weight matching order further includes:
[0017] Prioritize the weights with the same name as the missing weights. If no weight with the same name is found or the selected replacement font has only one weight, select the regular weight as the replacement weight.
[0018] If the weight of the selected replacement font does not have the regular font weight, then the bold font weight is taken as the replacement font weight;
[0019] If the weight of the selected replacement font does not have the aforementioned bold weight, then the light weight is selected as the replacement weight in the forward sequence;
[0020] If the weight of the selected replacement font does not match a weight of the same name and does not have a Regular weight, the first weight in its weight list is selected as the substitute weight.
[0021] In an optional manner, the regular font weight is: Regular / Normal / W4 / 400;
[0022] The order of the bold font weights is: Medium / W5 / 500, SemiBold / Dem iBold / W6 / 600, Bold / W7 / 700, ExtraBold / UltraBold / W8 / 800, Black / Heavy / W9 / 900;
[0023] The order of the thin font weights is: Light / W3 / 300, ExtraLight / UltraLight / W2 / 200, Thin / W1 / 100.
[0024] In an optional manner, applying the substitute font weight to the design document further comprises:
[0025] Traversing the text layer tree in the design document to find the design element with the missing font weight;
[0026] The font weight attribute of the design element is updated to the selected alternate font weight.
[0027] In an optional manner, the method further includes:
[0028] Preview design elements before and after alternate font weights before applying them to design documents;
[0029] If the designer accepts the recommended alternative font weight, the update operation is performed; otherwise, the alternative font weight is recommended again;
[0030] After or while applying the alternative font weight to the design document, the user's acceptance and selection preference for the alternative font weight is recorded, and in the subsequent automatic font weight matching process, the alternative font weight is preferentially recommended according to the user's preference.
[0031] In an optional manner, the method further includes:
[0032] Identify the language of the text content in the design document, and preset corresponding font weight templates according to different language types; wherein the language types of the font weight templates include but are not limited to: Chinese, English, Japanese and Korean;
[0033] Searching for an alternative font weight that is exactly the same as the missing font weight in the font weight template, and if not found, recommending the closest alternative font weight according to the similarity or priority order defined in the font weight template;
[0034] If the closest alternative font weight is not found, find an alternative font weight from the cloud font library.
[0035] According to another aspect of the present application, a device for automatically matching font weights based on intelligent recommendation is provided, comprising:
[0036] A missing font weight identification module is used to identify missing font weight information of the current page, all pages and / or the style elements selected by the user in the design document;
[0037] A substitute font weight matching module is used to recommend a substitute font weight that is the same as or similar to the missing font weight information through a predefined matching rule; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same as or similar to the missing font weight is matched according to a preset weight matching order;
[0038] The missing font weight replacement module is used to apply the substitute font weight to the design document to complete the batch replacement of the missing font weight.
[0039] According to another aspect of the present application, there is provided a computing device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;
[0040] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to execute operations corresponding to the above-mentioned font weight automatic matching method based on intelligent recommendation.
[0041] The solution provided by the above-mentioned embodiment of the present invention identifies the missing font weight information of the current page, all pages and / or the style elements selected by the user in the design document; recommends the substitute font weight that is the same as or similar to the missing font weight information through predefined matching rules; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same as or similar to the missing font weight is matched according to a preset weight matching order; the substitute font weight is applied to the design document to complete the batch replacement of the missing font weight. The present invention improves design efficiency by automatically matching font weights, thereby reducing the time for designers to manually search and select appropriate font weights. At the same time, it reduces design errors caused by improper human selection and reduces the time for subsequent revisions and proofreading.
[0042] 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 according to the contents of the specification. In order to make the above description 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 listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0044] Figure 1 A schematic diagram showing a flow chart of a method for automatic font weight matching based on intelligent recommendation according to an embodiment of the present invention;
[0045] Figure 2 A schematic diagram of replacing missing font weight matching according to an embodiment of the present invention is shown;
[0046] Figure 3 A schematic diagram showing automatic font weight matching after replacing an existing font with another font in an embodiment of the present invention is shown;
[0047] Figure 4 A schematic diagram of the entire file replacement according to an embodiment of the present invention is shown;
[0048] Figure 5 A schematic diagram of a selection area for replacement according to an embodiment of the present invention is shown;
[0049] Figure 6 A functional structure diagram of a method and device for automatically matching font weights based on intelligent recommendation according to an embodiment of the present invention is shown;
[0050] Figure 7 A schematic diagram of the structure of a computing device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0051] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0052] The inventor found that when using UI design software, designers often encounter many inconveniences caused by missing fonts, such as:
[0053] Example 1. Because the user changed the computer or accidentally reset all the fonts, the design draft prompted that the fonts were missing. The user hoped to automatically replace all of them in batches instead of modifying them one by one.
[0054] Example 2: When users download other people's design files, they don't need to replace the fonts and weights one by one in a very detailed manner. They can just replace them in batches with approximately uniform font weights.
[0055] Example 3: When the user hopes that the font is not missing, the font weight can be replaced with one click.
[0056] Example 4: The user wishes to be able to change the font weight of the selected style element or area.
[0057] Example 5. The user wants to support batch replacement of font weights in a single file and multiple pages.
[0058] To solve the above problem, the present invention proposes an automatic font weight matching method based on intelligent recommendation, which recommends alternative font weights that are the same or similar to the missing font weight information through predefined matching rules. After determining the alternative font that is the same as the missing font, the alternative font weight that is the same or similar to the missing font weight is matched according to a preset weight matching order, so as to reduce the time designers spend manually searching and selecting suitable font weights.
[0059] Before implementing the embodiments of the present invention, the technical terms involved below are uniformly explained here:
[0060] Glyph: Glyph is the basic element that makes up a font, usually referring to the shape of a single character or symbol.
[0061] Font: A font is a collection of characters and symbols with the same design style, including letters, numbers, punctuation marks, etc.
[0062] Font family: A font family is a group of fonts that have the same design base but vary in weight, width or slant.
[0063] Serif: Serif refers to the horizontal or curved lines that decorate the ends of letters or character strokes. Serif fonts are fonts with this kind of decoration.
[0064] Sans-serif: A sans-serif font is a font that has no serif decoration at the end of the letter or character strokes.
[0065] Font Weight: Font Weight describes the thickness of the font strokes. Common font weights include Thin, Light, Regular, Medium, Bold, etc.
[0066] Font Width: Font Width describes the horizontal stretch of font characters, such as thin, regular, extended, etc.
[0067] Italic: Italic fonts are a style that mimics handwriting italics and are often used to emphasize or differentiate text.
[0068] Baseline: The carrier is the baseline on which letters or text are arranged, and the bottoms of most characters are aligned with this line.
[0069] x-height: x-height refers to the height of the lowercase letter x. This height is usually used to measure the relative height of lowercase letters in a font.
[0070] Ascender: The ascender is the part of a letter stroke that extends upward from the baseline to the top, such as the vertical stroke of a lowercase b or h.
[0071] Descender: Descender refers to the part of the stroke of a letter that extends downward from the baseline to the bottom, such as the vertical stroke of a lowercase letter p or q.
[0072] The following describes in detail the method for automatic font weight matching based on intelligent recommendation and related devices proposed by the present invention through specific embodiments.
[0073] Embodiment 1:
[0074] Figure 1 FIG. 1 is a functional structure diagram of a method for automatically matching font weights based on intelligent recommendation according to an embodiment of the present invention. Specifically, Figure 1 As shown, the following steps are included:
[0075] Step S101, identifying missing font weight information of the current page, all pages and / or style elements selected by the user in the design document.
[0076] In this embodiment, by automatically identifying the font weight information in the design document, the missing font weight information can be quickly fed back, reducing the time for manual review. For example, the font weight information of the design elements or style elements of each page in the design document is parsed to extract the font name, weight and other information. The extracted information is compared with the predefined font library or online font service to confirm whether the font weight is available or missing, as shown in Table 1, and distinguish and mark whether the current page is missing, all pages are missing, or the selected style element is missing.
[0077] Table 1
[0078] Style element name Page Font Name Font Weight Missing state Missing range Home page title 1 Montserrat Bold no - Navigation bar text 1 Roboto Medium Yes(Current Page) The current page is missing subtitle 2 Open Sans Light Yes (all pages) All pages are missing Paragraph text A 2 Arial Regular no - Paragraph text B 3 Helvetica Bold no - Button 3 Futura Thin Yes(Selected) The selected style is missing Copyright information at the bottom 4 Arial Regular no -
[0079] In an optional manner, the identifying missing font weight information of the current page, all pages and / or a specific style element selected by the user in the design document further includes:
[0080] Reading a text layer tree of the design document to identify the font weight information of each style element information; wherein the text layer tree includes page information and corresponding style element information;
[0081] For any style element, query whether its font weight information exists in the system font library. If not, the font weight status of the style element is considered as missing in the design environment;
[0082] Lists missing font weights for the current page, all pages, and / or user-selected style elements.
[0083] In this embodiment, the current page, all pages or style elements selected by the user are checked to meet the needs of different scenarios. For example, the text layer tree of the design document is traversed and accessed using the internal data structure of the design software to obtain the font and weight information of each style element and the page information to which it belongs. The operating system's API or third-party library is called to query the system font library to check whether the font and weight specified by the style element exist in the current system. If there is no matching font weight in the system font library, the missing status of the style element is recorded. According to the query results, the missing font weight information of the current page, all pages or the style element selected by the user is listed.
[0084] Step S102, recommending a substitute font weight that is the same as or similar to the missing font weight information through predefined matching rules; wherein, after determining a substitute font that is the same as the missing font, matching a substitute font weight that is the same as or similar to the missing font weight according to a preset weight matching order.
[0085] In this embodiment, alternative font weights are automatically recommended through predefined matching rules, reducing the time for designers to manually search and trial and error. After determining the alternative font, the weight is further matched according to the preset weight matching order to avoid design problems caused by missing font weights and ensure that the recommended alternative is visually consistent or similar to the original design. For example, a database containing common fonts and their similar or alternative fonts can be established (such as Montserrat is missing, Roboto, Open Sans, etc. are recommended as alternative fonts). A set of weight matching orders is defined for each font, such as first matching the same weight (such as Bold to Bold), and if not, matching similar weights in turn (such as Bold to Semi-Bold or Heavy). Then, as shown in Table 2, for each missing font weight combination, first find an alternative font according to the font substitution rules. After finding the alternative font, try to match the alternative weight that is the same or similar to the missing weight according to the preset weight matching order.
[0086] Table 2
[0087]
[0088] In an optional manner, the predefined matching rule further includes:
[0089] Matching a font weight with the same weight as the missing font weight in the font family to which the missing font weight belongs; if the match fails, searching for the font weight closest to the missing font weight in the font family;
[0090] If the font weight closest to the font is not found in the font family, a match is performed in other font families with similar styles.
[0091] In this embodiment, for each missing font weight combination, a match is first performed within the font family to which it belongs. Check whether there is a font weight in the family that is exactly the same as the missing font weight. If there is no exactly the same one, then the closest alternative font weight is found within the family based on a preset similarity evaluation standard (such as weight difference, style difference, etc.). If no suitable alternative is found within the font family, cross-family matching is performed to match other font families with similar styles. A predefined font style similarity database or algorithm is used to identify which font families are similar in style to the missing font family. All found alternatives are sorted from high to low according to similarity, and a recommendation list is generated. Each alternative includes information such as font name, weight, similarity score, and preview image.
[0092] In an optional manner, matching a replacement weight that is the same as or similar to the missing weight according to a preset weight matching order further includes:
[0093] Prioritize the weights with the same name as the missing weights. If no weight with the same name is found or the selected replacement font has only one weight, select the regular weight as the replacement weight.
[0094] If the weight of the selected replacement font does not have the regular font weight, then the bold font weight is taken as the replacement font weight;
[0095] If the weight of the selected replacement font does not have the aforementioned bold weight, then the light weight is selected as the replacement weight in the forward sequence;
[0096] If the weight of the selected replacement font does not match a weight of the same name and does not have a Regular weight, the first weight in its weight list is selected as the substitute weight.
[0097] In this embodiment, the common character renaming correspondence table is shown in Table 3, wherein the regular font weight is: Regular / Normal / W4 / 400. The order of the bold font weight is: Medium / W5 / 500, SemiBold / DemiBold / W6 / 600, Bold / W7 / 700, ExtraBold / UltraBold / W8 / 800, Black / Heavy / W9 / 900. The order of the thin font weight is: Light / W3 / 300, ExtraLight / UltraLight / W2 / 200, Thin / W1 / 100.
[0098] Table 3
[0099] Common word renaming correspondence Ultra-fine / Thin / W1 / 100 Slim / ExtraLight / UltraLight / W2 / 200 Slim / Light / W3 / 300 Regular / Normal / W4 / 400 Medium / W5 / 500 SemiBold / DemiBold / W6 / 600 Bold / W7 / 700 ExtraBold / UltraBold / W8 / 800 Extra Bold / Black / Heavy / W9 / 900
[0100] like Figure 2 , Figure 3 As shown, click the missing font icon in the upper right corner to display the missing font panel, and select For example, after selecting Replace font, Prioritize matching and missing fonts If there is no value with the same name, select Regular / Normal / W4 / 400.
[0101] If the selected replacement font is only one , select the default value.
[0102] Select a replacement font When there is no Regular / Normal / W4 / 400, the value will be Medium / W5 / 500-Medium Bold / SemiBold / DemiBold / W6 / 600-Bold / Bold / W7 / 700-ExtraBold / UltraBold / W8 / 800-ExtraBold / Black / Heavy / W9 / 900.
[0103] Select a replacement font When there is no Regular / Normal / W4 / 400, Medium / W5 / 500, SemiBold / DemiBold / W6 / 600, Bold / W7 / 700, ExtraBold / UltraBold / W8 / 800, and ExtraBold / Black / Heavy / W9 / 900, the values forward are Light / W3 / 300, ExtraLight / UltraLight / W2 / 200, and Thin / W1 / 100.
[0104] Replace fonts If there is no value that is the same as the missing font rename and Regular / Normal / W4 / 400, then select this font. The first one in the list.
[0105] In an optional manner, the method further includes:
[0106] Identify the language of the text content in the design document, and preset corresponding font weight templates according to different language types; wherein the language types of the font weight templates include but are not limited to: Chinese, English, Japanese and Korean;
[0107] Searching for an alternative font weight that is exactly the same as the missing font weight in the font weight template, and if not found, recommending the closest alternative font weight according to the similarity or priority order defined in the font weight template;
[0108] If the closest alternative font weight is not found, find an alternative font weight from the cloud font library.
[0109] In this embodiment, by identifying the language type in the design document and presetting the font weight template of the corresponding language, fonts suitable for different language characteristics can be used to improve the internationalization level of the design. As shown in Table 4, when the local template cannot meet the needs, more novel font resources can be accessed by connecting to the cloud font resource library to further enrich the design options and improve the design quality.
[0110] Table 4
[0111]
[0112] Step S103, applying the substitute font weight to the design document to complete batch replacement of missing font weights.
[0113] like Figure 4 , Figure 5As shown, the alternative font weight is applied to the missing font weight information of the current page, all pages and / or style elements selected by the user of the design document, thereby completing batch replacement of the missing font weights.
[0114] In this embodiment, applying the substitute font weight to the design document further includes:
[0115] Traverse the text layer tree in the design document, find the design element with the missing font weight (i.e., the design software cannot find or cannot correctly render the specified font weight), and mark it as a target to be replaced. Update the font weight attribute of the design element to the selected alternative font weight.
[0116] In an optional manner, the method further includes:
[0117] Preview design elements before and after alternate font weights before applying them to design documents;
[0118] If the designer accepts the recommended alternative font weight, the update operation is performed; otherwise, the alternative font weight is recommended again;
[0119] After or while applying the alternative font weight to the design document, the user's acceptance and selection preference for the alternative font weight is recorded, and in the subsequent automatic font weight matching process, the alternative font weight is preferentially recommended according to the user's preference.
[0120] In this embodiment, the preview display can be a comparison chart placed side by side, or a dynamic preview that can be switched by a switch button. By analyzing the user's preference for alternative font weights, the user's aesthetic preferences, design requirements, and decisions made by balancing different factors can be understood. Machine learning can gradually improve the accuracy and personalization of recommendations to meet user expectations.
[0121] The solution provided by the above-mentioned embodiment of the present invention identifies the missing font weight information of the current page, all pages and / or the style elements selected by the user in the design document; recommends the substitute font weight that is the same as or similar to the missing font weight information through predefined matching rules; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same as or similar to the missing font weight is matched according to a preset weight matching order; the substitute font weight is applied to the design document to complete the batch replacement of the missing font weight. The present invention improves design efficiency by automatically matching font weights, thereby reducing the time for designers to manually search and select appropriate font weights. At the same time, it reduces design errors caused by improper human selection and reduces the time for subsequent revisions and proofreading.
[0122] Embodiment 2:
[0123] Figure 6 The functional structure diagram of the device provided in the embodiment of the present application is shown. Figure 6 As shown, the device comprises:
[0124] A missing font weight identification module 6001 is used to identify missing font weight information of the current page, all pages and / or the style element selected by the user in the design document;
[0125] The substitute font weight matching module 6002 is used to recommend substitute font weights that are the same or similar to the missing font weight information according to predefined matching rules; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same or similar to the missing font weight is matched according to a preset weight matching order;
[0126] The missing font weight replacement module 6003 is used to apply the substitute font weight to the design document to complete the batch replacement of the missing font weight.
[0127] The solution provided by the above-mentioned embodiment of the present invention identifies the missing font weight information of the current page, all pages and / or the style elements selected by the user in the design document; recommends the substitute font weight that is the same as or similar to the missing font weight information through predefined matching rules; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same as or similar to the missing font weight is matched according to a preset weight matching order; the substitute font weight is applied to the design document to complete the batch replacement of the missing font weight. The present invention improves design efficiency by automatically matching font weights, thereby reducing the time for designers to manually search and select appropriate font weights. At the same time, it reduces design errors caused by improper human selection and reduces the time for subsequent revisions and proofreading.
[0128] Embodiment three:
[0129] Figure 7 A schematic diagram of the structure of an embodiment of a computing device of the present application is shown. The specific embodiment of the present application does not limit the specific implementation of the computing device.
[0130] like Figure 7 As shown, the computing device may include: a processor (processor) 702 , a communications interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0131] The processor 702, the communication interface 704, and the memory 706 communicate with each other via the communication bus 708. The communication interface 704 is used to communicate with other devices such as a client or other server network elements. The processor 702 is used to execute the program 710, which can specifically execute the relevant steps in the embodiment of the automatic font weight matching method based on intelligent recommendation for a computing device.
[0132] Specifically, the program 710 may include program codes, which include computer operation instructions.
[0133] The processor 702 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the computing device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.
[0134] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0135] The program 710 may be specifically configured to enable the processor 702 to perform the following operations:
[0136] Identify missing font weight information for the current page, all pages, and / or user-selected style elements in a design document;
[0137] Recommending a substitute font weight that is the same as or similar to the missing font weight information through a predefined matching rule; wherein, after determining a substitute font that is the same as the missing font, matching a substitute font weight that is the same as or similar to the missing font weight according to a preset weight matching order;
[0138] The substitute font weight is applied to the design document to complete batch replacement of missing font weights.
[0139] Optionally, the program 710 enables the processor to perform the following operations:
[0140] Reading a text layer tree of the design document to identify the font weight information of each style element information; wherein the text layer tree includes page information and corresponding style element information;
[0141] For any style element, query whether its font weight information exists in the system font library. If not, the font weight status of the style element is considered as missing in the design environment;
[0142] Lists missing font weights for the current page, all pages, and / or user-selected style elements.
[0143] Optionally, the program 710 enables the processor to perform the following operations:
[0144] Matching a font weight with the same weight as the missing font weight in the font family to which the missing font weight belongs; if the match fails, searching for the font weight closest to the missing font weight in the font family;
[0145] If the font weight closest to the font is not found in the font family, a match is performed in other font families with similar styles.
[0146] Optionally, the program 710 may be specifically configured to enable the processor 702 to perform the following operations:
[0147] Prioritize the weights with the same name as the missing weights. If no weight with the same name is found or the selected replacement font has only one weight, select the regular weight as the replacement weight.
[0148] If the weight of the selected replacement font does not have the regular font weight, then the bold font weight is taken as the replacement font weight;
[0149] If the weight of the selected replacement font does not have the aforementioned bold weight, then the light weight is selected as the replacement weight in the forward sequence;
[0150] If the weight of the selected replacement font does not match a weight of the same name and does not have a Regular weight, the first weight in its weight list is selected as the substitute weight.
[0151] Optionally, the regular font weight is: Regular / Normal / W4 / 400;
[0152] The order of the bold font weights is: Medium / W5 / 500, SemiBold / Dem iBold / W6 / 600, Bold / W7 / 700, ExtraBold / UltraBold / W8 / 800, Black / Heavy / W9 / 900;
[0153] The order of the thin font weights is: Thin / Light / W3 / 300, ExtraLight / UltraLight / W2 / 200, and Thin / W1 / 100.
[0154] Optionally, the program 710 may be specifically configured to enable the processor 702 to perform the following operations:
[0155] Traversing the text layer tree in the design document to find the design element with the missing font weight;
[0156] The font weight attribute of the design element is updated to the selected alternate font weight.
[0157] Optionally, the program 710 may be specifically configured to enable the processor 702 to perform the following operations:
[0158] Preview design elements before and after alternate font weights before applying them to design documents;
[0159] If the designer accepts the recommended alternative font weight, the update operation is performed; otherwise, the alternative font weight is recommended again;
[0160] After or while applying the alternative font weight to the design document, the user's acceptance and selection preference for the alternative font weight is recorded, and in the subsequent automatic font weight matching process, the alternative font weight is preferentially recommended according to the user's preference.
[0161] Optionally, the program 710 may be specifically configured to enable the processor 702 to perform the following operations:
[0162] Identify the language of the text content in the design document, and preset corresponding font weight templates according to different language types; wherein the language types of the font weight templates include but are not limited to: Chinese, English, Japanese and Korean;
[0163] Searching for an alternative font weight that is exactly the same as the missing font weight in the font weight template, and if not found, recommending the closest alternative font weight according to the similarity or priority order defined in the font weight template;
[0164] If the closest alternative font weight is not found, find an alternative font weight from the cloud font library.
[0165] The solution provided by the above-mentioned embodiment of the present invention identifies the missing font weight information of the current page, all pages and / or the style elements selected by the user in the design document; recommends the substitute font weight that is the same as or similar to the missing font weight information through predefined matching rules; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same as or similar to the missing font weight is matched according to a preset weight matching order; the substitute font weight is applied to the design document to complete the batch replacement of the missing font weight. The present invention improves design efficiency by automatically matching font weights, thereby reducing the time for designers to manually search and select appropriate font weights. At the same time, it reduces design errors caused by improper human selection and reduces the time for subsequent revisions and proofreading.
[0166] The algorithm or display provided herein is not inherently related to any particular computer, virtual system or other equipment. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the embodiment of the present invention is not directed to any specific programming language yet. It should be understood that various programming languages can be utilized to realize the content of the present invention described herein, and the description made to specific languages above is for disclosing the best mode of the present invention.
[0167] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.
[0168] Similarly, it should be understood that in order to streamline the present invention and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, the various features of the embodiments of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the following intention: that the claimed invention requires more features than the features explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.
[0169] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.
[0170] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.
[0171] The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all functions of some or all components according to embodiments of the present invention. The present invention can also be implemented as a device or apparatus program (e.g., computer program and computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention can be stored on a computer-readable medium, or can have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0172] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
Claims
1. A method for automatically matching font weight based on intelligent recommendation, characterized in that: include: Identify missing font weight information for the current page, all pages, and / or user-selected style elements in a design document; Recommending a substitute font weight that is the same as or similar to the missing font weight information through a predefined matching rule; wherein, after determining a substitute font that is the same as the missing font, matching a substitute font weight that is the same as or similar to the missing font weight according to a preset weight matching order; The substitute font weight is applied to the design document to complete batch replacement of missing font weights.
2. The method for automatic font weight matching based on intelligent recommendation according to claim 1, characterized in that: The identifying of missing font weight information of the current page, all pages and / or a specific style element selected by the user in the design document further includes: Reading a text layer tree of the design document to identify the font weight information of each style element information; wherein the text layer tree includes page information and corresponding style element information; For any style element, query whether its font weight information exists in the system font library. If not, the font weight status of the style element is considered as missing in the design environment; Lists missing font weight information for the current page, all pages, and / or user-selected style elements.
3. The method for automatic font weight matching based on intelligent recommendation according to claim 1 or 2, characterized in that: The predefined matching rules further include: Matching a font weight with the same weight as the missing font weight in the font family to which the missing font weight belongs; if the match fails, searching for the font weight closest to the missing font weight in the font family; If the font weight closest to the font is not found in the font family, a match is performed in other font families with similar styles.
4. The method for automatic font weight matching based on intelligent recommendation according to claim 1, characterized in that: The step of matching a replacement weight that is the same as or similar to the missing weight according to the preset weight matching order further includes: Prioritize the weights with the same name as the missing weights. If no weight with the same name is found or the selected replacement font has only one weight, select the regular weight as the replacement weight. If the weight of the selected replacement font does not have the regular font weight, then the bold font weight is taken as the replacement font weight; If the weight of the selected replacement font does not have the aforementioned bold weight, then the light weight is selected as the replacement weight in the forward sequence; If the weight of the selected replacement font does not match a weight of the same name and does not have a Regular weight, the first weight in its weight list is selected as the substitute weight.
5. The method for automatic font weight matching based on intelligent recommendation according to claim 4, characterized in that: The regular font weight is: Regular / Normal / W4 / 400; The order of the bold font weights is: Medium / W5 / 500, SemiBold / Dem iBold / W6 / 600, Bold / W7 / 700, ExtraBold / UltraBold / W8 / 800, Black / Heavy / W9 / 900; The order of the thin font weights is: Light / W3 / 300, ExtraLight / UltraLight / W2 / 200, Thin / W1 / 100.
6. The method for automatic font weight matching based on intelligent recommendation according to claim 1, characterized in that: The applying the substitute font weight to the design document further comprises: Traversing the text layer tree in the design document to find the design element with the missing font weight; The font weight attribute of the design element is updated to the selected alternate font weight.
7. The method for automatic font weight matching based on intelligent recommendation according to claim 1, characterized in that: The method further comprises: Preview design elements before and after alternate font weights before applying them to design documents; If the designer accepts the recommended alternative font weight, the update operation is performed; otherwise, the alternative font weight is recommended again; After or while applying the alternative font weight to the design document, the user's acceptance and selection preference for the alternative font weight is recorded, and in the subsequent automatic font weight matching process, the alternative font weight is preferentially recommended according to the user's preference.
8. The method for automatic font weight matching based on intelligent recommendation according to claim 1, characterized in that: The method further comprises: Identify the language of the text content in the design document, and preset corresponding font weight templates according to different language types; wherein the language types of the font weight templates include but are not limited to: Chinese, English, Japanese and Korean; Searching for an alternative font weight that is exactly the same as the missing font weight in the font weight template, and if not found, recommending the closest alternative font weight according to the similarity or priority order defined in the font weight template; If the closest alternative font weight is not found, find an alternative font weight from the cloud font library.
9. A device for automatically matching font weight based on intelligent recommendation, characterized in that: include: A missing font weight identification module is used to identify missing font weight information of the current page, all pages and / or the style elements selected by the user in the design document; A substitute font weight matching module is used to recommend a substitute font weight that is the same as or similar to the missing font weight information through a predefined matching rule; wherein, after determining the substitute font that is the same as the missing font, the substitute font weight that is the same as or similar to the missing font weight is matched according to a preset weight matching order; The missing font weight replacement module is used to apply the substitute font weight to the design document to complete the batch replacement of the missing font weight.
10. A computing device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the method for automatic font weight matching based on intelligent recommendation as described in any one of claims 1-8.
