Character display method, device, electronic device and storage medium
By generating and applying the second layer color vector and adjusting the brightness of characters, the problem of excessive or too dark character display colors in different external environments is solved, and the visual comfort is improved.
Patent Information
- Application Number
- CN202111113007.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-23
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2041-09-23
AI Technical Summary
In different external environments, when users view characters in electronic documents through terminal devices, the display color of the characters may be too bright or too dark, resulting in eye discomfort in the user and unable to meet the needs of visual comfort.
By obtaining the first layer color vector and brightness threshold of the characters, a second layer color vector is generated, and its color matching is filled to each character outline layer, and the characters displayed on the display interface are sequentially superimposed to generate characters displayed on the display interface, thereby adjusting the brightness of the characters, ease the brightness contrast intensity of the characters and the display interface.
It realizes that the brightness of characters is adjusted under different external environments to ensure that the character display meets the user's visual comfort needs, and avoids eye discomfort caused by excessive brightness or darkness of the character color.
Smart Images

Figure CN113869002B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a character display method, device, electronic device and storage medium. Background Art
[0002] The user uses the terminal device to view the character content in the electronic document. In the related art, the characters displayed on the display interface of the terminal device are usually displayed in black, white or other colors set by the user. Because the display color of the characters is set by default through the software (such as text documents, spreadsheet documents, presentation documents, etc.), or is personalized based on the user's preference for the character color, and the characters are always displayed in this color based on the setting. The external environment in which the user uses the terminal device varies. For example, the user may view electronic documents through the terminal device in external environments such as outdoors during the day, outdoors at night, and indoors with lights on.
[0003] Usually, in order to adjust the brightness deviation between the display interface of the terminal device and the external environment, the user will brighten or dim the display interface of the terminal device, while the display color of the characters viewed by the user remains at the set color. When the user views the characters on the display interface with changing brightness, the characters may be too bright or too dark, causing eye discomfort to the user. This cannot meet the user's visual comfort requirements for viewing characters through the terminal device in different external environments. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a character display method, device, electronic device and storage medium, which adjusts the display brightness of the characters on the display interface to display characters that meet the user's visual comfort requirements in different external environments.
[0005] In a first aspect of an embodiment of the present application, an embodiment of the present application provides a character display method, comprising:
[0006] Obtain the first layer color vector, character outline layer and layer identifier of the character, and obtain the brightness threshold;
[0007] Generate a second layer color vector according to the brightness threshold and the first layer color vector;
[0008] The color of the second layer color vector is filled into each character outline layer, and according to the layer identifier corresponding to each character outline layer, the character outline layers after the color matching processing are sequentially superimposed to generate the characters displayed on the display interface.
[0009] Preferably, generating the second layer color vector according to the brightness threshold and the first layer color vector comprises:
[0010] Determining a first brightness value of the character based on color values of pixels in the character;
[0011] Determining a brightness adjustment value based on the first brightness value and a brightness threshold;
[0012] The second layer color vector is generated according to the brightness adjustment value and the first layer color vector.
[0013] Preferably, determining the first brightness value of the character based on the color value of the pixel in the character comprises:
[0014] Obtaining the pixel value of each pixel of the character, respectively calculating the average value of the pixel value of each pixel channel, and using the average value as the color value of the pixel;
[0015] The average values of the pixel values of each pixel channel are weighted and summed to obtain the first brightness value of the character.
[0016] Preferably, determining the brightness adjustment value based on the first brightness value and the brightness threshold comprises:
[0017] Calculating a difference between the first brightness value and the brightness threshold;
[0018] Performing logarithmic calculation on the difference;
[0019] The logarithmic calculation result is used as the brightness adjustment value.
[0020] Preferably, before performing logarithmic calculation on the difference, the method further comprises:
[0021] Determine whether the difference is greater than a first natural number;
[0022] In the case where the difference is greater than the first natural number, a logarithm calculation step is performed.
[0023] Preferably, the method further comprises:
[0024] When the brightness adjustment value is determined, the pixel values of each pixel of the character are traversed, the difference between the pixel value of each pixel and the brightness adjustment value is calculated, and the color matching of the difference of each pixel is used as the filling color of the character outline layer.
[0025] Preferably, before determining the first brightness value of the character based on the color value of the pixel in the character, the method further comprises:
[0026] Obtain a second brightness value of the display interface;
[0027] When the second brightness value is less than the brightness threshold, the step of acquiring the first brightness value of the character is performed.
[0028] Preferably, generating the second layer color vector according to the brightness adjustment value and the first layer color vector comprises:
[0029] Calculating the difference between the first layer color vector and the brightness adjustment value;
[0030] The difference is used as the second layer color vector.
[0031] Preferably, the step of generating the second layer color vector according to the brightness adjustment value and the first layer color vector further includes:
[0032] When the first brightness value is less than the brightness threshold, the brightness adjustment value is set to a second natural number.
[0033] Preferably, the method further comprises:
[0034] The character data of the first layer color vector, the character outline layer, the layer identifier and the second layer color vector are stored in a font file, the font file is set in an electronic document, and the character is displayed according to the character data.
[0035] In a second aspect of the embodiment of the present application, the embodiment of the present application provides a character display device, including:
[0036] An acquisition module, used to acquire the first layer color vector, the character outline layer and the layer identifier of the character, and to acquire the brightness threshold;
[0037] A determination module, configured to generate a second layer color vector according to the brightness threshold and the first layer color vector;
[0038] The character generation module is used to fill the color of the second layer color vector into each character outline layer, and according to the layer identifier corresponding to each character outline layer, sequentially superimpose the character outline layers after each color matching process to generate the characters displayed on the display interface.
[0039] In a third aspect of the embodiments of the present application, the embodiments of the present application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0040] The memory is used to store computer programs;
[0041] The processor is used to implement the character display method described in any one of the first aspects above when executing the computer program stored in the memory.
[0042] In a fourth aspect of the embodiments of the present application, the embodiments of the present application provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the character display method described in any one of the first aspects above is implemented.
[0043] The embodiment of the present application provides a method, device, electronic device and storage medium for displaying characters, which obtains a first layer color vector, a character outline layer and a layer identifier of a character, and obtains a brightness threshold; generates a second layer color vector according to the brightness threshold and the first layer color vector; fills the color of the second layer color vector into each character outline layer, and according to the layer identifier corresponding to each character outline layer, sequentially superimposes each color-processed character outline layer to generate a character displayed on a display interface. Through the second layer color vector, the character is displayed with a color matching the second layer color vector, so as to adjust the brightness of the character on the display interface, and then adjust the contrast between the brightness of the character and the brightness of the display interface. In this way, for the brightness of different display interfaces, it is possible to keep displaying characters with a brightness that meets the user's visual comfort requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0045] Figure 1 A flowchart of a character display method provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of the process of generating the color vector of the second layer in the embodiment of the present application;
[0047] Figure 3-1 A schematic diagram showing thermometer characters provided in an embodiment of the present application;
[0048] Figure 3-2 A schematic diagram of the first character outline layer of a thermometer character provided in an embodiment of the present application;
[0049] Figure 3-3 A schematic diagram of a second character outline layer of a thermometer character provided in an embodiment of the present application;
[0050] Figure 3-4 A schematic diagram of a third character outline layer of a thermometer character provided in an embodiment of the present application;
[0051] Figure 3-5A schematic diagram of a fourth character outline layer of a thermometer character provided in an embodiment of the present application;
[0052] Figure 4 A schematic diagram of a character display device provided in an embodiment of the present application;
[0053] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0055] The embodiment of the present application provides a method, device, electronic device and storage medium for displaying characters. Below, the method for displaying characters provided by the embodiment of the present application is first introduced. The method is applied to a terminal device, and the terminal device can be any electronic device that can display characters, for example, the terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a mobile phone, etc. The method for displaying characters provided by the embodiment of the present application can be implemented by at least one of software, a hardware circuit and a logic circuit arranged in the electronic device.
[0056] like Figure 1 As shown, Figure 1 The flowchart of the character display method provided in the embodiment of the present application may include:
[0057] S110, obtaining a first layer color vector, a character outline layer and a layer identifier of a character, and obtaining a brightness threshold;
[0058] S120, generating a second layer color vector according to the brightness threshold and the first layer color vector;
[0059] S130, filling the color of the second layer color vector into each character outline layer, and according to the layer identifier corresponding to each character outline layer, sequentially superimposing the color-processed character outline layers to generate a character displayed on the display interface.
[0060] A character refers to text, glyph-like units, or symbols, including editable content such as letters, numbers, words, arithmetic symbols, punctuation marks, and functional symbols. When the user opens the terminal device and needs to display characters using the display interface of the terminal device, the terminal device accesses the font file of the current application and reads the first-layer color vector, character outline layer, and layer identifier of the character from the font file. Among them, the first-layer color vector, character outline layer, and layer identifier of the character stored in the font file can be the default setting parameters of the software. The first-layer color vector, character outline layer, and layer identifier of each character can always be represented by the same set of parameters or by multiple sets of parameters. In this way, the terminal device can determine the default display color of the character based on the first-layer color vector, character outline layer, and layer identifier in the font file. The current application refers to the software that the terminal device is currently using and accessing, and this software can be a text document, a table document, a presentation document, etc.
[0061] The first-layer color vector refers to the color system (RGB) of the character, that is, a vector composed of three components: red (R), green (G), and blue (B). For example, when the value of the red (R) component is 100, the value of the green (G) component is 120, and the value of the blue (B) component is 90, the first-layer color vector is (100, 120, 90). Another example is when the value of the red (R) component is 80, the value of the green (G) component is 100, and the value of the blue (B) component is 110, then the first-layer color vector is (80, 100, 110). The character outline layer refers to a closed-loop outline diagram composed of lines, and this outline diagram is set in the layer. Each character outline layer corresponds to a layer identifier. Correspondence means that a layer identifier is set to match each character outline layer, that is, a character outline layer and a layer identifier are in one-to-one correspondence. Specifically, the layer identifier refers to the sorting serial number of the character outline layer. According to the serial number of each character outline layer, the character outline layers are stacked in sequence. Stacking in sequence means sorting according to the size of the serial number and stacking each character outline layer corresponding to the serial number one by one in ascending or descending order. After the sequential stacking process, a complete character is generated.
[0062] It should be noted that the number of layers of the character is determined based on the structure of the character. In the case of a simple character structure, such as the character being "一", "+", etc., only one character outline layer is required to generate a complete character, and this layer identifier can be 1. In the case of a complex character structure, such as a ghost emoji, the ghost emoji has eyes, a mouth, a tongue, and a body. Therefore, four character outline layers, namely the eye outline layer, the mouth outline layer, the tongue outline layer, and the body outline layer, are required to generate a complete character, and these layer identifiers can correspond to 1, 2, 3, and 4 respectively. The color of the character can be a single color, such as all black, all red, etc.; it can also be multiple colors, that is, color.
[0063] In one example, when a character consists of only one character outline layer, the character can be a simple symbol, such as "+", "=", etc., or it can be a language character, such as "apple", "苹果", etc. In this case, the first layer color vector of the character can change with the color of the page background of the display interface of the terminal device. By default, the page background of the display interface is usually white. At this time, the color of the character formed by the first layer color vector of the above character can correspond to black. If the page background of the display interface is flipped to black, the color of the character formed by the first layer color vector of the above character can be flipped to white accordingly; if the page background of the display interface is other colors, the color of the character formed by the first layer color vector of the above character can be other corresponding colors, as long as the character can be clearly visible.
[0064] When the terminal device obtains the first layer color vector, the character outline layer and the layer identifier of the character, it also obtains a brightness threshold. The brightness threshold refers to the critical value at which the terminal device and the character change from high brightness to low brightness or from low brightness to high brightness. High brightness means that the brightness of the terminal device and the character is bright, and low brightness means that the brightness of the terminal device and the character is dim. Bright and dim refer to the subjective brightness perception when a person views the display interface of the terminal device and the character.
[0065] Generate a second layer color vector based on the brightness threshold and the first layer color vector. The second layer color vector refers to the color system (RGB) of the character, that is, a vector composed of three components: red (R), green (G), and blue (B). For example, when the value of the red (R) component is 90, the value of the green (G) component is 80, and the value of the blue (B) component is 70, the second layer color vector is (90, 80, 70). Another example is when the value of the red (R) component is 150, the value of the green (G) component is 170, and the value of the blue (B) component is 190, the second layer color vector is (150, 170, 190). The second layer color vector can mitigate the contrast intensity between the brightness of the character and the brightness of the display interface. Then, fill the color matching of the second layer color vector into each character outline layer, that is, fill the values of each component (i.e., red (R), green (G), blue (B)) of the second layer color vector into each color value column of the RGB color mode of the character outline layer to generate a character outline layer with a color that conforms to the second layer color vector. According to the layer identifier corresponding to each character outline layer, sequentially stack the character outline layers after color matching processing to generate the character displayed on the display interface.
[0066] The display brightness of the character can be controlled by each component of the second layer color vector. Exemplarily, the larger the value of each component of the second layer color vector, the higher the brightness of the generated character; the smaller the value of each component of the second layer color vector, the lower the brightness of the generated character.
[0067] In an embodiment of the present application, the second layer color vector can alleviate the contrast intensity between the brightness of the characters and the brightness of the display interface. Exemplarily, when the brightness of the display interface is high, the original brightness of the characters can be increased (enhanced) according to the second layer color vector to reduce the brightness interval between the brightness of the display interface and the brightness of the characters. When the brightness of the display interface is low, the original brightness of the characters can be decreased (reduced) according to the second layer color vector to reduce the brightness interval between the brightness of the display interface and the brightness of the characters. Avoid strong contrast between the brightness of the display interface and the brightness of the characters, which may cause visual fatigue to the user.
[0068] In the implementation of the present application, the current brightness of the display interface of the terminal device can be determined to be high or low according to the current time of the terminal device (obtained from the clock application of the terminal device). For example, the time of the clock of the terminal device can be set to be between 8:00 and 18:00 (i.e., the external environment is daytime and the light intensity is sufficient), and the current brightness of the display interface is determined to be high. The time of the clock of the terminal device can be set to be between 18:00 and 24:00 (i.e., the external environment is dark and the light intensity is insufficient), and the current brightness of the display interface is determined to be low. It is also possible to determine whether the current brightness of the display interface of the terminal device is high or low according to the user's manipulation of the brightness control of the terminal device. For example, taking the brightness control as a strip, the user controls the brightness of the terminal device by manipulating the progress line of the strip, and the progress line can slide along the length direction of the strip inside the strip. Taking the middle position of the equally divided strip as the reference, when the progress line slides beyond the middle position in the strip brightness control, the current brightness of the display interface is determined to be high; when the progress line does not slide beyond the middle position in the strip brightness control, the current brightness of the display interface is determined to be low.
[0069] In different external environments, according to user needs, users will increase or decrease the brightness of the display interface of the terminal device. Based on the brightness adjustment of the display interface, through the second layer color vector, the characters are displayed in a color matching the second layer color vector, and the contrast between the brightness of the characters and the brightness of the display interface is adjusted, so as to adjust the brightness of the displayed characters, so as to keep displaying characters with a brightness that meets the user's visual comfort requirements for different display interface brightness.
[0070] In one embodiment of the present invention, the color of the second layer color vector is filled into each character contour layer, and each character contour layer of the character can be colored according to the color of the second layer color vector of the character. In one example, the color is represented by a vector composed of three components: red (R), green (G), and blue (B), and the shape corresponding to the character contour layer is determined by a contour curve (a closed-loop contour map composed of lines, and the contour map is set in the layer). For any character contour layer, the color value of the character contour layer (i.e., a vector composed of three components: red (R), green (G), and blue (B)) can be used to fill the closed area encircled by the contour curve to generate the color layer of the layer.
[0071] As mentioned above, when a character has multiple character outline layers, the layer identifier of each character outline layer is the sorting number of each character outline layer. The color matching layers of each layer are superimposed according to the layer identifier of each character outline layer to obtain the characters displayed on the display interface, which can be displayed in the display interface as a picture. For example, the characters to be displayed in the display interface can be drawn into the font file currently applied by the terminal device. The color effect is displayed in the form of a picture, which realizes the effect of displaying characters in outline font format (such as Open Type) on different operating system platforms.
[0072] In the solution provided in the embodiment of the present application, the characters with multiple character outline layers are in the OpenType font format. Compared with ordinary characters, the characters with multiple character outline layers include rich color information. In the case where the current application of the terminal device is an electronic document including text documents, spreadsheet documents and presentation documents, if there are characters with multiple character outline layers in the electronic document, the characters to be displayed can be determined by parsing the content of the electronic document. There are many file formats for electronic documents, and the file format of the electronic document can be determined based on the file extension of the electronic document. The file extension refers to the letters after the last period in the name of the electronic document. For example, the file extension can be doc, docx, xls, xlsx, ppt, pptx, pdf, txt, jpg, gif, tif, png, etc.
[0073] In one possible implementation, see Figure 2 The above step S120 can be specifically implemented by the following steps:
[0074] S121, obtaining a first brightness value of the character based on the color value of the pixel in the character;
[0075] S122, determining a brightness adjustment value based on the first brightness value and the brightness threshold;
[0076] S123, generating a second layer color vector according to the brightness adjustment value and the first layer color vector.
[0077] The first brightness value of a character is obtained by counting and calculating the color values (ie, pixel values) of all pixels of the character when the color system of the character is the first layer color vector.
[0078] As mentioned above, the brightness threshold refers to the critical value of the terminal device or character from high brightness to low brightness or from low brightness to high brightness. In one embodiment of the present invention, the brightness threshold can also be determined according to the display mode of the display interface of the terminal device. The display mode of the above display interface is a unified display requirement for all layers in the display interface. For example, the display mode requires that the brightness value of all layers in the display interface is reduced by a preset value, the brightness value is reduced by a preset value, etc. The display mode can be divided into "day mode" and "night mode" according to the high and low brightness of the display interface. When the display mode is "day mode", it means that the brightness of the display interface is high, and the brightness threshold at this time refers to the critical value of the brightness from high brightness to low brightness; "night mode" means that the brightness of the display interface is low, and the brightness threshold at this time refers to the critical value of the brightness from low brightness to high brightness. It should be noted that the naming of the display mode is not limited here. The day mode can also be called the day mode, etc., and the night mode can also be called the dark mode or dark mode, etc.
[0079] The display mode can be set by the user. The user can set the display mode to day mode or night mode in the display interface. At this time, the display mode of the display interface can also be automatically set according to the system time of the terminal device. When the system time of the device is night time, such as 18:00-06:00, the display mode of the display interface is automatically set to night mode. When the system time of the device is day time, such as 08:00-17:00, the display mode of the display interface is automatically set to day mode. In addition, the camera or photosensitive element connected to the terminal device can also be called to obtain the surrounding brightness. When the surrounding brightness is greater than the set brightness value, the display mode of the display interface is automatically set to day mode; when the surrounding brightness is less than or equal to the set brightness value, the display mode of the display interface is automatically set to night mode.
[0080] The value of the brightness threshold can be preset. In one example, the brightness threshold can be set to half of the maximum brightness value that can be displayed in the display mode of the display interface. When the first brightness value is greater than the brightness threshold, the brightness adjustment value is determined based on the first brightness value and the brightness threshold. The brightness adjustment value of the character may include the values that need to be adjusted for each color component in each character outline layer in the character, so after obtaining the brightness adjustment value of the character, the various color components in the first layer color vector can be adjusted based on the brightness adjustment value to obtain the various color components as the second layer color vector, thereby obtaining the second layer color vector. The character can be adjusted from the first layer color vector to the second layer color vector through the brightness adjustment value, thereby adjusting the brightness of the character.
[0081] In a possible implementation manner, the above step S121 may be specifically implemented by the following steps:
[0082] Step 1: Get the pixel value of each pixel of the character, calculate the average value of the pixel value of each pixel channel, and use the average value as the color value of the pixel;
[0083] Step 2: Perform weighted sum calculation on the average values of the pixel values of each pixel channel to obtain the brightness value of the character.
[0084] A pixel channel refers to a pixel color layer composed of a set of brightness values of primary colors. For an image in RGB mode, there are four pixel channels, namely, a composite pixel channel (RGB channel), a red (R) pixel channel, a green (G) pixel channel, and a blue (B) pixel channel. The pixel value of each of the above pixels may include the pixel values of multiple pixel channels in the pixel. In an example, taking an image in RGB format as an example of a character image to be displayed, the pixel value of a color pixel may be composed of the pixel values of the three pixel channels of red (R), green (G), and blue (B).
[0085] When the character has only one color (pure color), the average value of the pixel value of each pixel channel in the character to be displayed is calculated, that is, the pixel values of the red (R), green (G), and blue (B) pixel channels of the character to be displayed can be averaged respectively, and the pixel values of these three pixel channels in the character to be displayed can be summed respectively to obtain the sum of the pixel values of each of the three pixel channels, and then the sum of the pixel values of these three pixel channels can be divided by the number of valid pixels in the character to be displayed, so as to obtain the average value of the pixel values of each of the three pixel channels in the character to be displayed.
[0086] In the case where the character contains multiple colors (colors), the average value of the pixel value of each pixel channel in the character to be displayed is calculated, which means that the pixel values of the three pixel channels of red (R), green (G), and blue (B) of each color system are averaged respectively. The pixel values of these three pixel channels in the character image to be displayed can be summed respectively to obtain the sum of the pixel values of each of the three pixel channels, and then the sum of the pixel values of these three pixel channels is divided by the number of valid pixels in the character to be displayed, so as to obtain the average value of the pixel values of each of the three pixel channels in the character to be displayed. The average value (i.e., color value) is calculated for each color system until the average values of all color systems are calculated. Among them, the color system refers to the series to which the color belongs. In this application, the same color system can be determined based on the division of cold and warm color systems, or can be determined based on the division of the same color system, and the present invention does not limit this.
[0087] After obtaining the average value of the pixel values of each pixel channel in the character to be displayed, the average value of the pixel values of each pixel channel can be calculated by weighted summation to obtain the first brightness value of the character to be displayed. The weighting coefficient of the pixel value of each pixel channel can be determined according to actual needs. For example, the pixel value of a color pixel can be composed of the pixel values of the three pixel channels of red (R), green (G), and blue (B). The average values of the pixel values of these three pixel channels are respectively Afterwards, it is calculated as follows:
[0088]
[0089] Wherein, L is the first brightness value, a, b, and c are weighted coefficients of the pixel values of the three pixel channels of red (R), green (G), and blue (B), respectively. a, b, and c can be customized according to actual conditions. In an example, a can be set to 7, b can be set to 9, and c can be set to 1.2.
[0090] In a possible implementation manner, the above step S122 may be implemented by the following steps:
[0091] Step 1, calculating the difference between the first brightness value and the brightness threshold;
[0092] Step 2: perform logarithmic calculation on the difference;
[0093] Step three: using the logarithmic calculation result as the brightness adjustment value.
[0094] As mentioned above, the brightness threshold may be pre-set. In one example, it may be half of the maximum brightness value that the display interface can display. For example, if the maximum brightness value of the display interface of the terminal device is 2400 candelas per square meter, the brightness threshold is 1200 candelas per square meter.
[0095] The brightness adjustment value obtained by calculating the difference between the first brightness value and the brightness threshold and then calculating the logarithm of the difference can be calculated according to the following formula:
[0096] t=log2(LT)
[0097] Where t is the brightness adjustment value, and T is the brightness threshold. In one example, the brightness threshold can be set to half of the maximum brightness value that can be displayed in the display mode of the display interface. The use of logarithmic calculation method can make the brightness adjustment value smaller, that is, the first layer color vector and the second layer color vector of the character will not differ much. In this way, the character can be displayed in a color matching with the second layer color vector, and the contrast between the brightness of the character and the brightness of the display interface can be adjusted. It can also ensure that the brightness change of the character after adjustment is relatively gentle, and the user will not experience eye discomfort due to the strong sudden change in the brightness of the character.
[0098] In an example, after obtaining the brightness adjustment value, when the brightness of the display interface is brighter (the brightness value of the display interface is higher than the brightness threshold), or the display mode of the display interface is day mode, the pixel value of each pixel of the character can be added to the brightness adjustment value to obtain the second layer color vector of the character; when the brightness of the display interface is darker (the brightness value of the display interface is lower than the brightness threshold), or the display mode of the display interface is night mode, the pixel value of each pixel of the character can be subtracted from the brightness adjustment value to obtain the second layer color vector of the character.
[0099] In a possible implementation manner, before performing logarithmic calculation on the difference in the above steps, the following steps are further included:
[0100] Step 1, determining whether the difference is greater than a first natural number;
[0101] Step 2: When the difference is greater than the first natural number, a logarithmic calculation step is performed.
[0102] The first natural number may be 1, 2, etc. When the difference is smaller than the first natural number, the logarithmic calculation step may not be performed, and the brightness adjustment value may be directly set to the second natural number, which may be 0.
[0103] In the embodiment of the present invention, the step of comparing the difference between the first brightness value and the brightness threshold with the first natural number is performed, so that the logarithmic calculation meets the calculation requirement, that is, the independent variable needs to be a positive number.
[0104] In an embodiment of the present invention, when the brightness adjustment value is determined, the pixel values of each pixel of the character are traversed, the difference between the pixel value of each pixel and the brightness adjustment value is calculated, and the color matching of the difference between each pixel is used as the fill color of the character outline layer. Exemplarily, taking the brightness adjustment value as 8 and the pixel value of a pixel as (110, 90, 120), the difference between the pixel value and the brightness adjustment value is equal to (110, 90, 120)-(8, 8, 8), that is, the fill color of the character outline layer of the pixel is the color matching corresponding to (102, 82, 112).
[0105] In an example, if the brightness adjustment value obtained after logarithmic calculation is a negative number, it can indicate an increase in brightness. For example, the brightness adjustment value is -8 and the pixel value of a pixel is (110, 90, 120). The difference between the pixel value and the brightness adjustment value is equal to (110, 90, 120) + (8, 8, 8), that is, the fill color of the character outline layer of the pixel is the color corresponding to (118, 98, 128).
[0106] In an implementation of the present invention, before step S121, the character display method provided by the present invention further includes:
[0107] Obtain a second brightness value of the display interface;
[0108] When the second brightness value is less than the brightness threshold, the step of acquiring the first brightness value of the character is performed.
[0109] The second brightness value of the display interface is the current brightness of the display interface, which can be obtained by counting the pixel values of each pixel in the display interface. In one example, the pixel values of the three pixel channels of red (R), green (G), and blue (B) in the display interface can be summed respectively to obtain the sum of the pixel values of each of the three pixel channels, and then the sum of the pixel values of the three pixel channels is divided by the number of pixels in the display interface, respectively, to obtain the average value of the pixel values of each of the three pixel channels in the display interface. After obtaining the average value of the pixel values of each pixel channel in the display interface, the average value of the pixel values of each pixel channel can be calculated by weighted summation to obtain the second brightness value of the display interface. The specific calculation method of the weighted summation can refer to the weighted summation method when obtaining the first brightness value in the above embodiment, which will not be repeated here.
[0110] After obtaining the second brightness value of the display interface, the second brightness value can be compared with the brightness threshold. When the second brightness value is less than the brightness threshold, it means that the brightness value of the display interface is low and the brightness is darker, or it can indicate that the display mode of the display interface is night mode at this time, and the above step of obtaining the first brightness value of the character is performed at this time; when the second brightness value is greater than the brightness threshold, it means that the brightness value of the display interface is high and the brightness is brighter, or it can indicate that the display mode of the display interface is day mode at this time, and the brightness adjustment value can be set according to a pre-set adjustment ratio, for example, the brightness adjustment value is 10% of the second brightness value of the display interface.
[0111] In a possible implementation manner, the above step S123 can be specifically implemented by the following steps:
[0112] Step 1, calculating the difference between the color vector of the first layer and the brightness adjustment value;
[0113] Step 2: Use the difference as the color vector of the second layer.
[0114] In one possible implementation, when the brightness adjustment value is determined, the difference between the first layer color vector and the brightness adjustment value is calculated, the pixel values of each pixel in the character can be traversed, and the difference between the pixel value of each pixel and the brightness adjustment value can be calculated. The color of the difference in the pixel value of each pixel is the color of each character outline layer in the second layer color vector, and then the color of each character outline layer in the second layer color vector is used as the fill color of the character outline layer to fill the character outline layer.
[0115] In an example, when the result of subtracting the brightness adjustment value from the pixel value of the pixel channel of the pixel is less than 0, since the pixel value of the pixel channel of the pixel cannot be a negative number, the pixel value of the pixel channel of the pixel can be set to 0. For example, if the brightness adjustment value is 10, and the pixel values of the three pixel channels of a certain pixel are (100, 120, 8), the value can be (90, 110, 0) after subtracting the brightness adjustment value.
[0116] In a possible implementation, the step S123 generates the second layer color vector according to the brightness adjustment value and the first layer color vector, and further includes:
[0117] When the first brightness value is less than the brightness threshold, the brightness adjustment value is set to a second natural number.
[0118] The second natural number can be 0, and the difference between the first layer color vector and the brightness adjustment value is calculated to obtain the second layer color vector, and the color matching of the second layer color vector is used to fill the character outline layer. It can be understood that when the first brightness value is less than the brightness threshold, the first layer color vector and the second layer color vector can be set to be consistent.
[0119] In one embodiment of the present invention, the character data of the first layer color vector, the character outline layer, the layer identifier and the second layer color vector are stored in a font file, the font file is set in an electronic document, and the characters are displayed according to the character data.
[0120] As mentioned above, when the current application of the terminal device is an electronic document including a text document, a table document and a presentation document, if there are characters with multiple character outline layers in the electronic document, the characters to be displayed can be determined by parsing the content of the electronic document. Electronic documents can generally embed font files, and the font files contain font information of each character, for example, the number of character outline layers of the character, the layer identification of each character outline layer, the first layer color vector, the contour curve data that determines the corresponding shape of each character outline layer, etc. In the case where there is no font file embedded in the electronic document, the system platform used by the terminal device should be installed with the font file. That is, in the scheme provided by the embodiment of the present application, the font file is embedded in the electronic document and / or the system platform used by the terminal device is installed with the font file. The character data of the embedded font file is read from the electronic document to the internal storage of the electronic document, or the character data of the font file is read from the storage path to the internal storage according to the font file installed by the system platform used by the terminal device.
[0121] In a possible embodiment, when the font file of the character to be displayed has been embedded in the electronic document, the layer identifier of each character contour layer of the character, the contour curve of the corresponding shape of each character contour layer of the character, and the first layer color vector of the character are obtained from the font file embedded in the electronic document.
[0122] In a possible embodiment, when the font file of the above-mentioned characters to be displayed is not embedded in the electronic document, the layer identifiers of each character contour layer of the above-mentioned characters, the contour curves of the corresponding shapes of each character contour layer of the above-mentioned characters, and the first layer color vector of the above-mentioned characters are obtained from the font files installed in the system platform of the terminal device application.
[0123] After obtaining the electronic document, first check whether the font file of the character to be displayed has been embedded in the electronic document. If it has been embedded in the electronic document, obtain the layer identifier of each character contour layer of the character, the contour curve of the corresponding shape of each character contour layer of the character, and the first layer color vector of the character from the font file embedded in the electronic document.
[0124] The layer color vector stored in the above font file may include a first layer color vector of a character. In one example, the layer color vector stored in the font file may also include a second layer color vector of a character, and the storage location of the second layer color vector is different from the storage location of the first layer color vector. In one example, the second layer color vector of the font may be directly read from the font file to save computing resources.
[0125] If it is not embedded in the electronic document, the font file is read from the storage path according to the font file installed in the system platform used by the terminal device, and the layer identifier of each character contour layer of the character, the contour curve of the corresponding shape of each character contour layer of the character, and the first layer color vector of the character are obtained from the font file installed in the system platform used by the terminal device.
[0126] Generally speaking, there are multiple characters, and the font file will include character data of multiple characters. The characters have corresponding character encoding values. The font file stores the corresponding relationship between the character encoding value of each character and the character data of the character. After the character to be displayed is determined, the character data of the character to be displayed can be read from the font file according to the character encoding value of the character to be displayed. The character data of the character includes multiple character contour layers. Further character data also includes the layer identifier of each character contour layer, the second layer color vector, and the contour curve corresponding to each character contour layer. For example, the character is a thermometer icon with a character encoding of 1F321, such as Figure 3-1 As shown, Figure 3-1 The thermometer character display schematic diagram provided in the embodiment of the present application, the character is superimposed by multiple character outline layers, including 4 character outline layers, layer 1, layer 2, layer 3, layer 4, and the schematic diagrams of each character outline layer are shown in FIG. Figure 3-2 , Figure 3-3 , Figure 3-4 , Figure 3-5 . Figure 3-2 A schematic diagram of the first character outline layer of a thermometer character provided in an embodiment of the present application; Figure 3-3 A schematic diagram of a second character outline layer of a thermometer character provided in an embodiment of the present application; Figure 3-4 A schematic diagram of a third character outline layer of a thermometer character provided in an embodiment of the present application; Figure 3-5 A schematic diagram of the fourth character outline layer of the thermometer character provided in an embodiment of the present application.
[0127] Each character outline layer corresponds to a contour curve, which is a closed curve. The second layer color vector includes the corresponding color values of each character outline layer. In graphics, the alpha channel (Alpha value) refers to the transparency of an image. A true color pixel consists of four components, red (R), green (G), blue (B), and Alpha value (A). (R, G, B, A) is usually called a quadruple. A quadruple represents the color composed of R*A, G*A, and B*A after multiplying the three components R, G, and B by A respectively. For example, a bitmap that uses 16 bits per pixel for storage may use 5 bits to represent red, 5 bits to represent green, 5 bits to represent blue, and the last bit is the Alpha value for each pixel in the graphic. The color value of each character outline layer also includes the Alpha value, red value, green value, and blue value accordingly. In practical applications, after obtaining the font file, the font file can be sent to the font engine (FreeType2) through a preset interface, and the font file can be parsed by FreeType2 to obtain the color value of each character outline layer and the outline curve corresponding to each character outline layer.
[0128] After obtaining the contour curve and the color value, the closed area encircled by the contour curve can be filled with the corresponding color according to the layer identifier of each character contour layer of the character. Specifically, the algorithm for filling the closed area encircled by the contour curve with the corresponding color can be implemented using the application development framework (QT). In this way, the processed character image is obtained, and finally the processed character image is drawn into the cache of the display interface to display the above character effect.
[0129] In a possible embodiment, the font file includes a COLOR color comparison table (COLR table), a color matching index table (CPAL table) and a contour curve table (GLYF table); the COLR table stores the contour curve number of the corresponding shape of each character contour layer of the above-mentioned characters, the layer identifier of each character contour layer, and the color matching index of each character contour layer; the CPAL table stores the color matching value of each character contour layer of the above-mentioned characters, wherein the color matching index and the color matching value have an associated relationship; the GLYF table stores the contour curve of the corresponding shape of each character contour layer of the above-mentioned characters, wherein the contour curve number and the contour curve have an associated relationship.
[0130] In an example, each character corresponds to a unique character encoding value. For any character, the character encoding value of the character and the contour curve number and color index of the corresponding shape of each character contour layer of the character are associated and stored in the COLR table; in an example, the COLR table can be shown in Table 1.
[0131] Table 1
[0132]
[0133] In one example, the layer identifier of each character contour layer of a character is the same as the arrangement order of the contour curve number corresponding to the character in the COLR table in the table. Of course, additional items can also be added to record the layer identifier of each character contour layer of a character, all within the scope of protection of this application.
[0134] The color values of each layer of the character are stored in the CPAL table; the color index and color value corresponding to the character have a corresponding relationship, that is, for any color index in the COLR table, the color value corresponding to the color index can be found in the CPAL table. In an example, the CPAL table can be shown in Table 2.
[0135] Table 2
[0136]
[0137]
[0138] In one example, the contour curve numbers of each character contour layer of the character are associated and stored in the GLYF table with the contour curves of the corresponding shapes. The contour curve numbers corresponding to the characters have a corresponding relationship with the contour curves, that is, for any contour curve number in the COLR table, the contour curve corresponding to the contour curve number can be found in the GLYF table. In one example, the CPAL table can be shown in Table 3, and in another example, the CPAL table can be shown in Table 4.
[0139] Table 3
[0140]
[0141] Table 4
[0142]
[0143]
[0144] Generally speaking, font files in the OpenType format store data in the form of tables, in which the GLYF table stores the contour curves of each character contour layer of the character. Generally speaking, the contour curves of the characters are described by Bezier curves. In order to save the character data of the characters, the COLR table and the CPAL table are added to the font file respectively, and the data of the GLYF table is expanded, in which the COLR table stores the contour curve numbers and color indexes of each character contour layer corresponding to the character, and the CPAL table stores the color values corresponding to the color index. Among them, the COLR table, the CPAL table and the GLYF table can all store the character data of the corresponding characters according to the character encoding value, so that the corresponding data can be obtained from each table according to the character encoding value.
[0145] In a possible embodiment, the color matching values of each character contour layer of the character may be obtained from the CPAL table according to the color matching index of each character contour layer of the character and the corresponding relationship between the color matching index and the color matching value corresponding to the above character.
[0146] After determining the characters to be displayed in the display interface, first obtain the contour curve numbers of the corresponding shapes of each character contour layer of the character and the color index of each character contour layer of the character from the COLR table according to the character encoding value of the character to be displayed, then obtain the contour curves of the corresponding shapes of each character contour layer of the character from the GLYF table according to the contour curve numbers of the corresponding shapes of each character contour layer of the character and the correspondence between the contour curve numbers corresponding to the character and the contour curves, and finally obtain the color values of each character contour layer of the character from the CPAL table according to the color index of each character contour layer of the character and the correspondence between the color index corresponding to the character and the color value.
[0147] In a possible embodiment, the font file also includes the superposition offset of each character outline layer corresponding to the character; generally speaking, the font file also includes the superposition offset of each character outline layer corresponding to the character, so that after obtaining the color matching layer, the color matching layers can be superimposed in sequence according to the superposition offset of each character outline layer according to the order of the layer identifiers of each character outline layer of the character, so as to obtain the processed character image to be displayed. After obtaining the processed character image to be displayed, the processed character image to be displayed can be drawn into the electronic document background cache in accordance with the display method of general pictures in the electronic document, so as to achieve the character effect of the OpenType font format.
[0148] The present application embodiment provides a character display device, see Figure 4 , Figure 4 A schematic diagram of a character display device according to an embodiment of the present application includes:
[0149] An acquisition module 11 is used to acquire a first layer color vector, a character outline layer and a layer identifier of a character, and to acquire a brightness threshold;
[0150] A determination module 12, configured to generate a second layer color vector according to a brightness threshold and a first layer color vector;
[0151] The character generation module 13 is used to fill the color of the second layer color vector into each character outline layer, and according to the layer identifier corresponding to each character outline layer, sequentially superimpose the character outline layers after each color matching process to generate the characters displayed on the display interface.
[0152] In a possible implementation, the determining module 12 includes:
[0153] a brightness value determination submodule, for determining a first brightness value of a character based on pixel values of pixels in the character;
[0154] a brightness adjustment value determination submodule, configured to determine a brightness adjustment value based on the first brightness value and a brightness threshold;
[0155] The color vector generation submodule generates a second layer color vector according to the brightness adjustment value and the first layer color vector.
[0156] In a possible implementation, the brightness value determination submodule is specifically used to obtain the pixel value of each pixel of the character, calculate the average value of the pixel value of each pixel channel respectively, and use the average value as the color value of the pixel;
[0157] The average values of the pixel values of each pixel channel are weighted and summed to obtain the first brightness value of the character.
[0158] In a possible implementation manner, the brightness adjustment value determination submodule is specifically configured to calculate a difference between the first brightness value and a brightness threshold;
[0159] Take the logarithm of the difference;
[0160] The logarithmic calculation result is used as the brightness adjustment value.
[0161] In a possible implementation manner, the brightness adjustment value determination submodule is further configured to determine whether the difference is greater than a first natural number;
[0162] In the case where the difference is greater than the first natural number, a logarithmic calculation step is performed.
[0163] In a possible implementation manner, the above device further includes:
[0164] The difference calculation module is used to traverse the pixel values of each pixel of the character under the condition of determining the brightness adjustment value, calculate the difference between the pixel value of each pixel and the brightness adjustment value, and use the color matching of the difference of each pixel as the filling color of the character outline layer.
[0165] In a possible implementation manner, the above device further includes:
[0166] A brightness value acquisition module, used to acquire a second brightness value of the display interface;
[0167] The brightness value judgment module is used to execute the step of obtaining the first brightness value of the character when the second brightness value is less than the brightness threshold.
[0168] In a possible implementation, the color vector generation submodule is specifically used to:
[0169] Calculate the difference between the color vector of the first layer and the brightness adjustment value;
[0170] Use the difference as the second layer color vector.
[0171] In a possible implementation manner, the color vector generation submodule is further configured to:
[0172] When the first brightness value is less than the brightness threshold, the brightness adjustment value is set to a second natural number.
[0173] In a possible implementation manner, the above device further includes:
[0174] The character storage module is used to store the character data of the first layer color vector, the character outline layer, the layer mark and the second layer color vector in a font file, the font file is set in the electronic document, and the character is displayed according to the character data.
[0175] The present application also provides an electronic device, see Figure 5 , Figure 5 This is a structural diagram of an electronic device according to an embodiment of the present application, comprising: a processor 21, a communication interface 22, a memory 23 and a communication bus 24, wherein the processor 21, the communication interface 22, and the memory 23 communicate with each other via the communication bus 24.
[0176] The memory 23 is used to store computer programs;
[0177] The processor 21 is used to implement the steps of the character display method provided by the present invention when executing the computer program stored in the memory 23.
[0178] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0179] The communication interface is used for communication between the above electronic device and other devices.
[0180] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0181] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0182] In an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned character display methods are implemented.
[0183] In an embodiment of the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any character display method in the above embodiments.
[0184] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above-mentioned computer program product includes one or more computer instructions. When the above-mentioned computer program instructions are loaded and executed on a computer, the above-mentioned process or function according to the embodiment of the present application is generated in whole or in part. The above-mentioned computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices. The above-mentioned computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the above-mentioned computer instructions can be transmitted from a website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The above-mentioned computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server, a data center, etc. that contains one or more available media integration. The available media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media (eg, solid state disks (SSDs)).
[0185] It should be noted that, in this article, the technical features in each optional solution can be combined to form a solution as long as there is no contradiction, and these solutions are all within the scope disclosed in this application. Relational terms such as first and second, etc. are only used to distinguish an entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of more restrictions, the elements limited by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or equipment including the above-mentioned elements.
[0186] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments of the device, electronic device, computer-readable storage medium, and computer program product containing instructions, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0187] The above are only preferred embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application are included in the protection scope of the present application.
Claims
1. A character display method, characterized in that: include: Obtaining a first layer color vector, a character outline layer and a layer identifier of a character, and obtaining a brightness threshold; wherein the character outline layer refers to a closed-loop outline map composed of lines, and the outline map is set in a layer; Generate a second layer color vector according to the brightness threshold and the first layer color vector; The color of the second layer color vector is filled into each character outline layer, and according to the layer identifier corresponding to each character outline layer, the character outline layers after the color matching processing are sequentially superimposed to generate the characters displayed on the display interface.
2. The method according to claim 1, characterized in that The step of generating the second layer color vector according to the brightness threshold and the first layer color vector comprises: Determining a first brightness value of the character based on color values of pixels in the character; Determining a brightness adjustment value based on the first brightness value and a brightness threshold; The second layer color vector is generated according to the brightness adjustment value and the first layer color vector.
3. The method according to claim 2, characterized in that The step of determining a first brightness value of the character based on a color value of a pixel in the character comprises: Obtaining the pixel value of each pixel of the character, respectively calculating the average value of the pixel value of each pixel channel, and using the average value as the color value of the pixel; The average values of the pixel values of each pixel channel are weighted and summed to obtain the first brightness value of the character.
4. The method according to claim 3, characterized in that The step of determining a brightness adjustment value based on the first brightness value and a brightness threshold value includes: Calculating a difference between the first brightness value and the brightness threshold; Performing logarithmic calculation on the difference; The logarithmic calculation result is used as the brightness adjustment value.
5. The method according to claim 4, characterized in that Before performing logarithmic calculation on the difference, the method further includes: Determine whether the difference is greater than a first natural number; In the case where the difference is greater than the first natural number, a logarithm calculation step is performed.
6. The method according to claim 5, characterized in that The method further comprises: When the brightness adjustment value is determined, the pixel values of each pixel of the character are traversed, the difference between the pixel value of each pixel and the brightness adjustment value is calculated, and the color matching of the difference of each pixel is used as the filling color of the character outline layer.
7. The method according to claim 2, characterized in that Before determining the first brightness value of the character based on the color value of the pixel in the character, the method further includes: Obtain a second brightness value of the display interface; When the second brightness value is less than the brightness threshold, the step of acquiring the first brightness value of the character is performed.
8. The method according to claim 2, characterized in that: The step of generating the second layer color vector according to the brightness adjustment value and the first layer color vector comprises: Calculating the difference between the first layer color vector and the brightness adjustment value; The difference is used as the second layer color vector.
9. The method according to claim 2, characterized in that: The step of generating the second layer color vector according to the brightness adjustment value and the first layer color vector further includes: When the first brightness value is less than the brightness threshold, the brightness adjustment value is set to a second natural number.
10. The method according to claim 1, characterized in that The method further comprises: The character data of the first layer color vector, the character outline layer, the layer identifier and the second layer color vector are stored in a font file, the font file is set in an electronic document, and the character is displayed according to the character data.
11. A character display device, characterized in that: include: An acquisition module, used to acquire a first layer color vector, a character outline layer and a layer identifier of a character, and to acquire a brightness threshold; wherein the character outline layer refers to a closed-loop outline map composed of lines, and the outline map is set in a layer; A determination module, configured to generate a second layer color vector according to the brightness threshold and the first layer color vector; The character generation module is used to fill the color of the second layer color vector into each character outline layer, and according to the layer identifier corresponding to each character outline layer, sequentially superimpose the character outline layers after each color matching process to generate the characters displayed on the display interface.
12. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the character display method described in any one of claims 1-10 when executing the computer program stored in the memory.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the character display method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Picture processing method and device, and picture drawing method and device
CN106055295A
Method and device for adjusting display color of application software and vehicle-mounted equipment
CN111367600A