CN113869002A - Character display method and device, electronic equipment and storage medium - Google Patents

Character display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113869002A
CN113869002A CN202111113007.0A CN202111113007A CN113869002A CN 113869002 A CN113869002 A CN 113869002A CN 202111113007 A CN202111113007 A CN 202111113007A CN 113869002 A CN113869002 A CN 113869002A
Authority
CN
China
Prior art keywords
character
layer
value
brightness
color vector
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111113007.0A
Other languages
Chinese (zh)
Inventor
苏永新
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Original Assignee
Beijing Kingsoft Office Software Inc
Zhuhai Kingsoft Office Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Office Software Inc, Zhuhai Kingsoft Office Software Co Ltd filed Critical Beijing Kingsoft Office Software Inc
Priority to CN202111113007.0A priority Critical patent/CN113869002A/en
Publication of CN113869002A publication Critical patent/CN113869002A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The embodiment of the application provides a character display method, a character display device, electronic equipment and a storage medium, and relates to the technical field of data processing, wherein a first layer color vector, a character outline layer and a layer identifier of a character are obtained, and a brightness threshold value is obtained; generating a second layer color vector according to the brightness threshold and the first layer color vector; and filling the color matching of the second layer color vector to each character contour layer, and sequentially overlapping the character contour layers after the color matching processing according to the layer identification corresponding to each character contour layer to generate characters displayed on a display interface. And displaying the characters in a matching color matched with the second layer color vector through the second layer color vector, so that the brightness of the characters of the display interface is adjusted and set, and the contrast strength between the brightness of the characters and the brightness of the display interface is adjusted.

Description

Character display method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a character display method and apparatus, an electronic device, and a storage medium.
Background
The user views character contents in the electronic document by using the terminal device. In the related art, characters displayed on a display interface of a terminal device are usually displayed in black, white, or other colors set by a user. Since the display color of the character is set by default through software (such as a text document, a table document, a presentation document, and the like), or personalized setting based on the preference of the user for the color of the character, and the character is always displayed in the color based on the setting. The external environment in which the user uses the terminal device is variable, for example, the user may view the electronic document through the terminal device in the external environment such as outdoors at daytime, outdoors at night, indoors with light, and the like.
Generally, in order to adjust the brightness deviation between the display interface of the terminal device and the external environment, a user may turn up or dim the display interface of the terminal device, while the display color of the characters viewed by the user is maintained as the set color, and the user may view the characters on the display interface with the changed brightness, and may feel that the color of the characters is too bright or too dark, which may cause discomfort to eyes of the user. The use requirement of the visual comfort level of the user for checking the characters through the terminal equipment in different external environments cannot be met.
Disclosure of Invention
An object of the embodiments of the present application is to provide a character display method, an apparatus, an electronic device, and a storage medium, which are used for displaying characters meeting the requirement of user visual comfort in different external environments by adjusting the display brightness of the characters on a display interface.
In a first aspect of an embodiment of the present application, an embodiment of the present application provides a character display method, including:
acquiring a first layer color vector, a character outline layer and a layer identifier of a character, and acquiring a brightness threshold;
generating a second layer color vector according to the brightness threshold and the first layer color vector;
and filling the color matching of the second layer color vector to each character contour layer, and sequentially overlapping the character contour layers after the color matching processing according to the layer identification corresponding to each character contour layer to generate characters displayed on a display interface.
Preferably, the generating a second layer color vector according to the brightness threshold and the first layer color vector includes:
determining a first luminance 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 value;
and generating the second layer color vector according to the brightness adjustment value and the first layer color vector.
Preferably, the determining a first luminance value of the character based on color values of pixels in the character includes:
acquiring pixel values of pixels of the characters, respectively calculating an average value of the pixel values of each pixel channel, and taking the average value as the color value of the pixel;
and carrying out weighted summation calculation on the average value of the pixel values of each pixel channel to obtain a first brightness value of the character.
Preferably, the determining a brightness adjustment value based on the first brightness value and a brightness threshold value includes:
calculating a difference between the first luminance value and the luminance threshold value;
carrying out logarithmic calculation on the difference value;
and taking the logarithm calculation result as the brightness adjustment value.
Preferably, before the logarithmic calculation of the difference, the method further comprises:
judging whether the difference value is larger than a first natural number or not;
in case the difference is larger than the first natural number, a logarithmic calculation step is performed.
Preferably, the method further comprises:
and under the condition of determining the brightness adjustment value, traversing the pixel value of each pixel of the character, calculating the difference value between the pixel value of each pixel and the brightness adjustment value, and taking the color matching of the difference value of each pixel as the filling color of the character outline layer.
Preferably, before determining the first luminance value of the character based on the color value of the pixel in the character, the method further comprises:
acquiring a second brightness value of the display interface;
and executing the step of acquiring the first brightness value of the character under the condition that the second brightness value is smaller than the brightness threshold value.
Preferably, the generating the second layer color vector according to the brightness adjustment value and the first layer color vector includes:
calculating a difference value between the first layer color vector and the brightness adjustment value;
and taking the difference value as the second layer color vector.
Preferably, the generating the second layer color vector according to the brightness adjustment value and the first layer color vector further includes:
setting the brightness adjustment value to a second natural number in a case where the first brightness value is smaller than the brightness threshold.
Preferably, the method further comprises:
and storing character data of the first layer color vector, the character outline layer, the layer identifier and the second layer color vector in a font file, wherein the font file is arranged in the electronic document, and the characters are displayed according to the character data.
In a second aspect of embodiments of the present application, embodiments of the present application provide a character display apparatus, including:
the acquisition module is used for acquiring a first layer color vector, a character outline layer and a layer identifier of a character and acquiring a brightness threshold;
the determining module is used for generating a second layer color vector according to the brightness threshold and the first layer color vector;
and the character generation module is used for filling the color matching of the second layer color vector to each character outline layer, and sequentially overlapping each character outline layer after color matching processing according to the layer identifier corresponding to each character outline layer to generate characters displayed on a display interface.
In a third aspect of the embodiments of the present application, an electronic device is provided in an embodiment of the present application, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the character display method according to any one of the first aspect described above when executing the computer program stored in the memory.
In a fourth aspect of embodiments of the present application, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the character display method according to any one of the first aspect.
According to the character display method, the character display device, the electronic equipment and the storage medium, a first layer color vector, a character outline layer and a layer identifier of a character are obtained, and a brightness threshold value is obtained; generating a second layer color vector according to the brightness threshold and the first layer color vector; and filling the color matching of the second layer color vector to each character contour layer, and sequentially overlapping the character contour layers after the color matching processing according to the layer identification corresponding to each character contour layer to generate characters displayed on a display interface. And displaying the characters in a matching color matched with the second layer color vector through the second layer color vector, so that the brightness of the characters of the display interface is adjusted and set, and the contrast strength between the brightness of the characters and the brightness of the display interface is adjusted. Therefore, the characters with the brightness meeting the visual comfort requirement of the user can be kept and displayed according to the brightness of different display interfaces.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a character display method according to an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating a process of generating a color vector of a second layer according to an embodiment of the present application;
FIG. 3-1 is a schematic view of a thermometer character display provided in an embodiment of the present application;
FIG. 3-2 is a schematic view of a first character outline layer of thermometer characters according to an embodiment of the present disclosure;
FIGS. 3-3 are schematic diagrams of second profile layers of thermometer characters according to embodiments of the present disclosure;
FIGS. 3-4 are schematic diagrams of a third profile layer of thermometer characters according to an embodiment of the present disclosure;
FIGS. 3-5 are schematic diagrams of a fourth profile layer of thermometer characters according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a character display apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a character display method and device, electronic equipment and a storage medium. Next, a description will be first given of a character display method provided in the embodiment of the present application. The method is applied to the terminal equipment, and the terminal equipment can be any electronic equipment capable of displaying characters, for example, the terminal equipment can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a mobile phone and the like. The character display method provided by the embodiment of the application can be realized by at least one of software, hardware circuit and logic circuit arranged in the electronic equipment.
As shown in fig. 1, fig. 1 is a schematic flow chart of a character display method provided in an embodiment of the present application, and may include:
s110, acquiring a first layer color vector, a character outline layer and a layer identifier of a character, and acquiring a brightness threshold;
s120, generating a second layer color vector according to the brightness threshold and the first layer color vector;
and S130, filling the color matching of the color vector of the second layer into each character outline layer, and sequentially superposing the character outline layers subjected to the color matching processing according to the layer identification corresponding to each character outline layer to generate characters displayed on a display interface.
Characters refer to text, font-like units or symbols, including editable content such as letters, numbers, words, operation symbols, punctuation marks, functional symbols, and the like. When a user opens the terminal equipment and needs to display characters by using a display interface of the terminal equipment, the terminal equipment accesses a font file applied currently, and reads a first layer color vector, a character outline layer and a layer identifier of the characters from the font file. The first layer color vector, the character outline layer and the layer identifier of the character stored in the font file may be default setting parameters of software. The first layer color vector, the character outline layer and the layer identifier of each character can be always represented by the same parameter or by multiple parameters. Therefore, the terminal equipment can determine the default display color of the character according to the first layer color vector, the character outline layer and the layer identifier in the font file. The current application refers to software which is being used and accessed by the terminal device, and the software can be a text document, a table document, a presentation document and the like.
The first layer color vector refers to the color system (RGB) of the character, i.e., a vector composed of three components, red (R), green (G), and blue (B). For example, if 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). For another example, if 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, the first-layer color vector is (80, 100, 110). The character outline layer refers to an outline of a closed loop formed by lines, and the outline is arranged in the layer. Each character outline layer corresponds to one layer identifier, and the corresponding layer identifier is arranged in a manner of being matched with each character outline layer, namely, one character outline layer corresponds to one layer identifier. Specifically, the layer identifier refers to a sequence number of the character outline layer, the character outline layers are sequentially overlapped according to the sequence number of each character outline layer, the sequential overlapping refers to sequencing according to the size of the sequence number, the character outline layers corresponding to the sequence numbers are sequentially overlapped in an ascending order or a descending order, and complete characters are generated after sequential overlapping.
It should be noted that the number of layers of a character is determined based on the structure of the character, and in the case of a simple structure of the character, for example, the character is "one", "plus", or the like, only one character outline layer is needed to generate a complete character, and the layer identifier may be 1. Under the condition that the structure of the character is complex, for example, the character is a ghost expression, the ghost expression has eyes, a mouth, a tongue and a body, so that the four character contour layers, namely an eye contour layer, a mouth contour layer, a tongue contour layer and a body contour layer, are required to generate a complete character, and the layer identifiers can be respectively corresponding to 1, 2, 3 and 4. The color of the characters may be a single color, e.g., all black, all red, etc.; but also in a plurality of colors, i.e. chromatic colors.
In one example, in the case that the character is composed of only one character outline layer, the character may be a simple symbol, such as "+,", etc., and may be a language text, such as "apple, applet", etc., and the color vector of the first layer of the character at this time may vary according to the color of the page background of the display interface of the terminal device. The page background of the display interface is normally white by default, and the color of the character formed by the first layer color vector of the character may be corresponding to black. If the page background of the display interface is turned to be black, the color of the character formed by the first layer color vector of the character can be correspondingly turned to be white; if the page background of the display interface is other colors, the color of the character formed by the color vector of the first layer of the character may be other corresponding colors as long as the character can be clearly seen.
The terminal equipment obtains a first layer color vector, a character outline layer and a layer identifier of the character and also obtains a brightness threshold value. The brightness threshold refers to a terminal device, a character from high brightness to low brightness or a critical value from low brightness to high brightness. High brightness means that the terminal device and the character are bright, and low brightness means that the terminal device and the character are dark. The bright and dark fingers refer to subjective bright feeling of the human eyes for viewing the display interface of the terminal equipment and the characters.
And generating a second layer color vector according to the brightness threshold and the first layer color vector. The second layer color vector refers to the color system (RGB) of the character, i.e., a vector composed of three components, red (R), green (G), and blue (B). For example, in the case where 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). For another example, if 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 moderate the contrast intensity between the brightness of the character and the brightness of the display interface. Then, color matching of the second layer color vector is filled in each character contour layer, that is, values of components (i.e., red (R), green (G), and blue (B)) of the second layer color vector are filled in each color value column of the RGB color pattern of the character contour layer, and a character contour layer conforming to the color of the second layer color vector is generated. And sequentially overlapping the character contour layers after the color matching processing according to the layer identifications corresponding to the character contour layers to generate characters displayed on a display interface.
The display brightness of the character can be controlled by each component of the color vector of the second layer. Illustratively, the larger the value of each component of the second layer color vector, the higher the brightness of the generated character; the smaller the values of the components of the second layer color vector, the lower the brightness of the generated character.
In the embodiment of the application, the second layer color vector can alleviate the contrast intensity between the brightness of the character and the brightness of the display interface. For example, in the case that the brightness of the display interface is high, the original brightness of the character may be increased (raised) according to the second layer color vector, so as to reduce the brightness interval between the brightness of the display interface and the brightness of the character. And under the condition that the brightness of the display interface is low, the original brightness of the character can be reduced (reduced) according to the color vector of the second layer so as to reduce the brightness interval between the brightness of the display interface and the brightness of the character. The contrast between the brightness of the display interface and the brightness of the characters is avoided to be strong, so that visual fatigue of a user is easy to occur.
In the embodiment of the application, whether the current brightness of the display interface of the terminal device is high or low may be determined according to the current time of the terminal device (obtained from a clock application of the terminal device), and for example, the current brightness of the display interface may be determined to be high during a period of time from 8:00 to 18:00 of the clock of the terminal device (i.e., the external environment is daytime and the light intensity is sufficient). The current brightness of the display interface is judged to be low when the time of the clock of the terminal device is 18:00-24:00 (namely the external environment is a black day and the light intensity is insufficient). The current brightness of the display interface of the terminal device can be determined to be high or low according to the operation of the user on the brightness control of the terminal device, for example, taking the brightness control as a bar, the user controls the brightness of the terminal device by operating a progress line of the bar, and the progress line can slide in the length direction of the bar inside the bar. Taking the middle position of the equally divided strip as a reference, and judging that the current brightness of the display interface is high under the condition that the progress line slides beyond the middle position in the strip brightness control; and under the condition that the sliding of the progress line on the bar-shaped brightness control does not exceed the middle position, judging that the current brightness of the display interface is low.
Under different external environments, according to the use requirements of the user, the user can increase the brightness of the display interface of the terminal device, or the user can decrease the brightness of the display interface of the terminal device. Based on the brightness adjustment of the display interface, the characters are displayed in a matching color matched with the second layer color vector through the second layer color vector, the contrast strength between the brightness of the characters and the brightness of the display interface is adjusted, the brightness of the displayed characters is adjusted and set, and the characters with the brightness meeting the visual comfort requirement of a user are kept displayed according to the brightness of different display interfaces.
In an embodiment of the present invention, the color scheme of the color vector of the second layer is filled into each character contour layer, and each character contour layer of the character may be colored according to the color scheme of the color vector of the second layer of the character. In one example, the color is represented by a vector composed of three components of red (R), green (G), and blue (B), the shape corresponding to the character contour layer is determined by a contour curve (a closed-loop contour map composed of lines, which is provided in the layer), and for any character contour layer, a closed region defined by the contour curve may be filled with the color matching values of the character contour layer (i.e., a vector composed of three components of red (R), green (G), and blue (B)), so as to generate the color matching layer of the layer.
As mentioned above, when the character has a plurality of character contour layers, the layer identifier of each character contour layer is the sequence number of each character contour layer, and the color matching layers of each layer are superimposed according to the layer identifier of each character contour layer, so as to obtain the character displayed on the display interface, which can be displayed in the display interface in a picture manner, for example, the character that needs to be displayed on the display interface can be drawn into the currently applied font file of the terminal device. The color effect of the image is displayed in a picture mode, and the effect that characters in an outline font format (such as Open Type) can be displayed under different operating system platforms is achieved.
In the scheme provided by the embodiment of the application, the character with the plurality of character outline layers is in an OpenType font format, and compared with a common character, the character with the plurality of character outline layers comprises rich color information. Under the condition that the current application of the terminal equipment is an electronic document comprising a text document, a table document and a demonstration document, if the electronic document has characters with a plurality of character outline layers, the characters to be displayed can be determined by analyzing the content of the electronic document. The file format of the electronic document includes a plurality of types, and the file format of the electronic document can be determined according to the file extension of the electronic document. The file extension refers to the letter following the last dot number in the electronic document name, and may be doc, docx, xls, xlsxx, ppt, pptx, pdf, txt, jpg, gif, tif, png, etc., for example.
In a possible implementation manner, referring to fig. 2, the step S120 may be specifically implemented by the following steps:
s121, acquiring a first brightness value of the character based on a color value of a pixel in the character;
s122, determining a brightness adjusting value based on the first brightness value and the brightness threshold value;
and S123, generating a second layer color vector according to the brightness adjustment value and the first layer color vector.
The first luminance value of the character is obtained by counting and calculating color values (i.e., pixel values) of all pixels of the character when a color system of the character is a first layer color vector.
As mentioned above, the brightness threshold refers to a threshold value from high brightness to low brightness of the terminal device, or from low brightness to high brightness, and in an embodiment of the present invention, the brightness threshold may also be determined according to a display mode of a display interface of the terminal device. The display mode of the display interface is a unified display requirement for all layers in the display interface, for example, the display mode requires that the brightness values of all layers in the display interface are reduced by a preset value, a preset brightness value is reduced, and the like. The display mode can be divided into a day mode and a night mode according to the high and low brightness of the display interface, when the display mode is the day mode, the display mode indicates that the brightness of the display interface is high, and the brightness threshold value at the moment refers to a critical value from high brightness to low brightness; the "night mode" indicates that the brightness of the display interface is low, and the brightness threshold at this time refers to a critical value from low brightness to high brightness. Note that the name of the presentation mode is not limited, and the daytime mode may be referred to as a daytime mode or the like, and the nighttime mode may be referred to as a dark mode or the like.
The display mode may be set by a user, the user may set the display mode in the display interface as a daytime mode or a nighttime mode, the display mode of the display interface may also be automatically set along with the system time of the terminal device, the display mode of the display interface is automatically set to the nighttime mode when the system time of the device is the nighttime, for example, 18:00-06:00, and the display mode of the display interface is automatically set to the daytime mode when the system time of the device is the daytime, for example, 08:00-17: 00. In addition, a camera or a photosensitive element connected with the terminal equipment can be called to acquire surrounding brightness, and the display mode of the display interface is automatically set to be a daytime mode under the condition that the surrounding brightness is larger than a set brightness value; and automatically setting the display mode of the display interface to be a night mode under the condition that the surrounding brightness is less than or equal to the set brightness value.
The value of the brightness threshold may be preset, and in one example, the brightness threshold may be set to be half of the maximum brightness value that can be displayed in the display mode of the display interface. In a case where the first luminance value is greater than the luminance threshold value, a luminance adjustment value is determined based on the first luminance value and the luminance threshold value. The brightness adjustment value of the character may include a value that needs to be adjusted for each color component in each character outline layer in the character, so after the brightness adjustment value of the character is obtained, each color component in the first layer color vector may be adjusted based on the brightness adjustment value, and each color component that is the second layer color vector is obtained, thereby obtaining the second layer color vector. The brightness of the character can be adjusted by adjusting the brightness adjustment value to adjust the character from the first layer color vector to the second layer color vector.
In a possible implementation manner, the step S121 may be specifically implemented by the following steps:
step one, acquiring pixel values of all pixels of a character, respectively calculating an average value of the pixel values of each pixel channel, and taking the average value as a color value of the pixel;
and step two, carrying out weighted summation calculation on the average value of the pixel values of each pixel channel to obtain the brightness value of the character.
A pixel channel refers to a pixel color layer that is composed of a set of luminance values of the primary colors. For an image in RGB mode, there are 4 pixel channels, which are a composite pixel channel (RGB channel), a red (R) pixel channel, a green (G) pixel channel, and a blue (B) pixel channel. The pixel values of the pixels may include pixel values of a plurality of pixel channels in the pixel, and in one example, taking the character image to be displayed as an image in RGB format, the pixel value of one color pixel may be composed of pixel values of three pixel channels of red (R), green (G), and blue (B).
Under the condition that the character has only one color (pure color), calculating the average value of the pixel values of each pixel channel in the character to be displayed, namely respectively averaging the pixel values of three pixel channels of red (R), green (G) and blue (B) of the character image to be displayed, respectively summing the pixel values of the three pixel channels in the character image to be displayed to obtain the sum of the pixel values of the three pixel channels, and then dividing the sum of the pixel values of the three pixel channels by the number of effective pixels in the character to be displayed, so as to obtain the average value of the pixel values of the three pixel channels in the character to be displayed.
In the case that the character includes multiple colors (colors), calculating an average value of pixel values of each pixel channel in the character to be displayed means that pixel values of three pixel channels of red (R), green (G) and blue (B) in the color system are respectively averaged in each color system unit, and the pixel values of the three pixel channels in the character image to be displayed can be respectively summed to obtain a sum of the respective pixel values in the three pixel channels, and then the sum of the pixel values of the three pixel channels is respectively divided by the number of effective pixels in the character to be displayed, so as to obtain the average value of the respective pixel values of the three pixel channels in the character to be displayed. The average (i.e., color value) is calculated from color system to color system until the average of all color systems is calculated. The color system refers to a series to which a color belongs, and the same color system in the present application may be determined based on the cold and warm color system division, or may be determined based on the same color system division, which is not limited in the present invention.
After the average value of the pixel values of each pixel channel in the character to be displayed is obtained, the first brightness value of the character to be displayed can be calculated by adopting a weighted summation mode on the average value of the pixel values of each pixel channel. The weighting coefficient of the pixel value of each pixel channel may be determined according to actual requirements. For example, the pixel value of a color pixel may be composed of the pixel values of three pixel channels of red (R), green (G), and blue (B), and the average values of the pixel values of the three pixel channels are obtained as
Figure BDA0003274484750000121
Then, it is calculated as follows:
Figure BDA0003274484750000122
wherein, L is a first brightness value, and a, B, and c are weighting coefficients of pixel values of three pixel channels of red (R), green (G), and blue (B), respectively. a. b and c can be set according to practical conditions in a self-defined mode, in one example, a can be set to be 7, b can be set to be 9, and c can be set to be 1.2.
In a possible implementation manner, the step S122 may be specifically implemented by the following steps:
step one, calculating a difference value between a first brightness value and a brightness threshold value;
step two, carrying out logarithmic calculation on the difference value;
and step three, taking the logarithm calculation result as a brightness adjustment value.
As mentioned above, the brightness threshold may be preset. In one example, it may be half the maximum brightness value that the display interface can exhibit. Illustratively, the maximum brightness value of the display interface of the terminal device is 2400 candelas per square meter, and the brightness threshold is 1200 candelas per square meter.
The luminance adjustment value obtained by calculating the difference between the first luminance value and the luminance threshold and then calculating the logarithm of the difference may be calculated according to the following formula:
t=log2(L-T)
wherein T is a brightness adjustment value, and T is a brightness threshold. In one example, the brightness threshold may be set to half the maximum brightness value that can be displayed in the display mode of the display interface. The method for calculating the logarithm can enable the brightness adjustment value to be smaller, namely, the difference between the first layer color vector and the second layer color vector of the character cannot be larger, so that the character can be displayed in a color matching mode matched with the second layer color vector, and the contrast strength between the brightness of the character and the brightness of a display interface is adjusted. And the brightness change after the character adjustment is relatively mild, and the discomfort of eyes caused by the strong sudden brightness change feeling of the character can not be caused to the user.
In one 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 the daytime mode, the pixel value of each pixel of the character may be added to the brightness adjustment value to obtain a second layer color vector of the character; when the brightness of the display interface is relatively low (the brightness value of the display interface is lower than the brightness threshold), or the display mode of the display interface is the night mode, the pixel value of each pixel of the character may be subtracted from the brightness adjustment value to obtain the second layer color vector of the character.
In a possible implementation manner, before the above step performs the logarithmic calculation on the difference, the method further includes the following steps:
step one, judging whether the difference value is larger than a first natural number or not;
and step two, under the condition that the difference value is larger than the first natural number, a logarithm calculation step is executed.
The first natural number may be 1, 2, or the like. In the case where the difference is smaller than the first natural number, the logarithm calculation step may not be performed, and the luminance adjustment value may be directly set to a second natural number, which may be 0.
In the embodiment of the present invention, the step of determining the comparison between the difference between the first luminance value and the luminance threshold and the first natural number is performed, so that the logarithmic calculation satisfies the calculation rule, that is, the argument needs to be a positive number.
In the embodiment of the present invention, when the brightness adjustment value is determined, the pixel value of each pixel of the character is 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. Illustratively, 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), i.e. the fill color of the character outline layer of the pixel is the corresponding color match of (102, 82, 112).
In one example, if the luminance adjustment value obtained after the logarithmic calculation is a negative number, it may indicate that the luminance is increased, for example, if the luminance adjustment value is-8, and the pixel value of one pixel is (110, 90, 120), the difference between the pixel value and the luminance adjustment value is equal to (110, 90, 120) + (8, 8, 8), that is, the filling color of the character outline layer of the pixel is the corresponding color match (118, 98, 128).
In an implementation manner of the present invention, before step S121, the character display method provided by the present invention further includes:
acquiring a second brightness value of the display interface;
and in the case that the second brightness value is smaller than the brightness threshold value, executing the step of acquiring the first brightness value of the character.
The second brightness value of the display interface is the current brightness of the display interface, and can be obtained by counting the pixel values of the pixels in the display interface. In one example, the average value of the pixel values of the three pixel channels in the display interface may be obtained by summing the pixel values of the three pixel channels of red (R), green (G), and blue (B) to obtain the sum of the pixel values of the three pixel channels, and dividing the sum of the pixel values of the three pixel channels by the number of pixels in the display interface. After the average value of the pixel values of each pixel channel in the display interface is obtained, a weighted summation method may be used to calculate the second brightness value of the display interface for the average value of the pixel values of each pixel channel. For a specific calculation manner of the weighted summation, reference may be made to a weighted summation manner when the first luminance value is obtained in the foregoing embodiment, which is not described herein again.
After the second brightness value of the display interface is obtained, the second brightness value may be compared with a brightness threshold. When the second brightness value is smaller than the brightness threshold, it indicates that the brightness value of the display interface is lower and the brightness is darker, or it may indicate that the display mode of the display interface is a night mode, and at this time, the step of obtaining the first brightness value of the character is performed; when the second brightness value is greater than the brightness threshold, it indicates that the brightness value of the display interface is higher and the brightness is brighter, or may indicate that the display mode of the display interface is a daytime mode, and the brightness adjustment value may be set according to a preset adjustment ratio, for example, the brightness adjustment value is 10% of the second brightness value of the display interface.
In a possible implementation manner, the step S123 may be specifically implemented by the following steps:
calculating a difference value between a color vector of a first layer and a brightness adjustment value;
and step two, taking the difference value as a second layer color vector.
In a possible implementation manner, under the condition that the brightness adjustment value is determined, a difference between the first layer color vector and the brightness adjustment value is calculated, pixel values of pixels in the character may be traversed, a difference between the pixel value of each pixel and the brightness adjustment value is calculated, color matching of the difference between the pixel value of each pixel is color matching of each character contour layer in the second layer color vector, and then the color matching of each character contour layer in the second layer color vector is used as a filling color of the character contour layer to fill the character contour layer.
In one example, in a case where a result of subtracting the luminance 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 may be set to 0 in this case. For example, if the luminance adjustment value is 10, the pixel values of the three pixel channels of a certain pixel are (100,120,8), and the pixel value may be (90,110,0) after subtracting the luminance adjustment value.
In a possible implementation manner, the step S123 generates the second layer color vector according to the brightness adjustment value and the first layer color vector, and further includes:
and setting the brightness adjustment value as a second natural number when the first brightness value is smaller than the brightness threshold value.
The second natural number may be 0, and a difference between the color vector of the first layer and the brightness adjustment value is calculated; to obtain a second layer color vector, and filling the character outline layer with the color matching of the second layer color vector. It is to be understood that the first-layer color vector and the second-layer color vector may be set to coincide in a case where the first luminance value is smaller than the luminance threshold.
In an 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 the electronic document, and the characters are displayed according to the character data.
As mentioned above, in the case that the current application of the terminal device is an electronic document including a text document, a form document, and a presentation document, if there are characters having a plurality of character outline layers in the electronic document, the characters to be displayed can be determined by analyzing the content of the electronic document. The electronic document may be embedded in a font file, and the font file includes font information of each character, for example, the number of character outline layers of the character, layer identifiers of each character outline layer, a first layer color vector, outline curve data for determining a corresponding shape of each character outline layer, and the like. In the case where the font file is not embedded in the electronic document, the font file should be installed in the system platform to which the terminal device is applied. That is, in the solution provided in the embodiment of the present application, the font file is embedded in the electronic document and/or installed in the system platform applied to the terminal device. Reading the character data of the embedded font file from the electronic document to the internal storage of the electronic document, or reading the character data of the font file from the storage path to the internal storage according to the font file installed by the system platform applied by the terminal device.
In a possible embodiment, in a case that the font file of the character to be displayed is embedded in the electronic document, the layer identifier of each character outline layer of the character, the outline curve of the corresponding shape of each character outline layer of the character, and the first layer color vector of the character are obtained from the embedded font file of the electronic document.
In a possible embodiment, when the font file of the character to be displayed is not embedded in the electronic document, the layer identifier of each character outline layer of the character, the outline curve of the corresponding shape of each character outline layer of the character, and the first layer color vector of the character are obtained from the font file installed in the system platform of the terminal device application.
After the electronic document is obtained, whether a font file of a character to be displayed is embedded into the electronic document is checked, if the font file of the character to be displayed is embedded into the electronic document, layer identification of each character outline layer of the character, an outline curve of a corresponding shape of each character outline layer of the character and a first layer color vector of the character are obtained from the embedded font file of the electronic document.
The layer color vector stored in the font file may include a first layer color vector of a character, and in an example, the layer color vector stored in the font file may further include a second layer color vector of the character, where a storage location of the second layer color vector is different from a storage location of the first layer color vector. In one example, the second layer color vector of the font can be directly read from the font file to save the computing resources.
And if the character is not embedded into the electronic document, reading the font file from the storage path according to the font file installed in the system platform applied by the terminal equipment, and acquiring the layer identification of each character outline layer of the character, the outline curve of the corresponding shape of each character outline layer of the character and the first layer color vector of the character from the font file installed in the system platform applied by the terminal equipment.
Generally, there are a plurality of characters, a font file may include character data of the plurality of characters, the characters have corresponding character code values, and the font file correspondingly stores a corresponding relationship between the character code value of each character and the character data of the character, so after the character to be displayed is determined, the character data of the character to be displayed may be read from the font file according to the character code value of the character to be displayed, the character data of the character includes a plurality of character contour layers, further the character data further includes layer identifiers of the respective character contour layers, second layer color vectors, and contour curves corresponding to the respective character contour layers. For example, a character is a thermometer icon with a character code of 1F321, as shown in fig. 3-1, fig. 3-1 is a thermometer character display diagram provided in the embodiment of the present application, the character is superimposed by a plurality of character contour layers, and includes 4 character contour layers, layer 1, layer 2, layer 3, and layer 4, and each character contour layer diagram is shown in fig. 3-2, fig. 3-3, fig. 3-4, and fig. 3-5, respectively. FIG. 3-2 is a schematic view of a first character outline layer of thermometer characters according to an embodiment of the present disclosure; FIGS. 3-3 are schematic diagrams of second profile layers of thermometer characters according to embodiments of the present disclosure; FIGS. 3-4 are schematic diagrams of a third profile layer of thermometer characters according to an embodiment of the present disclosure; fig. 3-5 are schematic diagrams of a fourth character outline layer of thermometer characters according to an embodiment of the present disclosure.
Each character contour layer corresponds to a contour curve, the contour curve is a closed curve, the color vector of the second layer comprises color matching values corresponding to each character contour layer, in the graphics, an 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 values (A), generally (R, G, B and A) is called a quadruple, and a quadruple represents the color formed by combining R A, G A, B A after R, G, B three components are multiplied by A respectively. For example, a bitmap stored using 16 bits per pixel, for each pixel in the graph, may have 5 bits for red, 5 bits for green, 5 bits for blue, and the last bit being the Alpha value. The color matching values of each character outline layer also include Alpha values, red values, green values and blue values. In practical application, after the font file is acquired, the font file may be sent to a font engine (FreeType2) through a preset interface, and the font file is analyzed through the FreeType2 to obtain the color matching values of each character outline layer and the outline curves corresponding to each character outline layer.
After the contour curve and the color matching values are obtained, corresponding colors can be filled in the closed area defined by the contour curve according to the layer identification of each character contour layer of the character, and specifically, an algorithm for filling the closed area defined by the contour curve with the corresponding colors can be realized by using an application development framework (QT). And finally, drawing the processed character diagram into a cache of a display interface so as to display the character effect.
In one possible embodiment, the font file includes a 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 numbers of the corresponding shapes of the character contour layers of the characters, the layer identifications of the character contour layers and the color matching indexes of the character contour layers; the CPAL table stores color matching values of the character outline layers of the characters, wherein the color matching indexes and the color matching values have an association relationship; the GLYF table stores contour curves of shapes corresponding to each character contour layer of the characters, wherein a contour curve number and a contour curve have an association relationship.
In one example, each character corresponds to a unique character code value, and for any character, the character code value of the character and the contour curve number and the color matching index of the corresponding shape of each character contour layer of the character are stored in a COLR table in an associated manner; in one example, the COLR table may be as shown in table 1.
TABLE 1
Figure BDA0003274484750000181
In one example, the layer identifiers of the outline layers of the characters are the same as the arrangement sequence of the outline curve numbers corresponding to the characters in the COLR table in the table. Of course, additional items may be added to record the layer identifiers of the outline layers of the characters, which are all within the protection scope of the present application.
Color matching values of all layers of the characters are stored in a CPAL table; the color matching indexes corresponding to the characters have a corresponding relationship with the color matching values, that is, for any color matching index in the COLR table, the color matching value corresponding to the color matching index can be found in the CPAL table. In one example, the CPAL table may be as shown in table 2.
TABLE 2
Figure BDA0003274484750000182
Figure BDA0003274484750000191
In one example, the GLYF table associates and stores a contour curve number of each character contour layer of a character with a contour curve of a corresponding shape. The number of the outline curve corresponding to the character has a corresponding relationship with the outline curve, that is, for any one of the number of the outline curve in the COLR table, the outline curve corresponding to the number of the outline curve can be found in the GLYF table. In one example, the CPAL table can be as shown in Table 3, and in another example, the CPAL table can be as shown in Table 4.
TABLE 3
Figure BDA0003274484750000192
TABLE 4
Figure BDA0003274484750000193
Figure BDA0003274484750000201
Generally, a font file in the OpenType format stores data in the form of a table, wherein a GLYF table stores a contour curve of each character contour layer of a character, and generally, the contour curve of the character is described by a bezier curve. In order to store character data of characters, a COLR table and a CPAL table are respectively added into a font file, and data of a GLYF table are expanded, wherein the COLR table stores contour curve numbers and color matching indexes of each character contour layer corresponding to the characters, and the CPAL table stores color matching values corresponding to the color matching indexes. The COLR table, the CPAL table and the GLYF table can store character data of corresponding characters according to character code values, and thus, corresponding data can be acquired from each table according to the character code values.
In one possible embodiment, the color matching values of the character contour layers of the characters may be obtained from the CPAL table according to the color matching indexes of the character contour layers of the characters, the corresponding color matching indexes of the characters, and the corresponding relationship between the color matching values.
After the characters to be displayed in the display interface are determined, according to the character code values of the characters to be displayed, firstly, acquiring the contour curve numbers of the shapes corresponding to the character contour layers of the characters and the color matching indexes of the character contour layers of the characters from a COLR table, then acquiring the contour curves of the shapes corresponding to the character contour layers of the characters from a GLYF table according to the contour curve numbers of the shapes corresponding to the character contour layers of the characters and the corresponding relations between the contour curve numbers and the contour curves corresponding to the characters, and finally acquiring the color matching values of the character contour layers of the characters from a CPAL table according to the color matching indexes of the character contour layers of the characters, the color matching indexes corresponding to the characters and the corresponding relations between the color matching values.
In a possible embodiment, the font file further includes a superposition offset of each character outline layer corresponding to the character; generally, the font file further includes a superposition offset of each character contour layer corresponding to the character, so that after the color matching layers are obtained, the color matching layers can be superposed in sequence according to the sequence of layer identifications of the character contour layers of the character and the superposition offset of each character contour layer, and the processed character map to be displayed is obtained. After the processed character diagram to be displayed is obtained, the processed character diagram to be displayed can be drawn into the background cache of the electronic document according to the display mode of a common picture in the electronic document, so that the character effect of the OpenType font format is realized.
An embodiment of the present application provides a character display apparatus, referring to fig. 4, where fig. 4 is a schematic diagram of the character display apparatus according to the embodiment of the present application, including:
the obtaining module 11 is configured to obtain a first layer color vector of a character, a character outline layer, and a layer identifier, and is configured to obtain a brightness threshold;
the determining module 12 is configured to generate a second layer color vector according to the brightness threshold and the first layer color vector;
and the character generating module 13 is configured to fill the color matching of the second layer color vector to each character contour layer, and sequentially superimpose each color-matched character contour layer according to the layer identifier corresponding to each character contour layer to generate characters displayed on the display interface.
In a possible implementation, the determining module 12 includes:
a luminance value determination submodule for determining a first luminance value of the character based on pixel values of pixels in the character;
the brightness adjustment value determining submodule is used for determining a brightness adjustment value based on the first brightness value and the brightness threshold value;
and the color vector generation submodule generates a second layer color vector according to the brightness adjustment value and the first layer color vector.
In a possible implementation manner, the luminance value determining submodule is specifically configured to obtain pixel values of pixels of a character, calculate an average value of the pixel values of each pixel channel, and use the average value as a color value of the pixel;
and carrying out weighted summation calculation on the average value of the pixel values of each pixel channel to obtain a first brightness value of the character.
In a possible embodiment, the brightness adjustment value determining submodule is specifically configured to calculate a difference between the first brightness value and a brightness threshold;
carrying out logarithmic calculation on the difference value;
and taking the logarithm calculation result as a brightness adjustment value.
In a possible implementation manner, the brightness adjustment value determining submodule is specifically further configured to determine whether the difference value is greater than a first natural number;
in case the difference is larger than the first natural number, a logarithmic calculation step is performed.
In a possible embodiment, the above apparatus further comprises:
and the difference value calculating module is used for traversing the pixel values of all pixels of the character under the condition of determining the brightness adjusting value, calculating the difference value between the pixel value of each pixel and the brightness adjusting value, and taking the color matching of the difference value of each pixel as the filling color of the character outline layer.
In a possible embodiment, the above apparatus further comprises:
the brightness value acquisition module is used for acquiring a second brightness value of the display interface;
and the brightness value judging module is used for executing the step of acquiring the first brightness value of the character under the condition that the second brightness value is smaller than the brightness threshold.
In a possible implementation, the color vector generation submodule is specifically configured to:
calculating a difference value between the color vector of the first layer and the brightness adjustment value;
and taking the difference value as a second layer color vector.
In a possible implementation, the color vector generation submodule is further configured to:
and setting the brightness adjustment value as a second natural number when the first brightness value is smaller than the brightness threshold value.
In a possible embodiment, the above apparatus further comprises:
and the character storage module is used for storing character data of the first layer color vector, the character outline layer, the layer identification and the second layer color vector into a font file, the font file is arranged in the electronic document, and the characters are displayed according to the character data.
An embodiment of the present application further provides an electronic device, referring to fig. 5, where fig. 5 is a schematic structural diagram of the electronic device according to the embodiment of the present application, and the electronic device includes: the system comprises 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 are communicated with each other through the communication bus 24.
The memory 23 for storing a computer program;
the processor 21 is configured to implement the steps of the character display method according to the present invention when executing the computer program stored in the memory 23.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
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 memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In an embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the character display methods described above.
In an embodiment of the present application, there is also provided a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the character display methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The processes or functions described above in accordance with the embodiments of the present application occur wholly or in part upon loading and execution of the above-described computer program instructions on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It should be noted that, in this document, the technical features in the various alternatives can be combined to form the scheme as long as the technical features are not contradictory, and the scheme is within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the same element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for embodiments of the apparatus, the electronic device, the computer-readable storage medium, and the computer program product comprising instructions, which are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
The above description is only a preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (13)

1. A character display method, comprising:
acquiring a first layer color vector, a character outline layer and a layer identifier of a character, and acquiring a brightness threshold;
generating a second layer color vector according to the brightness threshold and the first layer color vector;
and filling the color matching of the second layer color vector to each character contour layer, and sequentially overlapping the character contour layers after the color matching processing according to the layer identification corresponding to each character contour layer to generate characters displayed on a display interface.
2. The method of claim 1, wherein generating a second layer color vector based on the luminance threshold and the first layer color vector comprises:
determining a first luminance 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 value;
and generating the second layer color vector according to the brightness adjustment value and the first layer color vector.
3. The method of claim 2, wherein determining a first luminance value for the character based on color values of pixels in the character comprises:
acquiring pixel values of pixels of the characters, respectively calculating an average value of the pixel values of each pixel channel, and taking the average value as the color value of the pixel;
and carrying out weighted summation calculation on the average value of the pixel values of each pixel channel to obtain a first brightness value of the character.
4. The method of claim 3, wherein determining a brightness adjustment value based on the first brightness value and a brightness threshold comprises:
calculating a difference between the first luminance value and the luminance threshold value;
carrying out logarithmic calculation on the difference value;
and taking the logarithm calculation result as the brightness adjustment value.
5. The method of claim 4, wherein prior to said calculating the logarithm of the difference, the method further comprises:
judging whether the difference value is larger than a first natural number or not;
in case the difference is larger than the first natural number, a logarithmic calculation step is performed.
6. The method of claim 5, further comprising:
and under the condition of determining the brightness adjustment value, traversing the pixel value of each pixel of the character, calculating the difference value between the pixel value of each pixel and the brightness adjustment value, and taking the color matching of the difference value of each pixel as the filling color of the character outline layer.
7. The method of claim 2, wherein prior to determining the first luma value of the character based on color values of pixels in the character, the method further comprises:
acquiring a second brightness value of the display interface;
and executing the step of acquiring the first brightness value of the character under the condition that the second brightness value is smaller than the brightness threshold value.
8. The method according to claim 2, wherein the generating the second layer color vector according to the brightness adjustment value and the first layer color vector comprises:
calculating a difference value between the first layer color vector and the brightness adjustment value;
and taking the difference value as the second layer color vector.
9. The method according to claim 2, wherein the generating the second layer color vector according to the brightness adjustment value and the first layer color vector further comprises:
setting the brightness adjustment value to a second natural number in a case where the first brightness value is smaller than the brightness threshold.
10. The method of claim 1, further comprising:
and storing character data of the first layer color vector, the character outline layer, the layer identifier and the second layer color vector in a font file, wherein the font file is arranged in the electronic document, and the characters are displayed according to the character data.
11. A character display apparatus, comprising:
the acquisition module is used for acquiring a first layer color vector, a character outline layer and a layer identifier of a character and acquiring a brightness threshold;
the determining module is used for generating a second layer color vector according to the brightness threshold and the first layer color vector;
and the character generation module is used for filling the color matching of the second layer color vector to each character outline layer, and sequentially overlapping each character outline layer after color matching processing according to the layer identifier corresponding to each character outline layer to generate characters displayed on a display interface.
12. An electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the character display method according to any one of claims 1 to 10 when executing the computer program stored in the memory.
13. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which, when executed by a processor, implements the character display method according to any one of claims 1 to 10.
CN202111113007.0A 2021-09-23 2021-09-23 Character display method and device, electronic equipment and storage medium Pending CN113869002A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111113007.0A CN113869002A (en) 2021-09-23 2021-09-23 Character display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111113007.0A CN113869002A (en) 2021-09-23 2021-09-23 Character display method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113869002A true CN113869002A (en) 2021-12-31

Family

ID=78993487

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111113007.0A Pending CN113869002A (en) 2021-09-23 2021-09-23 Character display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113869002A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114594894A (en) * 2022-02-25 2022-06-07 青岛海信移动通信技术股份有限公司 Interface element marking method, terminal device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114594894A (en) * 2022-02-25 2022-06-07 青岛海信移动通信技术股份有限公司 Interface element marking method, terminal device and storage medium

Similar Documents

Publication Publication Date Title
US20120127198A1 (en) Selection of foreground characteristics based on background
CN104076928B (en) A kind of method for adjusting text importing image
CN105513019B (en) A kind of method and apparatus promoting picture quality
Mittelstädt et al. Methods for compensating contrast effects in information visualization
CA3154893C (en) Image color transferring method, device, computer equipment and storage medium
JP2000134486A (en) Image processing unit, image processing method and storage medium
CN110473282B (en) Dyeing processing method and device for object model, computer equipment and storage medium
CN107016978A (en) A kind of showing interface technology and terminal device
KR20190027131A (en) Apparatus and method for display visibility enhancement
CN113869002A (en) Character display method and device, electronic equipment and storage medium
CN110442313B (en) Display attribute adjusting method and related equipment
CN114333675B (en) Display compensation method, device, display device and storage medium
CN110444181A (en) Display methods, device, terminal and computer readable storage medium
CN110880164A (en) Image processing method, device and equipment and computer storage medium
JP4344775B1 (en) Image information confirmation apparatus and image information confirmation program
Yu et al. Color scheme adaptation to enhance user experience on smartphone displays leveraging ambient light
CN112541955A (en) Image processing method, device and equipment
CN114138215A (en) Display method and related equipment
CN109300170B (en) Method for transmitting shadow of portrait photo
KR101159387B1 (en) Use of an input black and white bitmap to generate emboldened anti-aliasing bitmap
US11527023B2 (en) Image processing for increasing visibility of obscured patterns
WO2021213222A1 (en) Method and apparatus for processing reading content, computer device and storage medium
Chen et al. Image contrast enhancement method based on display and human visual system characteristics
CN114416089A (en) Page display method and device, mobile terminal and storage medium
US10186063B2 (en) Image processing apparatus, non-transitory computer readable medium, and image processing method for generating a composite image

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination