CN103544931A - Character generating method and device and application terminal - Google Patents

Character generating method and device and application terminal Download PDF

Info

Publication number
CN103544931A
CN103544931A CN201310477450.5A CN201310477450A CN103544931A CN 103544931 A CN103544931 A CN 103544931A CN 201310477450 A CN201310477450 A CN 201310477450A CN 103544931 A CN103544931 A CN 103544931A
Authority
CN
China
Prior art keywords
bitmap
advance
gray
aberration
limit setting
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.)
Granted
Application number
CN201310477450.5A
Other languages
Chinese (zh)
Other versions
CN103544931B (en
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.)
TCL Corp
Original Assignee
TCL Corp
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 TCL Corp filed Critical TCL Corp
Priority to CN201310477450.5A priority Critical patent/CN103544931B/en
Publication of CN103544931A publication Critical patent/CN103544931A/en
Application granted granted Critical
Publication of CN103544931B publication Critical patent/CN103544931B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention is applicable to the field of system characters and provides a character generating method and device and an application terminal. The character generating method includes calling a bitmap of a currently displayed character when a chromatic aberration of a foreground color and a background color of the currently displayed character is smaller than a preset upper aberration limit value or the size of the currently displayed character is larger than a preset lower character size limit value, rectifying a gray value of the bitmap so as to subject character edges to nonlinear transition, subjecting the rectified bitmap to regenerating characters, storing and displaying the characters. By the aid of the character generating method and device, transition speed of the character edges can be increased, character acutance is improved, and the character generating method and device can be applicable to the environment of application programs and achieve better display effect.

Description

A kind of generation method, device and application terminal of word
Technical field
The invention belongs to system literal field, relate in particular to a kind of generation method, device and application terminal of word.
Background technology
Android system literal display effect under varying environment has larger difference, and its readability depends on the factors such as hardware, software, word size, rendering intent, text color, background color.But current Android system literal shows, can only use same style, once revise, to the application program of all use system literals, all can exert an influence.Therefore for example text color and background color contrast are when little under some environment for the word in existing Android system, and word seems relatively to require great effort, and display effect is poor.
Summary of the invention
The object of the embodiment of the present invention is to provide a kind of generation method of word, and the word that is intended to solve in Android system seems relatively to require great effort under some environment, the problem that display effect is poor.
The embodiment of the present invention is achieved in that a kind of generation method of word, and described method comprises:
When the size that is less than an aberration higher limit setting in advance or current display text at the foreground of current display text and the aberration of background colour is greater than the font size lower limit setting in advance, call the bitmap of current display text, the gray-scale value of revising bitmap is non-linear excessive so that word edge is carried out;
Amended bitmap is regenerated to word to be stored and shows.
The embodiment of the present invention also provides a kind of generating apparatus of word, and described device comprises:
Non-linear excessive unit, while surpassing for be less than the size of an aberration higher limit setting in advance or current display text at the foreground of current display text and the aberration of background colour the font size lower limit setting in advance, call the bitmap of current display text, the gray-scale value of revising bitmap is non-linear excessive so that word edge is carried out;
Word generation unit, stores and shows for amended bitmap is regenerated to word.
The embodiment of the present invention also provides a kind of application terminal, and described application terminal comprises described device.
The embodiment of the present invention compared with prior art, beneficial effect is: the gray-scale value by modification bitmap is non-linear excessive so that word edge is carried out, amended bitmap is regenerated to word to be stored and shows, can increase the transition speed at word edge, improve the acutance of word, the environment that can adapt to application program, reaches good display effect.
Accompanying drawing explanation
Fig. 1 is the process flow diagram of the generation method of the word that provides of the embodiment of the present invention;
Fig. 2 is an effect contrast figure of the application scenarios example that provides of the embodiment of the present invention;
Fig. 3 is the enlarged drawing of the part of Fig. 2 of providing of the embodiment of the present invention;
Fig. 4 is another effect contrast figure of the application scenarios example that provides of the embodiment of the present invention;
Fig. 5 is the module frame chart of the generating apparatus of the word that provides of the embodiment of the present invention.
Embodiment
In order to make object of the present invention, technical scheme and advantage clearer, below in conjunction with drawings and Examples, the present invention is further elaborated.Should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not intended to limit the present invention.
The embodiment that the embodiment of the present invention provides is as follows:
Refer to Fig. 1, the embodiment of the present invention provides a kind of generation method of word, and described method comprises:
Step S101, when the size that is less than an aberration higher limit setting in advance or current display text at the foreground of current display text and the aberration of background colour is greater than the font size lower limit setting in advance, call the bitmap of current display text, the gray-scale value of revising bitmap is non-linear excessive so that word edge is carried out.
In embodiments of the present invention, in step S101, also comprise: when the size of the aberration higher limit setting in advance described in the foreground of current display text and the aberration of background colour are not less than or current display text is less than the font size lower limit setting in advance, the current display text of default system, does not deal with.
In one embodiment of the invention, the step of the gray-scale value of this modification bitmap comprises:
Gray-scale value x in bitmap is revised as to x and is multiplied by more than one permeability coefficient y;
Described permeability coefficient y=mx, wherein m ∈ [0,1].
In one embodiment of the invention, when the size that is less than an aberration higher limit setting in advance and is greater than an aberration higher limit setting in advance or described current display text at the foreground of described current display text and the aberration of background colour is greater than the font size lower limit setting in advance and is less than a font size higher limit setting in advance, describedly gray-scale value x in bitmap is revised as to step that x is multiplied by more than one permeability coefficient y is specially and the gray-scale value x in bitmap is revised as to x is multiplied by a permeability coefficient y.
In one embodiment of the invention, when the size that is less than an aberration lower limit setting in advance or described current display text at the foreground of described current display text and the aberration of background colour is greater than the font size higher limit setting in advance, describedly gray-scale value x in bitmap is revised as to step that x is multiplied by more than one permeability coefficient y is specially and the gray-scale value x in bitmap is revised as to x is multiplied by two permeability coefficient y.
In a preferred embodiment of the invention, the preferred value of described m is 1/255.
In one embodiment of the invention, revise the gray-scale value of bitmap and just can obtain good visual effect under certain scene, such as word is larger, prospect background aberration is different little etc.Word compared with circlet border under, the effect of processing is not on the contrary not as processing, but concrete what environment, Android system self is to be difficult to judgement, application program is under what scene, application program self is very clearly, so the method that the embodiment of the present invention adopts is which type of word rendering intent is application program initiatively apply for needing according to current scene.
In one embodiment of the invention, further comprising the steps of before step S101:
Application program judges the foreground of current display text and the aberration magnitude range of background colour;
Application program judges the magnitude range of current display text.
By judgement aberration size and word magnitude range, decide the gray-scale value that only has the just needs that meet step S101 condition to revise bitmap, do not satisfy condition without the gray-scale value of revising bitmap, thereby the varying environment in adaptive system, is issued to good display effect at different environment.
In embodiments of the present invention, the step of the bitmap that calls current display text in step S101 can be specially: after the interface function of application call Skia generating character, get the bitmap of word by calling FreeType function.
Step S102, regenerates word by amended bitmap and stores and show.
The embodiment of the present invention is non-linear excessive so that word edge is carried out by the gray-scale value of modification bitmap, amended bitmap is regenerated to word to be stored and shows, can increase the transition speed at word edge, improve the acutance of word, the environment that can adapt to application program, reaches good display effect.
Application scenarios example:
The technical scheme that the embodiment of the present invention provides can be applicable in Android system, word product process in Android system under acquiescence completes by increase income storehouse Skia and FreeType co-operate, FreeType can load for example * .TTF file of literal pool, generates vector character bitmap.Under Android system default, by FreeType, play up the word of generation, edge has from completely transparent in not saturating gradual change, and this is excessively linear.
The method that Skia provides according to the embodiment of the present invention bitmap by interface function is processed, and sends into video memory and shows, the linearity at word edge excessively can be revised as non-linear excessively, thereby increase the excessive speed in edge, improve the acutance of word.
In the bitmap that word edge transitional effect generates at FreeType, with gray-scale value, embody.Gray-scale value is multiplied by a permeability coefficient, just can reaches the effect of nonlinearities change.For example:
Quafric curve is played up: x=x* (x/255)
Cubic curve is played up: x=x* (x/255) * (x/255)
At Skia, load after FreeType bitmap, internal storage data is carried out to above operation, just can reach the nonlinearities change of n curve and then the effect of raising acutance.
But the visual effect that the lifting of this acutance need to just can obtain under certain scene, such as word is larger, prospect background aberration is different little etc.Word compared with circlet border under, the effect of processing is not on the contrary not as processing, but concrete what environment, Android system self is to be difficult to judgement, application program is under what scene, application program self is very clearly, so the method that the embodiment of the present invention adopts is which type of word rendering intent application initiatively applies for needing according to current scene.
Can when Android system starts, create a system property variable render_mode, be used for representing word rendering intent, by different values, represent different rendering intents: the rendering intent such as 0 representative system acquiescence, does not namely process; 1 represents that quafric curve plays up; 2 represent that cubic curve plays up.Certainly these methods can be other algorithms, are not limited to above enumerating.Default value is 0.
When being applied in need to change word time, write corresponding value to attribute variable render_mode, application system provides different word rendering intents.Such as, foreground and background colour that current word shows are very approaching, and render_mode is set to 2, adopts cubic curve to play up, can larger raising word acutance, word is seen more clearly; Or when current page word size is medium, render_mode is set to 1, can to a certain degree improve word acutance; When current page word is very little, render_mode is set to 0, adopts system default setting not process.In the different scenes of same application, also can switch character displaying method.Such as from a very little scene of foreground background colour difference, be switched to while differing greatly scene, render_mode can be set to 1 by 2, the algorithm less by sharpening degree carries out word generation.
After the interface function of application call Skia generating character, can call the bitmap that FreeType function gets word, at this moment the value of render_mode is judged, according to the different rendering intents of the different employing of value, internal storage data is carried out to corresponding processing.Such as render_mode value is 1 o'clock, x=x* (x/255), after being disposed, is reduced to 0 by render_mode value, and Skia can show the character bitmap generating character after processing afterwards.When next word generates, can read render_mode value equally.If 0, can not process.So,, after current scene word generates, can not have influence on the word of other scenes or application.
The design sketch of its application is as Fig. 2, Fig. 3 and Fig. 4, and Fig. 2 is the effect contrast figure that linearity, quafric curve play up, cubic curve play up of word when larger; Fig. 3 is the part enlarged drawing of Fig. 2, and along with the rising of curve order, the acutance at word edge is more obvious as seen, and it is more clear to show.Fig. 4 is the word effect contrast figure that linearity, quafric curve are played up, cubic curve is played up hour, in the situation that word is less, it is full that the non-linear effect of playing up rear actual displayed is not so good as the linear word of playing up on the contrary, and incompleteness has even appearred in some stroke after cubic curve is played up.Therefore, judge the aberration size of the foreground of current display text and background colour, the size of current display text, meet the gray-scale value of the just modification bitmap of certain condition, word edge is carried out to non-linear transition.
Refer to Fig. 5, the embodiment of the present invention also provides a kind of generating apparatus of word, and described device comprises:
Non-linear excessive unit 501, while surpassing for be less than the size of an aberration higher limit setting in advance or current display text at the foreground of current display text and the aberration of background colour the font size lower limit setting in advance, call the bitmap of current display text, the gray-scale value of revising bitmap is non-linear excessive so that word edge is carried out.
In one embodiment of the invention, this non-linear excessive unit comprises:
Revise bitmap gray-scale value module, for the gray-scale value x of bitmap is revised as to x, be multiplied by more than one permeability coefficient y;
Described permeability coefficient y=mx, wherein m ∈ [0,1].
In one embodiment of the invention, described modification bitmap gray-scale value module, when the size that is less than an aberration higher limit setting in advance and is greater than an aberration higher limit setting in advance or described current display text specifically for the aberration of the foreground at described current display text and background colour is greater than the font size lower limit setting in advance and is less than a font size higher limit setting in advance, the gray-scale value x in bitmap is revised as to x and is multiplied by a permeability coefficient y.
In one embodiment of the invention, described modification bitmap gray-scale value module, when the size that is less than an aberration lower limit setting in advance or described current display text specifically for the aberration of the foreground at described current display text and background colour is greater than the font size higher limit setting in advance, the gray-scale value x in bitmap is revised as to x and is multiplied by two permeability coefficient y.
Word generation unit 502, stores and shows for amended bitmap is regenerated to word.
Detail schema in device is described in preceding method, does not repeat them here.
The embodiment of the present invention also provides a kind of application terminal, and described application terminal comprises above-mentioned device.
This application terminal is specially the application terminal that Android system is housed, as mobile phone, computer, notebook, televisor of Android system etc. are housed.Said apparatus is particularly useful for being contained in the equipment that screen PPI is less, such as intelligent TV set, can adapt to the environment of application program, reaches good display effect.
Generation method, device and the application terminal of word of the present invention, gray-scale value by modification bitmap is non-linear excessive so that word edge is carried out, amended bitmap is regenerated to word to be stored and shows, can increase the transition speed at word edge, improve the acutance of word, the environment that can adapt to application program, reaches good display effect.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, all any modifications of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. a generation method for word, is characterized in that, described method comprises:
When the size that is less than an aberration higher limit setting in advance or current display text at the foreground of current display text and the aberration of background colour is greater than the font size lower limit setting in advance, call the bitmap of current display text, the gray-scale value of revising bitmap is non-linear excessive so that word edge is carried out;
Amended bitmap is regenerated to word to be stored and shows.
2. the method for claim 1, is characterized in that, the step of the gray-scale value of described modification bitmap comprises:
Gray-scale value x in bitmap is revised as to x and is multiplied by more than one permeability coefficient y;
Described permeability coefficient y=mx, wherein m ∈ [0,1].
3. method as claimed in claim 2, it is characterized in that, when the size that is less than an aberration higher limit setting in advance and is greater than an aberration higher limit setting in advance or described current display text at the foreground of described current display text and the aberration of background colour is greater than the font size lower limit setting in advance and is less than a font size higher limit setting in advance, describedly gray-scale value x in bitmap is revised as to step that x is multiplied by more than one permeability coefficient y is specially and the gray-scale value x in bitmap is revised as to x is multiplied by a permeability coefficient y.
4. method as claimed in claim 2, it is characterized in that, when the size that is less than an aberration lower limit setting in advance or described current display text at the foreground of described current display text and the aberration of background colour is greater than the font size higher limit setting in advance, describedly gray-scale value x in bitmap is revised as to step that x is multiplied by more than one permeability coefficient y is specially and the gray-scale value x in bitmap is revised as to x is multiplied by two permeability coefficient y.
5. the method as described in claim 2 or 3 or 4, is characterized in that, described m is specially 1/255.
6. a generating apparatus for word, is characterized in that, described device comprises:
Non-linear excessive unit, while surpassing for be less than the size of an aberration higher limit setting in advance or current display text at the foreground of current display text and the aberration of background colour the font size lower limit setting in advance, call the bitmap of current display text, the gray-scale value of revising bitmap is non-linear excessive so that word edge is carried out;
Word generation unit, stores and shows for amended bitmap is regenerated to word.
7. device as claimed in claim 6, is characterized in that, described non-linear excessive unit comprises:
Revise bitmap gray-scale value module, for the gray-scale value x of bitmap is revised as to x, be multiplied by more than one permeability coefficient y;
Described permeability coefficient y=mx, wherein m ∈ [0,1].
8. device as claimed in claim 7, it is characterized in that, described modification bitmap gray-scale value module, when the size that is less than an aberration higher limit setting in advance and is greater than an aberration higher limit setting in advance or described current display text specifically for the aberration of the foreground at described current display text and background colour is greater than the font size lower limit setting in advance and is less than a font size higher limit setting in advance, the gray-scale value x in bitmap is revised as to x and is multiplied by a permeability coefficient y.
9. device as claimed in claim 7, it is characterized in that, described modification bitmap gray-scale value module, when the size that is less than an aberration lower limit setting in advance or described current display text specifically for the aberration of the foreground at described current display text and background colour is greater than the font size higher limit setting in advance, the gray-scale value x in bitmap is revised as to x and is multiplied by two permeability coefficient y.
10. an application terminal, is characterized in that, described application terminal comprises the device described in any one in requirement 6 to 9.
CN201310477450.5A 2013-10-12 2013-10-12 Character generating method and device and application terminal Expired - Fee Related CN103544931B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310477450.5A CN103544931B (en) 2013-10-12 2013-10-12 Character generating method and device and application terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310477450.5A CN103544931B (en) 2013-10-12 2013-10-12 Character generating method and device and application terminal

Publications (2)

Publication Number Publication Date
CN103544931A true CN103544931A (en) 2014-01-29
CN103544931B CN103544931B (en) 2017-04-19

Family

ID=49968331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310477450.5A Expired - Fee Related CN103544931B (en) 2013-10-12 2013-10-12 Character generating method and device and application terminal

Country Status (1)

Country Link
CN (1) CN103544931B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912321A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Word color setting method and device
CN111596998A (en) * 2020-05-13 2020-08-28 青岛海信移动通信技术股份有限公司 Page processing method of ink screen and terminal

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03103894A (en) * 1989-09-19 1991-04-30 Fujitsu Ltd Half tone font generating system
JP2004226679A (en) * 2003-01-23 2004-08-12 Fujitsu Ltd Character display method and system
US20060050974A1 (en) * 2004-09-08 2006-03-09 Canon Kabushiki Kaisha Image encoding apparatus and method, computer program, and computer-readable storage medium
CN1812475A (en) * 2006-01-06 2006-08-02 友达光电股份有限公司 Image sharpening method and apparatus
CN1910615A (en) * 2004-01-09 2007-02-07 波音公司 System and methods for comparing images with different contrast levels

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03103894A (en) * 1989-09-19 1991-04-30 Fujitsu Ltd Half tone font generating system
JP2004226679A (en) * 2003-01-23 2004-08-12 Fujitsu Ltd Character display method and system
CN1910615A (en) * 2004-01-09 2007-02-07 波音公司 System and methods for comparing images with different contrast levels
US20060050974A1 (en) * 2004-09-08 2006-03-09 Canon Kabushiki Kaisha Image encoding apparatus and method, computer program, and computer-readable storage medium
CN1812475A (en) * 2006-01-06 2006-08-02 友达光电股份有限公司 Image sharpening method and apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105912321A (en) * 2016-04-01 2016-08-31 乐视控股(北京)有限公司 Word color setting method and device
CN111596998A (en) * 2020-05-13 2020-08-28 青岛海信移动通信技术股份有限公司 Page processing method of ink screen and terminal

Also Published As

Publication number Publication date
CN103544931B (en) 2017-04-19

Similar Documents

Publication Publication Date Title
US9727960B2 (en) Image processing method and apparatus
US20210287631A1 (en) Video Processing Method, Electronic Device and Storage Medium
CN107179889B (en) Interface color adjusting method, webpage color adjusting method and webpage color adjusting device
CN103019769B (en) A kind of software start interface control method and mobile terminal
CN105138317A (en) Window display processing method and device applied to terminal equipment
US20150110419A1 (en) Method and device for image processing
CN108446089B (en) Data display method and device and display
CN105335445A (en) Layout display method and device
CN105578184A (en) Key-frame animation generation apparatus and method
CN111090384B (en) Soft keyboard display method and device
CN104658030A (en) Secondary image mixing method and apparatus
US9311688B1 (en) Rendering pipeline for color electrophoretic displays
US10923072B2 (en) Method and device for displaying non-standard resolution data
CN105701165A (en) Browser mode switching method and switching device
CN109858421B (en) Android platform handwriting playback method and device based on scalable vector graphics
CN105761683A (en) Image processing method for electrophoresis display
CN103544931A (en) Character generating method and device and application terminal
CN108989872B (en) Android television background fast switching method, framework, server and storage medium
CN110880164A (en) Image processing method, device and equipment and computer storage medium
CN105719335A (en) Map image rendering method and device, and vehicle-mounted terminal
CN104765599A (en) Terminal
CN110634174A (en) Expression animation transition method and system and intelligent terminal
CN112527424A (en) Control method and device for popup window
CN110688037A (en) Control display method, storage medium and mobile terminal
CN115131247A (en) Image processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20170419

CF01 Termination of patent right due to non-payment of annual fee