A method for adjusting font weight and storage medium
By collecting on-site environmental information and user data, using machine learning algorithm models to predict font demands, and dynamically adjust font weight, the problem of adaptive font adjustment in the existing technology cannot be adjusted, and the user experience and information acquisition efficiency is improved.
Patent Information
- Application Number
- CN202411164627.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2044-08-23
AI Technical Summary
The existing adaptive font adjustment scheme cannot adjust the weight in a targeted manner, resulting in a poor user experience.
By collecting on-site environment information, user information and real-time data, inputting machine learning algorithm models for demand analysis, predicting users' font needs in the current scenario, and dynamically adjusting the font weight.
It significantly improves the user's reading experience and information acquisition efficiency, can adapt to the needs of different users and scenarios, and provide a better reading experience.
Smart Images

Figure CN118689581B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of font adjustment, and in particular to a font weight adjustment method and a storage medium. Background Art
[0002] In the modern information technology era, the design of the user interface is crucial to the user experience. In particular, the selection and adjustment of fonts can significantly affect the user's reading experience and information acquisition efficiency.
[0003] Font properties include: font type, size, weight, and text style.
[0004] The font weight refers to the thickness of the text font, and the font thickness of texts with different font weights is different. The system font of the terminal device is usually configured with different font weights, and the terminal device can call system texts with different font weights to display on the display interface.
[0005] Generally speaking, users can set certain elements displayed on the display interface according to usage requirements to present different display effects, such as personalizing font size, font weight, font type, font color, etc.
[0006] Existing personalized setting solutions mainly rely on manual selection. Traditional fixed font design is difficult to meet the needs of different users and different scenarios, so corresponding adaptive font adjustment solutions have been derived. Existing font adaptive solutions are mainly divided into two categories:
[0007] First, user adaptation is performed based on the historical choices of different users. This adjustment solution cannot actually be adjusted according to the scenario, but is only based on user pre-settings, and has poor flexibility.
[0008] Second, the font size is adaptively adjusted according to the distance between the user and the display screen (for example, the Chinese patent application number 202310462091.X "Automotive HMI font adjustment control method, device, electronic device and medium"). This solution only adjusts the font size, but cannot adjust the font weight of the system text. The contrast of the display elements on the screen is fixed, and the user's reading experience is poor. Summary of the invention
[0009] The present invention provides a font weight adjustment method and a storage medium, which solve the technical problems that the existing font adaptive adjustment scheme cannot adaptively adjust the font weight in a targeted manner and has a poor user experience.
[0010] In order to solve the above technical problems, the present invention provides a method for adjusting font weight, comprising:
[0011] Respond to the interface display instructions, collect on-site environmental information, and analyze the on-site environmental information to obtain user information, scene information and real-time data;
[0012] The user information, the scene information and the real-time data are used as judgment factors and input into a machine learning algorithm model to perform demand analysis, predict the font demand of the user in the current scene, and obtain a prediction result;
[0013] Outputting font attributes according to the prediction result and performing font adjustment; the font attributes include font weight.
[0014] When this basic solution obtains the interface display instructions and determines that the display screen can meet the display requirements, it automatically collects on-site environmental information, covering judgment factors such as user information, scene information and real-time data, and then substitutes it into the machine learning algorithm model to perform demand analysis, predict the user's font requirements in the current scenario, obtain the prediction results and dynamically adjust the font weight, which significantly improves the user's reading experience and information acquisition efficiency, and has broad application prospects.
[0015] In a further embodiment, the analysis of the user information includes:
[0016] When receiving the interface display instruction, the user information is obtained through image acquisition or user input, the user information is analyzed to obtain the personal information of the current user, and the user identity is identified through the user information database and the identity verification system, thereby obtaining the corresponding user information;
[0017] The user information includes one or more of age, gender, reading preference, and font size preference; the on-site environment information includes user information.
[0018] When adjusting the font weight, this solution simultaneously incorporates the judgment of user information, and provides users with a display experience tailored to their different preferences, thereby improving the readability and user experience of the user interface.
[0019] In a further embodiment, the analysis of the scene information includes:
[0020] When receiving the interface display instruction, the current environment data is obtained through the sensor data interface, and the current environment data is analyzed and matched with the pre-classified application scenarios or compared and classified with the pre-defined scenario thresholds to determine the current usage scenario;
[0021] The current environment data includes at least one of the ambient light and the device type, and the device type includes at least one of the device display screen size and resolution.
[0022] When adjusting the font weight, this solution simultaneously incorporates the judgment of ambient light and device type, and makes adaptive adjustments based on different environments and different device display conditions. It is compatible with the display requirements of a variety of different scenarios and provides users with a good reading experience.
[0023] In a further embodiment, the acquisition of the real-time data comprises:
[0024] Query the interaction log recorder to obtain interaction data that records user operation behaviors from the interaction log;
[0025] Scan the user's face, obtain facial expressions and perform recognition analysis to obtain the user's emotional state data; the real-time data includes real-time collection of the user's interaction data and emotional state data.
[0026] When adjusting the font weight, this solution simultaneously incorporates the judgment of the user's operating behavior and emotional state data, and predicts the user's habits through the user's operating behavior, which can reduce the difficulty of prediction; based on the recognition of the user's facial expression to obtain the emotional state data, combined with the user's emotions at the current time, it can further assist in accurately predicting the user's font needs.
[0027] In a further implementation scheme, before conducting the demand analysis, it also includes: obtaining user information, scenario information and real-time data from historical data, establishing a training set and a test set, inputting the training set into the machine learning algorithm model for training and learning, and using the test set to verify the prediction results, obtain the corresponding regression coefficient and save it.
[0028] In a further implementation scheme, the user information, scene information and real-time data are used as judgment factors and input into a machine learning algorithm model to perform demand analysis, predict the font demand of the user in the current scene, and obtain the prediction result including:
[0029] The user information, the scene information and the real-time data are used as judgment factors, input into a machine learning algorithm model, and calculated to obtain a predicted font weight value;
[0030] The corresponding font weight is determined based on the font weight value, and the obtained font weight is the font requirement of the user in the current scenario, and then a prediction result including the font weight is output.
[0031] In a further embodiment, the calculation formula of the machine learning algorithm model is as follows:
[0032]
[0033] Among them, P w is the predicted font weight value, U iis user information, n represents the number of user information; S j is the scene information, m represents the number of scene information; I k is the interaction data, p represents the number of interaction data; E l is the emotional state data, q represents the number of emotional state features; β0 is the bias term, β i is the regression coefficient of the user information feature, γ j is the regression coefficient of the scene information feature, δ k is the regression coefficient of the interaction data feature, λ l is the regression coefficient of the affective state feature.
[0034] This solution uses a machine learning algorithm model to predict demand, combines machine algorithms, and integrates user information, scene information, real-time data and other multi-faceted judgment factors for comprehensive consideration. It can efficiently predict results and improve the adaptability of font weight adjustment.
[0035] In a further embodiment, determining the corresponding font weight based on the font weight value includes:
[0036] According to the numerical range of the font weight value, a plurality of levels of font weight options are divided, wherein the font weight options include a first font weight, a second font weight and a third font weight;
[0037] Determine whether the font weight value is greater than a first threshold value, if so, obtain the first font weight as the font weight; determine whether the font weight value is less than the first threshold value and greater than a second threshold value, if so, obtain the second font weight as the font weight; determine whether the font weight value is less than a third threshold value, if so, obtain the third font weight as the font weight.
[0038] This solution is based on different levels of font weight options, and correspondingly divides the first threshold, second threshold, and third threshold. By clarifying the range of font weight values, the current adapted font weight can be determined. The font thickness can be dynamically adjusted according to user information, emotional state, and current scene, thereby improving the user's reading experience and information acquisition efficiency.
[0039] In a further embodiment, outputting font attributes according to the prediction result and performing font adjustment comprises:
[0040] Selecting a corresponding target font and target weight from a dynamic font library based on the above font weight;
[0041] Based on the target font and the target font weight, the font display of the user interface is updated in real time through a rendering engine.
[0042] The present invention also provides a storage medium on which a computer program is stored, and the computer program is used to implement a method for adjusting word weight as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM). BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a workflow diagram of a method for adjusting font weight and a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0044] The following specifically illustrates the implementation mode of the present invention in conjunction with the accompanying drawings. The embodiments are provided for illustrative purposes only and cannot be understood as limiting the present invention. The accompanying drawings are provided for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0045] Example 1
[0046] An embodiment of the present invention provides a method for adjusting font weight, such as Figure 1 As shown, in this embodiment, it includes:
[0047] S1, responding to the interface display instruction, collecting on-site environment information, and analyzing the on-site environment information to obtain user information, scene information and real-time data;
[0048] In this embodiment, the analysis of the user information includes:
[0049] When receiving the interface display instruction, the user information is obtained through image acquisition or user input, the user information is analyzed to obtain the personal information of the current user, and the user identity is identified through the user information database and the identity verification system, thereby obtaining the corresponding user information;
[0050] The user information includes one or more of age, gender, reading preference, and font size preference; the on-site environment information includes user information.
[0051] When adjusting the font weight, this solution simultaneously incorporates the judgment of user information, and provides users with a display experience tailored to their different preferences, thereby improving the readability and user experience of the user interface.
[0052] In this embodiment, the analysis of the scene information includes:
[0053] When receiving the interface display instruction, the current environment data is obtained through the sensor data interface, and the current environment data is analyzed and matched with the pre-classified application scenarios or compared and classified with the pre-defined scenario thresholds to determine the current usage scenario;
[0054] The current environment data includes at least one of the ambient light and the device type, and the device type includes at least one of the device display screen size and resolution. The division of usage scenarios can be customized according to the specific ambient light (such as strong light, weak light) and device type, and this embodiment does not limit it.
[0055] When adjusting the font weight, this solution simultaneously incorporates the judgment of ambient light and device type, and makes adaptive adjustments based on different environments and different device display conditions. It is compatible with the display requirements of a variety of different scenarios and provides users with a good reading experience.
[0056] In this embodiment, the acquisition of real-time data includes:
[0057] Query the interaction log recorder to obtain interaction data that records user operation behaviors from the interaction log;
[0058] Scan the user's face, obtain facial expressions and perform recognition analysis to obtain the user's emotional state data; the real-time data includes real-time collection of the user's interaction data and emotional state data.
[0059] Among them, the conventional facial expression recognition technology of "expressing various emotional states through changes in eye muscles, facial muscles and mouth muscles" is adopted, and this embodiment will not be repeated.
[0060] When adjusting the font weight, this solution simultaneously incorporates the judgment of the user's operating behavior and emotional state data, and predicts the user's habits through the user's operating behavior, which can reduce the difficulty of prediction; based on the recognition of the user's facial expression to obtain the emotional state data, combined with the user's emotions at the current time, it can further assist in accurately predicting the user's font needs.
[0061] S2. Using the user information, scene information and real-time data as judgment factors, inputting them into a machine learning algorithm model to perform demand analysis, predict the font demand of the user in the current scene, and obtaining a prediction result, including:
[0062] S21, using the user information, scene information and real-time data as judgment factors, inputting them into a machine learning algorithm model, and calculating to obtain a predicted font weight value;
[0063] In this embodiment, the calculation formula of the machine learning algorithm model is as follows:
[0064]
[0065] Among them, P w is the predicted font weight value, U i is user information, n represents the number of user information; S j is the scene information, m represents the number of scene information; I k is the interaction data, p represents the number of interaction data; E l is the emotional state data, q represents the number of emotional state features; β0 is the bias term, β i is the regression coefficient of the user information feature, γ j is the regression coefficient of the scene information feature, δ k is the regression coefficient of the interaction data feature, λ l is the regression coefficient of the affective state feature.
[0066] This solution uses a machine learning algorithm model to predict demand, combines machine algorithms, and integrates user information, scene information, real-time data and other multi-faceted judgment factors for comprehensive consideration. It can efficiently predict results and improve the adaptability of font weight adjustment.
[0067] S22: Determine the corresponding font weight based on the font weight value, the obtained font weight is the font requirement of the user in the current scenario, and then output a prediction result including the font weight.
[0068] In this embodiment, determining the corresponding font weight based on the font weight value includes:
[0069] According to the numerical range of the font weight value, a plurality of levels of font weight options are divided, wherein the font weight options include a first font weight, a second font weight and a third font weight;
[0070] Determine whether the font weight value is greater than a first threshold value, if so, obtain the first font weight as the font weight; determine whether the font weight value is less than the first threshold value and greater than a second threshold value, if so, obtain the second font weight as the font weight; determine whether the font weight value is less than a third threshold value, if so, obtain the third font weight as the font weight.
[0071] Specifically, the font weight selection formula is used for selection. The font weight selection formula is as follows:
[0072]
[0073] Among them, F w Indicates the font weight, P w Represents the predicted font weight value, light represents a thinner font, regular represents a regular font weight, and bold represents a thicker font.
[0074] This solution is based on different levels of font weight options, and correspondingly divides the first threshold, second threshold, and third threshold. By clarifying the range of font weight values, the current adapted font weight can be determined. The font thickness can be dynamically adjusted according to user information, emotional state, and current scene, thereby improving the user's reading experience and information acquisition efficiency.
[0075] In this embodiment, before conducting the demand analysis, it also includes: S0, obtaining user information, scenario information and real-time data from historical data, establishing a training set and a test set, inputting the training set into the machine learning algorithm model for training and learning, and using the test set to verify the prediction results, obtain the corresponding regression coefficient and save it.
[0076] S3, outputting font attributes according to the prediction result, and performing font adjustment, including:
[0077] S31, selecting a target font weight from a dynamic font library based on the font weight, and selecting a corresponding target font from the dynamic font library based on user preference or the user;
[0078] The dynamic font library contains multiple fonts and their different weight versions.
[0079] S32: Based on the target font and the target font weight, update the font display of the user interface in real time through a rendering engine.
[0080] The font rendering formula is as follows:
[0081]
[0082] Among them, R f Indicates the rendered font, F w Indicates the selected font weight, F s Indicates the font style, D c represents the characteristics of the display device, ε represents the environmental factors, and α1, α2, α3, and α4 are weight parameters adjusted according to the actual effects.
[0083] The font attributes include but are not limited to font type, size, thickness, and text style.
[0084] Take the current scenario of reading mode, emotion adjustment, and user switching as an example:
[0085] Reading mode: Data analysis predicts that the user needs a bolder font to improve readability, and outputs the predicted value P w , such as the predicted value P w If the font weight is 650, select "bold" and the rendering engine will update the font display in real time to improve the user's reading experience.
[0086] Emotional regulation: Data analysis predicts that the user is in a low mood, and recommends using a softer font style, such as the predicted value P w If the font weight is 250, the “light” font weight is selected, and the rendering engine updates the font display in real time to ease the user’s emotions.
[0087] User switching: Data analysis detects that a user switches from one user account to another, and predicts that the font weight needs to be adjusted according to the preferences and needs of the new user, such as the predicted value P w If the font weight is 500, the "regular" font weight is selected, and the rendering engine updates the font display in real time to adapt to the usage habits and preferences of new users.
[0088] When the embodiment of the present invention obtains the interface display instruction and determines that the display screen realizes the display demand, it automatically collects the on-site environmental information, covers the judgment factors such as user information, scene information and real-time data, and then substitutes it into the machine learning algorithm model to perform demand analysis, predict the user's font demand in the current scene, obtain the prediction result and dynamically adjust the font weight, which significantly improves the user's reading experience and information acquisition efficiency, and has broad application prospects.
[0089] Example 2
[0090] The embodiment of the present invention further provides a storage medium on which a computer program is stored, and the computer program is used to implement a method for adjusting font weight as provided in the above embodiment 1. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0091] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A method for adjusting font weight, characterized in that: include: Respond to the interface display instructions, collect on-site environmental information, and analyze the on-site environmental information to obtain user information, scene information and real-time data; The user information, the scene information and the real-time data are used as judgment factors and input into a machine learning algorithm model to perform demand analysis, predict the font demand of the user in the current scene, and obtain a prediction result; Outputting font attributes according to the prediction result and performing font adjustment; the font attributes include font weight: The real-time data includes real-time collection of user interaction data and emotional state data; The acquisition of the real-time data includes scanning the user's face, acquiring the facial expression and performing recognition analysis to obtain the user's emotional state data; The analysis of the user information includes: When receiving the interface display instruction, the user information is obtained through image acquisition or user input, the user information is analyzed to obtain the personal information of the current user, and the user identity is identified through the user information database and the identity verification system, thereby obtaining the corresponding user information; The user information includes one or more of age, gender, reading preference, and font size preference; the on-site environment information includes user information; The analysis of the scene information includes: When receiving the interface display instruction, the current environment data is obtained through the sensor data interface, and the current environment data is analyzed and matched with the pre-classified application scenarios or compared and classified with the pre-defined scenario thresholds to determine the current usage scenario; The current environment data includes at least one of the ambient light and the device type, and the device type includes at least one of the device display screen size and resolution; The acquisition of the real-time data also includes: Query the interaction log recorder to obtain interaction data that records user operation behaviors from the interaction log; The user information, scene information and real-time data are used as judgment factors and input into a machine learning algorithm model to perform demand analysis, predict the font demand of the user in the current scene, and obtain the prediction results including: The user information, the scene information and the real-time data are used as judgment factors, input into a machine learning algorithm model, and calculated to obtain a predicted font weight value; Determine the corresponding font weight based on the font weight value, the obtained font weight is the font requirement of the user in the current scenario, and then output a prediction result including the font weight; The calculation formula of the machine learning algorithm model is as follows: in, is the predicted font weight value, is the user information, n represents the number of user information; is the scene information, m represents the number of scene information; is the interaction data, and p represents the number of interaction data; is the emotional state data, q represents the number of features of the emotional state; is the bias term, is the regression coefficient of the user information feature, is the regression coefficient of the scene information feature, is the regression coefficient of the interaction data feature, is the regression coefficient of the affective state feature; Determining the corresponding font weight based on the font weight value includes: According to the numerical range of the font weight value, a plurality of levels of font weight options are divided, wherein the font weight options include a first font weight, a second font weight and a third font weight; Determine whether the font weight value is greater than a first threshold value, if so, obtain the first font weight as the font weight; determine whether the font weight value is less than the first threshold value and greater than a second threshold value, if so, obtain the second font weight as the font weight; determine whether the font weight value is less than a third threshold value, if so, obtain the third font weight as the font weight.
2. A method for adjusting font weight as claimed in claim 1, characterized in that: Before conducting demand analysis, it also includes: obtaining user information, scenario information and real-time data from historical data, establishing a training set and a test set, inputting the training set into the machine learning algorithm model for training and learning, and using the test set to verify the prediction results, obtain the corresponding regression coefficient and save it.
3. A method for adjusting font weight as claimed in claim 2, characterized in that: Outputting font attributes according to the prediction result and performing font adjustment includes: Selecting a corresponding target font and target weight from a dynamic font library based on the font weight; Based on the target font and the target font weight, the font display of the user interface is updated in real time through a rendering engine.
4. A storage medium having a computer program stored thereon, characterized in that: The computer program is used to implement a method for adjusting font weight as claimed in any one of claims 1 to 3.
