CN109978972A - A kind of method and device of copy editor in picture - Google Patents

A kind of method and device of copy editor in picture Download PDF

Info

Publication number
CN109978972A
CN109978972A CN201910210972.6A CN201910210972A CN109978972A CN 109978972 A CN109978972 A CN 109978972A CN 201910210972 A CN201910210972 A CN 201910210972A CN 109978972 A CN109978972 A CN 109978972A
Authority
CN
China
Prior art keywords
string
target
character
style
current
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
CN201910210972.6A
Other languages
Chinese (zh)
Other versions
CN109978972B (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.)
Zhengzhou Apas Technology Co ltd
Original Assignee
Zhuhai Tianyan Technology 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 Zhuhai Tianyan Technology Co Ltd filed Critical Zhuhai Tianyan Technology Co Ltd
Priority to CN201910210972.6A priority Critical patent/CN109978972B/en
Publication of CN109978972A publication Critical patent/CN109978972A/en
Application granted granted Critical
Publication of CN109978972B publication Critical patent/CN109978972B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Abstract

The embodiment of the present application provides the method for the copy editor in picture a kind of, belongs to picture editor field.The described method includes: loading set target template in candidate picture;It is chosen in real time from preset style library at random, determines that the corresponding text style of current string in the target template, the current string are the character composition for extracting third party's input method and inputting in real time;Current string is rendered according to the text style, forms target string;The target string is shown line by line in the target template.Make picture to be edited when adding text, it is shown automatically with target character of a variety of random patterns to input, user is without carrying out operation selection to text style manually, the typesetting effect of more text styles can be fast implemented, it enriches by the display information of editing picture, the operating efficiency for improving user meets the individual demand of user.

Description

A kind of method and device of copy editor in picture
Technical field
This application involves edit methods and device that text is embedded in field of computer technology more particularly to picture.
Background technique
With the fast development of network technology, the type and function of network application are more and more abundant.By taking camera applications as an example, Camera applications can satisfy the entertainment requirements such as take pictures, record a video of user.In addition, current camera also supports U.S. face, textures, windy The plurality of picture edit operation such as lattice effect is only capable of carrying out typesetting with text of the fixed format to input when adding word content Operation, and while editing, needs constantly adjustment pattern, style sheet one when causing text composition to operate also excessively cumbersome.
Summary of the invention
The purpose of the embodiment of the present application is to provide the method and device of the copy editor in picture a kind of, to realize that user is fast Speed carries out the demand of copy editor to resulting picture of taking pictures.
In order to solve the above technical problems, the embodiment of the present application is achieved in that
According to the embodiment of the present application in a first aspect, provide the method for the copy editor in picture a kind of, it is applied to terminal Equipment, which comprises
Set target template is loaded in candidate picture;
It is chosen in real time from preset style library at random, determines the corresponding text of current string in the target template Printed words formula;The current string is the character composition for extracting third party's input method and inputting in real time;
Current string is rendered according to the text style, forms target string;
The target string is shown line by line in the target template.In one embodiment of the application, the side Method further include:
The text style is defined by the display properties of character respectively, and the display properties includes at least: color, word Body, font size, whether shadow containing bottom, whether containing underscore, whether tilt;
After the display properties is packaged respectively, it is stored in the form of json in preset style library.
In one embodiment of the application, the method also includes:
Detect the corresponding time interval generated when third party's input method input;
The time interval is divided;When time interval be greater than set duration when, separately from the style library with Machine selected text pattern carries out real-time rendering to the current string;
When time interval is less than set duration, wash with watercolours is carried out to the current string according to the text style of current application Dye.
In one embodiment of the application, the method also includes:
The current string is calculated by single character, respectively to the single character of the current string from the pattern Text style is respectively randomly selected in library carries out real-time rendering.
It is described when being rendered according to the text style to current string in one embodiment of the application, further includes:
The text style is called, the corresponding each display of the text style is loaded to the current string respectively and is belonged to Property;
Each character in the current string is rendered respectively by the display properties, forms the target string.
It is described when being shown line by line to the target string in one embodiment of the application, further includes:
Obtain the target string corresponding size and/or character quantity in real time;
According in the target template display area and the corresponding size of the target string to the target Character string zooms in and out and enters a new line, and the target string inputted is made to fill the display area in the target template.
It is described when the target string is zoomed in and out and entered a new line in one embodiment of the application, further includes:
Display area and the corresponding character quantity of the target string inputted in the target template are extracted, when the word It accords with quantity and is greater than the corresponding character quantity accommodated in the display area, then enter a new line to the corresponding font size of the target string And diminution;
The correspondingly-sized of display area and the corresponding size of the target string in the target template are extracted, when described When the correspondingly-sized of display area is less than the target string corresponding size, then the display is pressed to the target string The correspondingly-sized in region is entered a new line and is reduced.
According to the second aspect of the embodiment of the present application, the device of the copy editor in picture a kind of, described device packet are provided It includes:
Loading module, for loading set target template in candidate picture;
Module is chosen, for being chosen in real time from preset style library at random, is determined current in the target template The corresponding text style of character string;The current string is the character composition for extracting third party's input method and inputting in real time;
Rendering module forms target string for rendering according to the text style to current string;
Display module, for being shown line by line in the target template to the target string.
In one embodiment of the application, the text style is defined by the display properties of character respectively, and the display belongs to Property include at least: color, font, font size, whether shadow containing bottom, whether containing underscore, whether tilt;
After the display properties is packaged respectively, it is stored in style library in the form of json.
In one embodiment of the application, described device further include:
Detection unit, the corresponding time interval generated when for detecting third party's input method input;
String processing unit, for being divided to the time interval;When time interval is greater than set duration, separately Row randomly selects text style from the style library and carries out real-time rendering to the current string;
When time interval is less than set duration, wash with watercolours is carried out to the current string according to the text style of current application Dye.
In one embodiment of the application, described device further include:
Monocase processing unit is calculated for the current string by single character, respectively to the current string Single character respectively randomly selected from the style library text style carry out real-time rendering.
In one embodiment of the application, the rendering module is specifically included,
Pattern call unit loads the text sample to the current string for calling the text style respectively The corresponding each display properties of formula;
Character rendering unit is formed for rendering each character in the current string respectively by the display properties The target string.
In one embodiment of the application, the display module is specifically included,
Acquiring unit, for obtaining the target string corresponding size and/or character quantity in real time;
Adjustment unit, for according in the target template display area and the corresponding size of the target string it is big It is small that the target string is zoomed in and out and entered a new line, fill the target string inputted in the target template Display area.
In one embodiment of the application, the adjustment unit is specifically included,
First reducing unit, it is corresponding for extracting display area and the target string inputted in the target template Character quantity, when the character quantity is greater than the corresponding character quantity accommodated in the display area, then to the target string Corresponding font size is entered a new line and is reduced;
Second reducing unit, for extracting the correspondingly-sized of display area and the target string in the target template Corresponding size, when the correspondingly-sized of display area size corresponding less than the target string, then to the mesh Mark character string is entered a new line and is reduced by the correspondingly-sized of the display area.
As can be seen from the technical scheme provided by the above embodiments of the present application, the embodiment of the present application is carrying out text input to picture When, set target template is loaded in candidate picture;It is chosen in real time from preset style library at random, determines the mesh The corresponding text style of current string in template is marked, the current string is the word for extracting third party's input method and inputting in real time Symbol composition;Current string is rendered according to the text style, forms target string;It is right in the target template The target string is shown line by line.The embodiment of the present application can make picture to be edited when adding text, with a variety of Random pattern is shown the target character of input automatically, and user is without carrying out operation selection to text style manually The typesetting effect for fast implementing more text styles enriches by the display information of editing picture, improves the operating efficiency of user, Meet the individual demand of user.
Detailed description of the invention
In order to illustrate the technical solutions in the embodiments of the present application or in the prior art more clearly, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this The some embodiments recorded in specification, for those of ordinary skill in the art, before not making the creative labor property It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the flow chart of the method for the copy editor in the picture of one embodiment of the application;
Fig. 2 is editor's example schematic of the method for the copy editor in the picture of one embodiment of the application;
Fig. 3 is that example when continuing editor of the method for the copy editor in the picture of one embodiment of the application is illustrated Figure;
Fig. 4 is the example signal when editor of the method for the copy editor in the picture of one embodiment of the application completes Figure;
Fig. 5 is editor's example schematic of the method for the copy editor in the picture of another embodiment of the application;
Fig. 6 is the example signal when editor of the method for the copy editor in the picture of another embodiment of the application completes Figure;
Fig. 7 is the structural schematic diagram that copy editor in the picture of one embodiment of the application corresponds to electronic equipment;
Fig. 8 is the structural schematic diagram of the device of the copy editor in the picture of one embodiment of the application.
Specific embodiment
In order to make those skilled in the art more fully understand the technical solution in this specification, below in conjunction with the application Attached drawing in embodiment, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described reality Applying example is only this specification a part of the embodiment, instead of all the embodiments.The embodiment of base in this manual, ability Domain those of ordinary skill every other embodiment obtained without making creative work, all should belong to this theory The range of bright book protection.
The embodiment of the present application provides the method and device of the copy editor in picture a kind of.
The method of the copy editor in a kind of picture provided by the embodiments of the present application is introduced first below.
It should be noted that method provided by the embodiments of the present application is suitable for terminal device, in practical applications, the terminal Equipment may include: smart phone, tablet computer, smartwatch, notebook/desktop computer etc., and the embodiment of the present application is to this It is not construed as limiting.
Fig. 1 is the flow chart of the method for the copy editor in the picture of one embodiment of the application, as shown in Figure 1, should Method may comprise steps of:
In a step 101, set target template is loaded in candidate picture.
In the embodiment of the present application, one or more image can be previously stored in terminal device, at this point, optional at one Embodiment in, above-mentioned steps 101 may include:
Step 101: set target template is loaded in candidate picture.
In the application embodiment, when treating editing picture progress copy editor, a figure is set above picture to be edited Layer calls set input framework as target template in the figure layer, and inputting framework can be various shape, such as rectangle, fillet Rectangle, circle etc., the interior display area including editable character of input frame body, the character of subsequent third side's input method input are mentioned After taking, filling can make the target character for showing that third party's input method inputs in real time in target template into display area in real time String.
After having loaded target string in target template, it is subsequent by figure layer where the target template in the upper of picture to be edited Side is shown, and can show the effect that copy editor is carried out in picture to be edited.
Step 102: being chosen in real time from preset style library at random, determine current string in the target template Corresponding text style, the current string are the character composition for extracting third party's input method and inputting in real time.
The style library for storing kinds of words pattern is prestored in the terminal, and the text style illustrates input character Various corresponding patterns, each text style carry out structured storage in style library.Text style presses the display properties of character respectively Be defined, the display properties includes at least: color, font, font size, whether shadow containing bottom, whether containing underscore, whether tilt Deng corresponding attribute, the appearance style of character is illustrated, when user being made to add character progress text composition in picture to be edited, obtain To that can be display effect that target string shows a variety of patterns, user experience be enriched.
The extract real-time current string from user's third party's input method currently in use, and chosen from style library at random Text style applies current string.
1, for Chinese character coding input method, the display area that the first candidate item is input to target template as current string is extracted In, while being chosen in real time from style library at random, the subsequent text style by selection is applied to the first candidate item, thus with The word attributes such as various colors, font, the font size of Chinese form are shown the first candidate item in target template.
In other embodiments, when the first candidate item is not the character string that user thinks upper screen, user can also extracted During input, the above screen is triggering, using the Chinese character of upper screen as obtaining current string.From in input method extract on The Chinese character of screen, and choose corresponding text style in real time from style library at random, the subsequent Chinese character for making screen is by this Text style is shown in target template.
In another embodiment, to each Chinese individual character in the Chinese character of the first candidate item and/or upper screen respectively as Current string, respectively to the single character of the current string respectively randomly selected from the style library text style into Row real-time rendering calls corresponding text style to be rendered from style library respectively that is, as unit of each Chinese individual character, and It is shown in target template, is all different the displaying pattern of each Chinese individual character, forms the display effect of diversified forms, Improve the visual experience and user experience of user.
2, for English input method, candidate current string is input in real time in the display area of target template, together Shi Suiji is chosen in real time from style library, the subsequent current string being applied to the text style of selection in display area In, to be opened up in target template with word attributes such as the various colorss, font, font size of English form to current string Show.
In other embodiments, the corresponding time interval generated when third party's input method input is detected;
The time interval is divided;When time interval is greater than set duration, show third party's input method at this time Producing pause in input process, a possibility that punctuate, is larger, then text style separately is randomly selected from the style library, The next subordinate sentence inputted again after time interval is rendered using other text styles, makes to render using other text styles Next subordinate sentence be shown in target template;
When time interval is less than set duration, show that third party's input method does not generate pause in input process, makes pauses in reading unpunctuated ancient writings A possibility that it is lower, then continue the current string is rendered according to the text style of current application, current string It keeps text style constant, maintains the consistency of text style.
In another embodiment, current string is calculated by word, i.e., respectively to the current string Word calculates, and text style is respectively randomly selected from the style library, carries out real-time rendering to each word respectively.Tool Body, when detecting that the input of third party's input method is space or punctuate, corresponding text is randomly selected from style library in real time Pattern renders the character string inputted after space or punctuate, makes the character string for being input to target template with word Unit is shown with different literals pattern.
Specifically, when randomly selecting text style in set style library, to each text by the way of Random Maps Pattern is chosen, i.e., marks relationship maps to the section of 0-1 by corresponding serial number each text style in style library.To text When printed words formula is chosen, the random number of a 0-1 is generated using Generating Random Number, and the random number is mapped to a certain Text style, to be chosen at random to the text style in style library.
Step 103: current string being rendered according to the text style, forms target string;
In the present embodiment, the corresponding display properties of character is packaged by text style in the form of json, comprising: color, Font, font size, whether shadow containing bottom, whether containing underscore, whether tilt, whether have bottom shadow, whether overstriking etc.;
Style library is stored in terminal local, and word attribute is configured in a manner of permutation and combination, unites after setting completed One is packaged in the form of json, and is stored in style library.When rendering to current string, the json is called to be solved Analysis, the display properties in json is parsed and is applied to current string, by color defined in json, bottom shadow, word The attributes such as body, font size apply current string, the target string after forming rendering, to provide more abundant Visual effect.
Step 104: the target string being shown line by line in the target template.
The target string after rendering is inserted to the editing area of target template.Due to the size of editing area, Size is fixed, then calling system API to target string and has been input to other character strings of editing area and zooms in and out and change Row, makes target string and has been input to other character strings of editing area to be all shown in target template.
In the present embodiment, specifically:
Obtain the target string corresponding size and/or character quantity in real time;
According in the target template display area and the corresponding size of the target string to the target Character string zooms in and out and enters a new line, and the target string inputted is made to fill the display area in the target template.
When specifically zooming in and out, entering a new line, it can be carried out respectively by the correspondingly-sized of the character quantity and display area inputted Compare, Details as Follows:
Display area and the corresponding character quantity of the target string inputted in the target template are extracted, when the word It accords with quantity and is greater than the corresponding character quantity accommodated in the display area, then calling system API is corresponding to the target string Font size is entered a new line and is reduced, and the target string inputted is made to fill the display area in the target template;
The correspondingly-sized of display area and the corresponding size of the target string in the target template are extracted, when described When the correspondingly-sized of display area is less than the target string corresponding size, then the display is pressed to the target string The correspondingly-sized in region is entered a new line and is reduced, and the target string inputted is made to fill the display in the target template Region.
Display area and the corresponding character quantity of the target string inputted in the target template are extracted, when the word It accords with quantity and is greater than the corresponding character quantity accommodated in the display area, then calling system API is corresponding to the target string Font size amplifies, and the target string inputted is made to fill the display area in the target template;
The correspondingly-sized of display area and the corresponding size of the target string in the target template are extracted, when described When the correspondingly-sized of display area is greater than the target string corresponding size, then the display is pressed to the target string The correspondingly-sized in region amplifies, and the target string inputted is made to fill the display area in the target template.
The target string wherein inputted fills the display area in the target template, specifically:
The filling proportion of display area of the target string inputted in the target template should be less than first Preset ratio is greater than the second preset ratio.
Such as: the filling proportion of display area of the target string that setting has inputted in the target template is small In 80% or be greater than 120%, if the target string inputted not within the scope of preset filling proportion, to institute It states target string and zooms in and out adjustment, until display area of the target string inputted in the target template Meet preset filling proportion.
After having loaded target string in target template, by figure layer where the target template the top of picture to be edited into Row is shown, shows the effect that copy editor is carried out in picture to be edited.Certainly, target string is shown in target template Afterwards, candidate picture can also receive user's triggering again.Specifically, create figure layer where target template above figure layer again, and Other templates are loaded in newly-built figure layer and carry out character string input for user, make to show multiple target characters in candidate picture String, enriches by the display information of editing picture.
In the present embodiment, set target template is loaded in candidate picture;It is carried out from preset style library at random real When choose, determine the corresponding text style of current string in the target template;The current string is to extract third party The character composition that input method inputs in real time;Current string is rendered according to the text style, forms target string; The target string is shown line by line in the target template.The embodiment of the present application can make picture to be edited exist It when adding text, is shown automatically with target character of a variety of random patterns to input, user is not necessarily to manually to text style Operation selection is carried out, the typesetting effect of more text styles can be fast implemented, enriches by the display information of editing picture, improves The operating efficiency of user, meets the individual demand of user.
In another alternative embodiment, when carrying out character input in candidate picture,
Step 201: loading set target template in candidate picture on candidate picture;
In the present embodiment, user carries out copy editor as candidate picture to picture shown in Fig. 2, calls the defeated of hexagon Enter framework as target template,
Step 202: being chosen in real time from preset style library at random, determine current string in the target template Corresponding text style;
Choose corresponding json pattern, the json pattern pair chosen in the present embodiment in real time by the way of generating random number The display properties answered are as follows: font: black matrix, font size: 30pt, color: black, bottom shadow: nothing, underscore: nothing, inclination: nothing ...
Corresponding time interval when detecting the input of third party's input method, in the present embodiment, the time interval of setting is 0.3s, " heartily continue laughing " inputted in real time from third party's input method extracts, i.e. current string " not laughing at not heartily Stop " corresponding text style are as follows: font: black matrix, font size: 30pt, color: black, bottom shadow: without, underscore: without, inclination: Nothing ..., and detect that the time interval of each character input is less than 0.3s.
Step 203: " heartily continue laughing " being rendered by the text style, it is right respectively in text style to load Each display properties answered, forms target string as shown in Figure 2, and " heartily continue laughing " corresponding font is black matrix, word It number is 30pt, color is black, bottomless shadow, no underscore, without inclination.
Step 204: the target string being shown line by line in the target template
In the present embodiment, obtain the corresponding width of target string, i.e., in target string " heartily continue laughing ", 7 The shared width that a font size is 30pt is 210pt.Display area in hexagon target template is detected, original state In, which is 3 rows, and first trip width is 100pt, and the second line width is 160pt, then calling system API 4th character " laughing at " of this target string is started to enter a new line, first trip shows " heartily ", the second row show " do not laugh at not Stop ", so that target string " heartily continue laughing " folds be made to be shown in hexagon target template.
As shown in figure 3, when continue extract user inputted in real time in third party's input method character " very lovely " when, detect institute State the corresponding time interval generated the when input of third party's input method;In the present embodiment, the time interval of setting is 0.3s,
It detects and produces the pause of 0.4s after user has inputted character string " heartily continue laughing ", then separately from pattern It is randomly selected in library, determines the corresponding text style of current string " very lovely " at this time.In the present embodiment, selection The corresponding display properties of json pattern are as follows: font: black matrix, font size: 36pt, color: dark green, bottom shadow: nothing, underscore: have, incline It is oblique: to have ...
Current string " very lovely " is rendered according to the json pattern corresponding display properties, i.e., by current character The font of string " very lovely " is set as black matrix, font size is set as 36pt, color is set as bottle green and underscore and inclined sample is arranged Formula, the target string " very lovely " after being rendered.
Meanwhile obtaining the corresponding width of target string, i.e., in target string " very lovely ", 3 font sizes are 36pt's Shared width is 108pt.Display area in hexagon target template is detected, and in original state, the second line width is 160pt, a upper character string " heartily continue laughing " has occupied 120pt in the second row, then in the remaining 40pt of the second row The character of a 36pt can also be accommodated, i.e. calling system API starts to enter a new line to second character "available" of this target string, Second row shows "true", and the third line shows " lovely ", to make target string " very lovely " folds in hexagon target template In be shown.
When continuing to extract character " think well ruthlessly parent flatly " that user inputs in real time in third party's input method, institute is detected State the corresponding time interval generated the when input of third party's input method;
The pause of 0.5s is produced after user has inputted character string " very lovely " as shown in figure 4, detecting, then separately from sample Formula is randomly selected in library, determines the corresponding text style of current string " thinking that parent is flatly ruthlessly well " at this time.This implementation In example, the corresponding display properties of json pattern of selection are as follows: font: regular script, font size: 30pt, color: red, overstriking: have, under Scribing line: nothing, inclination: nothing ...
Current string " thinking that parent is flatly ruthlessly well " is rendered according to the json pattern corresponding display properties, i.e., By the font of current string " thinking that parent is flatly ruthlessly well " is set as regular script, font size is set as 30pt, color is set as red and sets The pattern for setting overstriking, the target string " thinking that parent is flatly ruthlessly well " after being rendered.
Meanwhile obtaining the corresponding width of target string, i.e., in target string " thinking that parent is flatly ruthlessly well ", 8 words Number shared width for being 30pt is 240pt.In original state, third line width is 100pt, and a upper character string " very lovely " exists Second row has occupied 80pt, then the 240pt of target string can not be accommodated any more in the remaining 20pt of the second row.At this point, calling System API zooms in and out the display area of original state, i.e. the increase line number of display area, while to the character string inputted It is unified to carry out typesetting, scaling is uniformly carried out by the size of former character, the number inputted is counted and each character is corresponding Each character in the present embodiment, is reduced into original 80% by width, then as shown in figure 4, thinking that the target string of input " well Parent's a bite ruthlessly " is completely shown in the display area in hexagon input template with another text style.
In the present embodiment, picture to be edited is when adding text, the set text style of random call from style library, together When detection user corresponding time interval generated when inputting in real time, by input pause as unit of current string is divided, Corresponding text style is called to render current string, so that corresponding each subordinate sentence is respectively with difference when making input pause Text style be shown automatically in target template, user, can be fast without carrying out operation editor to text style manually Speed realizes the typesetting effect of more text styles, enriches by the display information of editing picture, improves the operating efficiency of user, full The foot individual demand of user.
In another embodiment, when carrying out character input in candidate picture,
Step 301: loading set target template in candidate picture on candidate picture;
In the present embodiment, when user carries out copy editor to candidate picture, figure layer is set on candidate picture, calls shape For hexagon and background is the conduct target template of grey template,
Step 302: being chosen in real time from preset style library at random, determine current string in the target template Corresponding text style;
In the present embodiment, the character that extract real-time third party's input method inputs in real time, with behavior unit to the character of input String carry out cutting chosen in real time in the library json at random using character string of the row as current string, obtain with The text style of machine carries out with the text of each row corresponding respectively.
Specifically, the library json in the present embodiment is as follows:
Respectively from the library json the corresponding json of random call as current line, the i.e. corresponding text sample of current string Formula.
In other embodiments, it can be calculated with the current string by single character, respectively to the current character The single character of string respectively randomly selects text style from the style library and carries out real-time rendering, i.e., what each character was loaded Display properties is different, then the target string for being subsequently formed different text styles is shown in target template, enriches While display effect, the process that user carries out character editing, typesetting is also eliminated, improves the input efficiency of user.
Step 303: current string being rendered according to the text style, forms target string;
In the present embodiment, with the continuous carry out character input of user, respectively with behavior unit, to the current character of every row String calls corresponding text style to be rendered, i.e., it is corresponding to load the text style respectively to the current string Each display properties renders each character in the current string, forms target string.
It is such as input to finally, current string is as the 6th row, " to realize.", and the text sample that the 6th row randomly selects Formula are as follows:
"type":0,
"textSize":20,
"textColor":"#FFFF0000",
"colorGroup":0,
"font":"fonts/Orbitron-Medium.ttf"
Then 6th row " is realized according to display properties therein." font size is set as 20 (" textSize ": 20), font is set Be set to Orbitron-Medium (" font ": " fonts/Orbitron-Medium.ttf "), text color be yellow (" TextColor ": " #FFFFFF00 "), it forms target string as shown in Figure 5 and " realizes."
Step 304: the target string being shown line by line in the target template
In the present embodiment, compare the region height size occupied required for current character is drawn, if current region height The 80% of display area height is corresponded to less than target template or corresponds to the 120% of display area height greater than target template, then Again the font size of all rows is zoomed in or out.As shown in fig. 6,6 row target string respective heights of display are less than display area 80%, then the corresponding font size of all target strings is amplified to original 1.2 times, rendering is re-started, after obtaining update Target string be loaded onto target template.
Figure layer top layer by target template in picture to be edited is shown, and is formd and is treated editing picture progress text volume The effect collected.
In the present embodiment, make picture to be edited when adding text, the set text sample of random call from style library Formula is shown the target character of input with behavior unit automatically in target template, and user is not necessarily to manually to text style Operation editor is carried out, the typesetting effect of more text styles can be fast implemented, enriches by the display information of editing picture, improves The operating efficiency of user, meets the individual demand of user.
Fig. 7 is the structural schematic diagram of the electronic equipment of one embodiment of the application.Referring to FIG. 7, in hardware view, it should Electronic equipment includes processor, optionally further comprising internal bus, network interface, memory.Wherein, memory may be comprising interior It deposits, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile memories Device (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other Hardware required for business.
Processor, network interface and memory can be connected with each other by internal bus, which can be ISA (Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard Architecture, expanding the industrial standard structure) bus etc..The bus can be divided into address bus, data/address bus, control always Line etc..Only to be indicated with a four-headed arrow in Fig. 7, it is not intended that an only bus or a type of convenient for indicating Bus.
Memory, for storing program.Specifically, program may include program code, and said program code includes calculating Machine operational order.Memory may include memory and nonvolatile memory, and provide instruction and data to processor.
Processor is from the then operation into memory of corresponding computer program is read in nonvolatile memory, in logical layer The device of expression insertion candidates of input method is formed on face.Processor executes the program that memory is stored, and is specifically used for holding The following operation of row:
Set target template is loaded in candidate picture;
It is chosen in real time from preset style library at random, determines the corresponding text of current string in the target template Printed words formula;The current string is the character composition for extracting third party's input method and inputting in real time;
Current string is rendered according to the text style, forms target string;
The target string is shown line by line in the target template.
The method that copy editor's device in picture disclosed in the above-mentioned embodiment illustrated in fig. 7 such as the application executes can be applied It is realized in processor, or by processor.Processor may be a kind of IC chip, the processing capacity with signal. During realization, each step of the above method can pass through the integrated logic circuit or software form of the hardware in processor Instruction complete.Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components.It may be implemented or execute the public affairs in the embodiment of the present application Each method, step and the logic diagram opened.General processor can be microprocessor or the processor be also possible to it is any often The processor etc. of rule.The step of method in conjunction with disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and hold Row complete, or in decoding processor hardware and software module combine execute completion.Software module can be located at deposits at random Reservoir, flash memory, read-only memory, this fields such as programmable read only memory or electrically erasable programmable memory, register In mature storage medium.The storage medium is located at memory, and processor reads the information in memory, completes in conjunction with its hardware The step of above method.
The method that the electronic equipment can also carry out Fig. 1, and realize the device implementation shown in Fig. 1 of the copy editor in picture The function of example, details are not described herein for the embodiment of the present application.
Certainly, other than software realization mode, other implementations are not precluded in the electronic equipment of this specification, such as Logical device or the mode of software and hardware combining etc., that is to say, that the executing subject of following process flow is not limited to each Logic unit is also possible to hardware or logical device.
The embodiment of the present application also proposed a kind of computer readable storage medium, the computer-readable recording medium storage one A or multiple programs, the one or more program include instruction, and the instruction is when by the portable electronic including multiple application programs When equipment executes, the method that the portable electronic device can be made to execute embodiment illustrated in fig. 1, and be specifically used for executing with lower section Method:
Set target template is loaded in candidate picture;
It is chosen in real time from preset style library at random, determines the corresponding text of current string in the target template Printed words formula;The current string is the character composition for extracting third party's input method and inputting in real time;
Current string is rendered according to the text style, forms target string;
The target string is shown line by line in the target template.
Fig. 8 is the structural schematic diagram of copy editor's device in the picture of one embodiment of the application.Referring to FIG. 8, In a kind of Software Implementation, copy editor's device 800 in picture may include: loading module 801, choose module 802, rendering module 803 and display module 804, wherein
Loading module 801, for loading set target template in candidate picture;
Choose module 802, for being chosen in real time from preset style library at random, determine in the target template when The corresponding text style of preceding character string;The current string is the character composition for extracting third party's input method and inputting in real time;
Rendering module 803 forms target string for rendering according to the text style to current string;
Display module 804, for being shown line by line in the target template to the target string.
The text style is defined by the display properties of character respectively, and the display properties includes at least: color, word Body, font size, whether shadow containing bottom, whether containing underscore, whether tilt;
After the display properties is packaged respectively, it is stored in style library in the form of json.
Described device 800 further include:
Detection unit, the corresponding time interval generated when for detecting third party's input method input;
String processing unit, for being divided to the time interval;When time interval is greater than set duration, separately Row randomly selects text style from the style library, carries out real-time rendering to the character string inputted after time interval;
When time interval is less than set duration, continue according to the text style of current application to the current string into Row rendering.
Described device 800 further include:
Monocase processing unit is calculated for the current string by single character, respectively to the current string Single character respectively randomly selected from the style library text style carry out real-time rendering.
The rendering module 803 specifically includes,
Pattern call unit loads the text sample to the current string for calling the text style respectively The corresponding each display properties of formula;
Character rendering unit is formed for rendering each character in the current string respectively by the display properties The target string.
Display module 804 specifically includes,
Acquiring unit, for obtaining the target string corresponding size and/or character quantity in real time;
Adjustment unit, for according in the target template display area and the corresponding size of the target string it is big It is small that the target string is zoomed in and out and entered a new line, so that the target string inputted is filled up completely the target template In display area.
The adjustment unit specifically includes,
First reducing unit, it is corresponding for extracting display area and the target string inputted in the target template Character quantity, when the character quantity is greater than the corresponding character quantity accommodated in the display area, then to the target string Corresponding font size is entered a new line and is reduced;
Second reducing unit, for extracting the correspondingly-sized of display area and the target string in the target template Corresponding size, when the correspondingly-sized of display area size corresponding less than the target string, then to the mesh Mark character string is entered a new line and is reduced by the correspondingly-sized of the display area.
In short, being not intended to limit the protection of this specification the foregoing is merely the preferred embodiment of this specification Range.For all spirit in this specification within principle, any modification, equivalent replacement, improvement and so on should be included in this Within the protection scope of specification.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity, Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment The combination of equipment.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM), Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want There is also other identical elements in the process, method of element, commodity or equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method Part explanation.

Claims (13)

1. the method for the copy editor in picture a kind of, which is characterized in that the described method includes:
Set target template is loaded in candidate picture;
It is chosen in real time from preset style library at random, determines the corresponding text sample of current string in the target template Formula;The current string is the character composition for extracting third party's input method and inputting in real time;
Current string is rendered according to the text style, forms target string;
The target string is shown line by line in the target template.
2. the method according to claim 1, wherein including:
The text style is defined by the display properties of character respectively, and the display properties includes at least: color, font, Font size, whether shadow containing bottom, whether containing underscore, whether tilt;
After the display properties is packaged respectively, it is stored in the form of json in preset style library.
3. method according to claim 1 or 2, which is characterized in that the method also includes:
Detect the corresponding time interval generated when third party's input method input;
The time interval is divided;When time interval is greater than set duration, separately selected at random from the style library Text style is taken, carries out real-time rendering for the character string inputted after the time interval as current string;
When time interval is less than set duration, continue to carry out wash with watercolours to the current string according to the text style of current application Dye.
4. method according to claim 1 or 2, which is characterized in that the method also includes:
The current string is calculated by single character, respectively to the single character of the current string from the style library It respectively randomly selects text style and carries out real-time rendering.
5. method according to claim 1 or 2, which is characterized in that it is described according to the text style to current string When being rendered, further includes:
The text style is called, the corresponding each display properties of the text style is loaded respectively to the current string;
Each character in the current string is rendered respectively by the display properties, forms the target string.
6. the method according to claim 1, wherein described when being shown line by line to the target string, Further include:
Obtain the target string corresponding size and/or character quantity in real time;
According in the target template display area and the corresponding size of the target string to the target character String zooms in and out and enters a new line, and the target string inputted is made to fill the display area in the target template.
7. according to the method described in claim 6, it is characterized in that, described zoom in and out and enter a new line to the target string When, further includes:
Display area and the corresponding character quantity of the target string inputted in the target template are extracted, when the number of characters Amount is greater than the corresponding character quantity accommodated in the display area, then the corresponding font size of the target string is entered a new line and contracted It is small;
The correspondingly-sized of display area and the corresponding size of the target string in the target template are extracted, when the display When the correspondingly-sized in region is less than the target string corresponding size, then the display area is pressed to the target string Correspondingly-sized entered a new line and reduced.
8. the device of the copy editor in picture a kind of, which is characterized in that described device includes:
Loading module, for loading set target template in candidate picture;
It chooses module and determines current character in the target template for being chosen in real time from preset style library at random Go here and there corresponding text style;The current string is the character composition for extracting third party's input method and inputting in real time;
Rendering module forms target string for rendering according to the text style to current string;
Display module, for being shown line by line in the target template to the target string.
9. device according to claim 8 characterized by comprising
The text style is defined by the display properties of character respectively, and the display properties includes at least: color, font, Font size, whether shadow containing bottom, whether containing underscore, whether tilt;
After the display properties is packaged respectively, it is stored in style library in the form of json.
10. device according to claim 8 or claim 9, which is characterized in that described device further include:
Detection unit, the corresponding time interval generated when for detecting third party's input method input;
String processing unit, for being divided to the time interval;When time interval be greater than set duration when, separately from Text style is randomly selected in the style library, real-time rendering is carried out to the character string inputted after time interval;
When time interval is less than set duration, continue to carry out wash with watercolours to the current string according to the text style of current application Dye.
11. device according to claim 8 or claim 9, which is characterized in that described device further include:
Monocase processing unit is calculated for the current string by single character, respectively to the list of the current string A character respectively randomly selects text style from the style library and carries out real-time rendering.
12. device according to claim 8 or claim 9, which is characterized in that the rendering module specifically includes,
Pattern call unit loads the text style pair to the current string for calling the text style respectively Each display properties answered;
Character rendering unit, for rendering each character in the current string respectively by the display properties, described in formation Target string.
13. device according to claim 8, which is characterized in that the display module specifically includes,
Acquiring unit, for obtaining the target string corresponding size and/or character quantity in real time;
Adjustment unit, for according in the target template display area and the corresponding size pair of the target string The target string zooms in and out and enters a new line, and the target string inputted is made to fill the display in the target template Region.
CN201910210972.6A 2019-03-20 2019-03-20 Method and device for editing characters in picture Active CN109978972B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910210972.6A CN109978972B (en) 2019-03-20 2019-03-20 Method and device for editing characters in picture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910210972.6A CN109978972B (en) 2019-03-20 2019-03-20 Method and device for editing characters in picture

Publications (2)

Publication Number Publication Date
CN109978972A true CN109978972A (en) 2019-07-05
CN109978972B CN109978972B (en) 2023-04-25

Family

ID=67079613

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910210972.6A Active CN109978972B (en) 2019-03-20 2019-03-20 Method and device for editing characters in picture

Country Status (1)

Country Link
CN (1) CN109978972B (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110850996A (en) * 2019-09-29 2020-02-28 上海萌家网络科技有限公司 Picture/video processing method and device applied to input method
CN110889267A (en) * 2019-11-29 2020-03-17 北京金山安全软件有限公司 Method and device for editing characters in picture, electronic equipment and storage medium
CN110929496A (en) * 2019-11-15 2020-03-27 北京金山安全软件有限公司 Method and device for generating character template
CN110990747A (en) * 2019-12-17 2020-04-10 北京思维造物信息科技股份有限公司 Image generation method, device, equipment and storage medium
CN111144073A (en) * 2019-12-30 2020-05-12 文思海辉智科科技有限公司 Blank character visualization method and device in online text display system
CN111401001A (en) * 2020-03-13 2020-07-10 浙江学海教育科技有限公司 TextView linear scaling method, device, equipment and medium
CN112330774A (en) * 2020-11-24 2021-02-05 携程旅游网络技术(上海)有限公司 Method and device for synthesizing pictures in batch, electronic equipment and storage medium
CN112507670A (en) * 2020-12-14 2021-03-16 北京字跳网络技术有限公司 Text editing method and device, electronic equipment and storage medium
CN112749529A (en) * 2019-10-29 2021-05-04 西安诺瓦星云科技股份有限公司 Method and device for character self-adaption special-shaped edit box
CN112825079A (en) * 2019-11-20 2021-05-21 北京沃东天骏信息技术有限公司 Information display method and device
CN113298741A (en) * 2020-11-13 2021-08-24 阿里巴巴集团控股有限公司 Picture synthesis method and device and electronic equipment
CN113705156A (en) * 2021-08-30 2021-11-26 上海哔哩哔哩科技有限公司 Character processing method and device
CN113989404A (en) * 2021-11-05 2022-01-28 北京字节跳动网络技术有限公司 Picture processing method, device, equipment, storage medium and program product
CN116740235A (en) * 2023-08-14 2023-09-12 福昕鲲鹏(北京)信息科技有限公司 Text annotation rendering method and device based on format document

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728062A (en) * 2004-07-30 2006-02-01 招商银行股份有限公司 Graphics keyboard based security input method for computer information
CN105787335A (en) * 2016-02-25 2016-07-20 东莞盛世科技电子实业有限公司 Switching control method and device for password input interface

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728062A (en) * 2004-07-30 2006-02-01 招商银行股份有限公司 Graphics keyboard based security input method for computer information
CN105787335A (en) * 2016-02-25 2016-07-20 东莞盛世科技电子实业有限公司 Switching control method and device for password input interface

Cited By (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110850996A (en) * 2019-09-29 2020-02-28 上海萌家网络科技有限公司 Picture/video processing method and device applied to input method
CN112749529A (en) * 2019-10-29 2021-05-04 西安诺瓦星云科技股份有限公司 Method and device for character self-adaption special-shaped edit box
CN110929496A (en) * 2019-11-15 2020-03-27 北京金山安全软件有限公司 Method and device for generating character template
CN110929496B (en) * 2019-11-15 2023-06-16 北京乐蜜科技有限责任公司 Text template generation method and device
CN112825079B (en) * 2019-11-20 2024-04-05 北京沃东天骏信息技术有限公司 Information display method and device
CN112825079A (en) * 2019-11-20 2021-05-21 北京沃东天骏信息技术有限公司 Information display method and device
CN110889267A (en) * 2019-11-29 2020-03-17 北京金山安全软件有限公司 Method and device for editing characters in picture, electronic equipment and storage medium
CN110990747A (en) * 2019-12-17 2020-04-10 北京思维造物信息科技股份有限公司 Image generation method, device, equipment and storage medium
CN111144073B (en) * 2019-12-30 2021-11-16 文思海辉智科科技有限公司 Blank character visualization method and device in online text display system
CN111144073A (en) * 2019-12-30 2020-05-12 文思海辉智科科技有限公司 Blank character visualization method and device in online text display system
CN111401001A (en) * 2020-03-13 2020-07-10 浙江学海教育科技有限公司 TextView linear scaling method, device, equipment and medium
CN111401001B (en) * 2020-03-13 2023-05-26 浙江学海教育科技有限公司 TextView linear scaling method, textView linear scaling device, textView linear scaling equipment and TextView linear scaling medium
CN113298741A (en) * 2020-11-13 2021-08-24 阿里巴巴集团控股有限公司 Picture synthesis method and device and electronic equipment
CN113298741B (en) * 2020-11-13 2024-01-12 阿里巴巴集团控股有限公司 Picture synthesis method and device and electronic equipment
CN112330774B (en) * 2020-11-24 2023-09-08 携程旅游网络技术(上海)有限公司 Method and device for synthesizing pictures in batches, electronic equipment and storage medium
CN112330774A (en) * 2020-11-24 2021-02-05 携程旅游网络技术(上海)有限公司 Method and device for synthesizing pictures in batch, electronic equipment and storage medium
CN112507670A (en) * 2020-12-14 2021-03-16 北京字跳网络技术有限公司 Text editing method and device, electronic equipment and storage medium
CN113705156A (en) * 2021-08-30 2021-11-26 上海哔哩哔哩科技有限公司 Character processing method and device
CN113989404A (en) * 2021-11-05 2022-01-28 北京字节跳动网络技术有限公司 Picture processing method, device, equipment, storage medium and program product
CN116740235A (en) * 2023-08-14 2023-09-12 福昕鲲鹏(北京)信息科技有限公司 Text annotation rendering method and device based on format document

Also Published As

Publication number Publication date
CN109978972B (en) 2023-04-25

Similar Documents

Publication Publication Date Title
CN109978972A (en) A kind of method and device of copy editor in picture
US20210240913A1 (en) Font rendering method and apparatus, and computer-readable storage medium
KR102107887B1 (en) Method and apparatus for generating a composite image
JP6595714B2 (en) Method and apparatus for generating a two-dimensional code image having a dynamic effect
US10896357B1 (en) Automatic key/value pair extraction from document images using deep learning
CN107092643A (en) A kind of barrage rendering intent and device
WO2017177931A1 (en) Text information display method and apparatus, and mobile device
CN108399172B (en) Vector diagram generation method and device
CN112073794B (en) Animation processing method, animation processing device, computer readable storage medium and computer equipment
CN109636885B (en) Sequential frame animation production method and system for H5 page
CN104298504A (en) Method for achieving font rendering based on FreeType font engine
CN106446139A (en) Webpage content extracting method and device
CN108961361B (en) Method and system for generating special effect text image and computer equipment
CN106569805A (en) Canvas storage/graph drawing method and equipment
WO2017143973A1 (en) Text recognition model establishing method and device
CN105513115A (en) Method and device for converting SWF into Canvas cartoon
CN109714627A (en) A kind of rendering method of comment information, device and equipment
CN115988170A (en) Method and device for clearly displaying Chinese and English characters in real-time video screen combination in cloud conference
CN107203764A (en) Long microblog picture recognition methods and device
CN106293369B (en) Exchange method, interactive device and user equipment based on barrage
CN105956133B (en) Method and device for displaying file on intelligent terminal
CN106681735A (en) Method, device and apparatus for generating dynamic icons based fonts
CN106126084A (en) A kind of display packing for electricity paper ink screen
CN110321190A (en) The method and device of icon optimization in a kind of desktop
CN113095058B (en) Method and device for processing page turning of streaming document, electronic equipment and storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20220718

Address after: No.16 and 17, unit 1, North District, Kailin center, No.51 Jinshui East Road, Zhengzhou area (Zhengdong), Henan pilot Free Trade Zone, Zhengzhou City, Henan Province, 450000

Applicant after: Zhengzhou Apas Technology Co.,Ltd.

Address before: E301-27, building 1, No.1, hagongda Road, Tangjiawan Town, Zhuhai City, Guangdong Province

Applicant before: ZHUHAI TIANYAN TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant