CN103544931B - Character generating method and device and application terminal - Google Patents
Character generating method and device and application terminal Download PDFInfo
- Publication number
- CN103544931B CN103544931B CN201310477450.5A CN201310477450A CN103544931B CN 103544931 B CN103544931 B CN 103544931B CN 201310477450 A CN201310477450 A CN 201310477450A CN 103544931 B CN103544931 B CN 103544931B
- Authority
- CN
- China
- Prior art keywords
- word
- bitmap
- gray value
- aberration
- currently displaying
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000004075 alteration Effects 0.000 claims abstract description 36
- 230000035699 permeability Effects 0.000 claims description 19
- 230000004048 modification Effects 0.000 claims description 12
- 238000012986 modification Methods 0.000 claims description 12
- 230000008859 change Effects 0.000 claims description 7
- 230000008901 benefit Effects 0.000 claims description 3
- 230000000149 penetrating effect Effects 0.000 claims 1
- 230000000694 effects Effects 0.000 abstract description 20
- 230000007704 transition Effects 0.000 abstract description 7
- 230000001172 regenerating effect Effects 0.000 abstract 1
- 238000009877 rendering Methods 0.000 description 9
- 230000008569 process Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 5
- 230000003044 adaptive effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 239000000686 essence Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 238000009738 saturating Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
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
Technical field
The invention belongs to system literal field, more particularly to a kind of generation method of word, device and application terminal.
Background technology
Under various circumstances display effect has larger difference to android system word, its readability depend on hardware,
The factors such as software, word size, rendering intent, text color, background color.But current android system word shows
Showing can only use same style, once modification, on the application program of all use system literals impact can be all produced.Therefore it is existing
There is word in android system such as text color and during little background color contrast in some environments, word seems
Can be relatively elaborate, display effect is poor.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of generation method of word, it is intended in solving android system
Word seems in some environments relatively elaborate, the poor problem of display effect.
The embodiment of the present invention is achieved in that a kind of generation method of word, and methods described includes:
An aberration higher limit for pre-setting is less than in the foreground of currently displaying word and the aberration of background colour or work as
When the front size for showing word is more than the font size lower limit for pre-setting, then the bitmap of currently displaying word is called, change bitmap
Gray value with by word edge carry out it is non-linear excessively;
Amended bitmap is regenerated into word to store and show.
The embodiment of the present invention additionally provides a kind of generating means of word, and described device includes:
Non-linear excessive unit, for setting in advance less than one in the aberration of the foreground of currently displaying word and background colour
When the aberration higher limit put or the size of currently displaying word exceed the font size lower limit for pre-setting, then currently displaying text is called
The bitmap of word, the gray value for changing bitmap is non-linear excessive so that word edge to be carried out;
Word signal generating unit, stores and shows for amended bitmap to be regenerated into word.
The embodiment of the present invention additionally provides a kind of application terminal, and the application terminal includes described device.
Compared with prior art, beneficial effect is the embodiment of the present invention:By changing the gray value of bitmap with by word
Edge carry out it is non-linear excessively amended bitmap is regenerated into word and is stored and is shown, word edge can be increased
Transition speed, improves the acutance of word, is suitable for the environment of application program, reaches preferable display effect.
Description of the drawings
Fig. 1 is the flow chart of the generation method of word provided in an embodiment of the present invention;
Fig. 2 is an effect contrast figure of application scenarios example provided in an embodiment of the present invention;
Fig. 3 is the enlarged drawing of the part of Fig. 2 provided in an embodiment of the present invention;
Fig. 4 is another effect contrast figure of application scenarios example provided in an embodiment of the present invention;
Fig. 5 is the module frame chart of the generating means of word provided in an embodiment of the present invention.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only to explain the present invention, and
It is not used in the restriction present invention.
Embodiment provided in an embodiment of the present invention is as follows:
Fig. 1 is referred to, a kind of generation method of word is embodiments provided, methods described includes:
Step S101, in the foreground of currently displaying word and the aberration of background colour less than on an aberration for pre-setting
When the size of limit value or currently displaying word is more than the font size lower limit for pre-setting, then the bitmap of currently displaying word is called,
The gray value of modification bitmap is non-linear excessive so that word edge to be carried out.
In embodiments of the present invention, also include in step S101:In the foreground and the color of background colour of currently displaying word
Difference is less than the font size lower limit for pre-setting not less than the size of the aberration higher limit for pre-setting or currently displaying word
When, then the currently displaying word of default system, does not deal with.
In one embodiment of the invention, the step of gray value of the modification bitmap includes:
Gray value x in bitmap is revised as into x and is multiplied by more than one permeability coefficient y;
The permeability coefficient y=mx, wherein m ∈ [0,1].
In one embodiment of the invention, it is less than one in the foreground of the currently displaying word and the aberration of background colour
The size of the individual aberration higher limit for pre-setting and the aberration lower limit that pre-sets more than one or the currently displaying word
During the font size higher limit pre-set more than the font size lower limit for pre-setting and less than, the gray value by bitmap
X be revised as the step of x is multiplied by more than one permeability coefficient y be specially by the gray value x in bitmap be revised as x be multiplied by one lead to
Saturating coefficient y.
In one embodiment of the invention, it is less than one in the foreground of the currently displaying word and the aberration of background colour
It is described when the size of the individual aberration lower limit for pre-setting or the currently displaying word is more than the font size higher limit for pre-setting
Gray value x in bitmap is revised as to be specially the gray value x in bitmap the step of x is multiplied by more than one permeability coefficient y
It is revised as x and is multiplied by two permeability coefficient y.
In a preferred embodiment of the invention, the preferred values of the m are 1/255.
In one embodiment of the invention, the gray value for bitmap being changed under certain scene can just obtain preferable vision
Effect, such as word are larger, and prospect background aberration is different little etc..Under the less environment of word, the effect of process is not on the contrary not as
Process, but concrete what environment, android system itself is to be difficult to judge, application program under what scene, application program
Itself is very clear, therefore the method that the embodiment of the present invention is adopted is that application program actively applies for needs according to current scene
Which type of word rendering intent.
In one embodiment of the invention, it is further comprising the steps of before step S101:
Application program judges the aberration magnitude range of the foreground of currently displaying word and background colour;
Application program judges the magnitude range of currently displaying word.
The just needs modification for only meeting step S101 condition is determined by judging aberration size and word magnitude range
The gray value of bitmap, is unsatisfactory for the gray value that need not then change bitmap of condition, so as to the varying environment in adaptive system, not
Preferable display effect is reached under same environment.
In embodiments of the present invention, can be specially the step of calling the bitmap of currently displaying word in step S101:Should
Generated after the interface function of word with routine call Skia, by calling FreeType functions the bitmap of word is got.
Step S102, regenerates amended bitmap word and stores and show.
The embodiment of the present invention is non-linear excessive so that word edge to be carried out by changing the gray value of bitmap, will be amended
Bitmap regenerates word and stores and show, can increase the transition speed at word edge, improves the acutance of word, is suitable for
The environment of application program, reaches preferable display effect.
Application scenarios example:
Technical scheme provided in an embodiment of the present invention can be applicable in android system, under giving tacit consent in android system
Word product process is co-operated by increase income storehouse Skia and FreeType and completed, and FreeType can load literal pool example
Such as * .TTF files, vectorial characters bitmap is generated.The word of generation, edge are rendered under android system acquiescence by FreeType
There is the gradual change from fully transparent to impermeable, this is excessively linear.
Skia is processed bitmap by interface function according to method provided in an embodiment of the present invention, is sent into video memory and is shown
Show, can by word edge it is linear be excessively revised as it is non-linear excessively, so as to increase edge transition speed, improve the sharp of word
Degree.
Word edge transition effect is with gray value embodiment in the bitmap that FreeType is generated.Gray value is multiplied by into one
Individual permeability coefficient, can just reach the effect of nonlinear change.For example:
Conic section is rendered:X=x* (x/255)
Cubic curve is rendered:X=x* (x/255) * (x/255)
After Skia loading FreeType bitmaps, above operation is carried out to internal storage data, can just reach the non-thread of n curve
Property change so that improve acutance effect.
But the lifting of this acutance needs the visual effect that could have been obtained under certain scene, such as word is larger, front
Scape background colour difference is little etc..Under the less environment of word, the effect of process is not on the contrary not as processing, but concrete what environment,
Android system itself is to be difficult to judge, under what scene, application program is very clear itself application program, therefore
The method that the embodiment of the present invention is adopted is using according to current scene, actively which type of word rendering intent application needs.
A system property variable render_mode can be created when android system starts, for representing the word side of rendering
Method, with different values different rendering intents are represented:Such as 0 represents the rendering intent of system default, that is, does not process;1
Represent conic section to render;2 represent cubic curve renders.Certainly these methods can be other algorithms, be not limited to listed above
's.Default value is 0.
When applying when needing to change word, the corresponding value of write to attribute variable render_mode, application system is provided
Different word rendering intents.Such as, current character shows foreground and background colour are very close to render_mode is arranged
For 2, rendered using cubic curve, can bigger raising word acutance, word is seen apparent;Or in current page word size
Deng when, render_mode is set to into 1, can to a certain degree improve word acutance;During current page word very little, by render_
Mode is set to 0, is arranged using system default and is not processed.In the different scenes of same application, it is also possible to switch over text
Word display methods.Such as from the scene of a foreground background colour difference very little, it is switched to when differing greatly scene, can be by
Render_mode is set to 1 by 2, and with the less algorithm of sharpness word generation is carried out.
After the interface function that application call Skia generates word, FreeType functions can be called to get word
Bitmap, at this moment judges the value of render_mode, different using different rendering intents according to value, and internal storage data is carried out
Corresponding process.When such as render_mode values are 1, x=x* (x/255), after being disposed, by the reduction of render_mode values
For 0, afterwards the character bitmap after process can be generated text importing out by Skia.When next word is generated, equally can read
Render_mode values.If 0, then will not be processed.So, after current scene word is generated, other are not interfered with
Scene or the word of application.
Its application design sketch such as Fig. 2, Fig. 3 and Fig. 4, Fig. 2 for word it is larger when linear, conic section render, three times
The effect contrast figure that curve is rendered;Fig. 3 for Fig. 2 magnified partial view, it is seen that with the rising of curve order, word edge it is sharp
Degree is more obvious, and it is more clear to show.Linear, conic sections of the Fig. 4 for word when less is rendered, the Contrast on effect that cubic curve is rendered
Figure, in the case of word is less, there be the effect of actual displayed on the contrary be not as full as the word for linearly rendering after non-thread sexploitation
A little strokes even occur in that incompleteness after cubic curve is rendered.Therefore, be to the foreground of currently displaying word and background colour
Aberration size, the size of currently displaying word judged, the gray value for just changing bitmap of certain condition is met, by word side
Edge carries out non-linear transition.
Fig. 5 is referred to, the embodiment of the present invention additionally provides a kind of generating means of word, and described device includes:
Non-linear excessive unit 501, for pre- less than one in the aberration of the foreground of currently displaying word and background colour
When the aberration higher limit for first arranging or the size of currently displaying word exceed the font size lower limit for pre-setting, then call current aobvious
Show the bitmap of word, the gray value for changing bitmap is non-linear excessive so that word edge to be carried out.
In one embodiment of the invention, the non-linear excessive unit includes:
Modification bitmap gray value module, for the gray value x in bitmap to be revised as into x more than one permeability coefficient is multiplied by
y;
The permeability coefficient y=mx, wherein m ∈ [0,1].
In one embodiment of the invention, the modification bitmap gray value module, specifically for described currently displaying
The foreground of word and the aberration of background colour are less than an aberration higher limit for pre-setting and more than a color for pre-setting
The size of difference lower limit or the currently displaying word pre-sets more than the font size lower limit that pre-sets and less than one
During font size higher limit, the gray value x in bitmap is revised as into x and is multiplied by a permeability coefficient y.
In one embodiment of the invention, the modification bitmap gray value module, specifically for described currently displaying
The foreground of word and the aberration of background colour are big less than an aberration lower limit for pre-setting or the currently displaying word
It is little more than the font size higher limit for pre-setting when, the gray value x in bitmap is revised as into x and is multiplied by two permeability coefficient y.
Word signal generating unit 502, stores and shows for amended bitmap to be regenerated into word.
Detail schema in device described in preceding method, will not be described here.
The embodiment of the present invention additionally provides a kind of application terminal, and the application terminal includes above-mentioned device.
The application terminal specially application terminal equipped with android system, the such as hand equipped with android system is mechanical, electrical
Brain, notebook, television set etc..Said apparatus are particularly suited for being mounted in the less equipment of screen PPI, such as intelligent TV set,
The environment of application program is suitable for, preferable display effect is reached.
The generation method of word of the present invention, device and application terminal, by changing the gray value of bitmap with by word side
Edge carry out it is non-linear excessively amended bitmap is regenerated into word and is stored and is shown, the mistake at word edge can be increased
Speed is crossed, the acutance of word is improved, the environment of application program is suitable for, preferable display effect is reached.
Presently preferred embodiments of the present invention is the foregoing is only, not to limit the present invention, all essences in the present invention
Any modification, equivalent and improvement made within god and principle etc., should be included within the scope of the present invention.
Claims (8)
1. a kind of generation method of word, it is characterised in that methods described includes:
In the foreground of currently displaying word and the aberration of background colour less than an aberration higher limit for pre-setting or current aobvious
When showing the size of word more than the font size lower limit for pre-setting, then the bitmap of currently displaying word is called, change the ash of bitmap
Angle value is non-linear excessive so that word edge to be carried out;
Amended bitmap is regenerated into word to store and show;
The step of gray value of the modification bitmap, includes:By the gray value x in bitmap be revised as x be multiplied by it is more than one penetrating
Coefficient y;The permeability coefficient y=mx, wherein m ∈ [0,1].
2. the method for claim 1, it is characterised in that in the foreground and the color of background colour of the currently displaying word
Differ from the aberration lower limit or the currently displaying text pre-set less than an aberration higher limit for pre-setting and more than
The size of word more than the font size lower limit for pre-setting and pre-set less than one font size higher limit when, it is described by bitmap
Gray value x be revised as being specially the step of x is multiplied by more than one permeability coefficient y and the gray value x in bitmap is revised as into x takes advantage of
With a permeability coefficient y.
3. the method for claim 1, it is characterised in that in the foreground and the color of background colour of the currently displaying word
Difference is more than the font size upper limit for pre-setting less than the size of an aberration lower limit for pre-setting or the currently displaying word
During value, the gray value x by bitmap is revised as being specially in bitmap the step of x is multiplied by more than one permeability coefficient y
Gray value x be revised as x and be multiplied by two permeability coefficient y.
4. the method as described in claim 1 or 2 or 3, it is characterised in that the m is specially 1/255.
5. a kind of generating means of word, it is characterised in that described device includes:
Non-linear excessive unit, for what is pre-set less than one in the aberration of the foreground of currently displaying word and background colour
When the size of aberration higher limit or currently displaying word exceedes the font size lower limit for pre-setting, then currently displaying word is called
Bitmap, the gray value for changing bitmap is non-linear excessive so that word edge to be carried out;
Word signal generating unit, stores and shows for amended bitmap to be regenerated into word;
The non-linear excessive unit includes:Modification bitmap gray value module, takes advantage of for the gray value x in bitmap to be revised as into x
With more than one permeability coefficient y;The permeability coefficient y=mx, wherein m ∈ [0,1].
6. device as claimed in claim 5, it is characterised in that the modification bitmap gray value module, specifically for described
The foreground of currently displaying word and the aberration of background colour are less than an aberration higher limit for pre-setting and advance more than one
The size of the aberration lower limit of setting or the currently displaying word is more than the font size lower limit for pre-setting and pre- less than one
During the font size higher limit for first arranging, the gray value x in bitmap is revised as into x and is multiplied by a permeability coefficient y.
7. device as claimed in claim 5, it is characterised in that the modification bitmap gray value module, specifically for described
The foreground of currently displaying word and the aberration of background colour are less than an aberration lower limit for pre-setting or described currently displaying
When the size of word is more than the font size higher limit for pre-setting, the gray value x in bitmap is revised as into x and is multiplied by two permeability coefficients
y。
8. a kind of application terminal, it is characterised in that the application terminal includes requiring the device any one of 5 to 7.
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 CN103544931A (en) | 2014-01-29 |
CN103544931B true 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) |
Families Citing this family (2)
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 |
Family Cites Families (5)
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 |
CN100573583C (en) * | 2004-01-09 | 2009-12-23 | 波音公司 | Be used for relatively having the system and method for other image of different contrast level |
JP4393319B2 (en) * | 2004-09-08 | 2010-01-06 | キヤノン株式会社 | Image encoding apparatus and method, computer program, and computer-readable storage medium |
CN100426831C (en) * | 2006-01-06 | 2008-10-15 | 友达光电股份有限公司 | Image sharpening method and apparatus |
-
2013
- 2013-10-12 CN CN201310477450.5A patent/CN103544931B/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
CN103544931A (en) | 2014-01-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106484396B (en) | Night mode switching method and device and terminal equipment | |
CN105847940B (en) | A kind of barrage display control method and device | |
US9558542B2 (en) | Method and device for image processing | |
US10152122B2 (en) | Foveated rendering | |
US20140189516A1 (en) | Video preview display method and terminal device | |
CN104765600A (en) | Page processing method | |
CN105005426A (en) | Screenshot method and system for touch screen terminal, and data sharing method and system for touch screen terminal | |
CN103412643B (en) | Terminal and its method for remote control | |
CN105138317A (en) | Window display processing method and device applied to terminal equipment | |
CN106023904A (en) | Display control method and device based on electronic ink screen | |
US11074849B2 (en) | Display method, display device, and display | |
CN106681586A (en) | Placement position adjusting method and device | |
CN104658030A (en) | Secondary image mixing method and apparatus | |
CN109343925B (en) | User interface self-adaptive adjusting method and device and industrial control display terminal | |
US10418000B2 (en) | Method and apparatus for screen capture on a display device | |
US10923072B2 (en) | Method and device for displaying non-standard resolution data | |
CN103544931B (en) | Character generating method and device and application terminal | |
CN105468617A (en) | Method and device for regulating webpage content color | |
CN107122104B (en) | Data display method and device | |
CN111090384A (en) | Soft keyboard display method and device | |
CN106325800A (en) | Method, system and mobile terminal for controlling screen resolution | |
CN104765599A (en) | Terminal | |
US11361414B2 (en) | Method and system for enhancing image, and computer readable storage medium | |
CN105160697B (en) | A kind of information processing method and electronic equipment | |
CN112527424A (en) | Control method and device for popup window |
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 |