CN112329385A - Method, device and equipment for realizing multilayer character edge tracing effect and storage medium - Google Patents

Method, device and equipment for realizing multilayer character edge tracing effect and storage medium Download PDF

Info

Publication number
CN112329385A
CN112329385A CN202011038820.1A CN202011038820A CN112329385A CN 112329385 A CN112329385 A CN 112329385A CN 202011038820 A CN202011038820 A CN 202011038820A CN 112329385 A CN112329385 A CN 112329385A
Authority
CN
China
Prior art keywords
text
layer
stroke
effect
stroking
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011038820.1A
Other languages
Chinese (zh)
Inventor
肖垠垠
王宇飞
邹泽龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Baiguoyuan Network Technology Co Ltd
Original Assignee
Guangzhou Baiguoyuan Network 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 Guangzhou Baiguoyuan Network Technology Co Ltd filed Critical Guangzhou Baiguoyuan Network Technology Co Ltd
Priority to CN202011038820.1A priority Critical patent/CN112329385A/en
Publication of CN112329385A publication Critical patent/CN112329385A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the application discloses a method, a device and equipment for realizing a multilayer character stroking effect and a storage medium. The technical scheme provided by the embodiment of the application determines a single-layer stroke processing mode corresponding to each layer of stroke effect based on the set multi-layer stroke effect, performs character stroke processing on the text to be processed based on the corresponding single-layer stroke processing mode to obtain the stroke effect text corresponding to the multi-layer stroke effect, displays the corresponding stroke effect text in the stroke text box, realizes multi-layer stroke effect display of the text to be processed, and realizes richer character stroke effect.

Description

Method, device and equipment for realizing multilayer character edge tracing effect and storage medium
Technical Field
The embodiment of the application relates to the technical field of character display, in particular to a method, a device, equipment and a storage medium for realizing a character multilayer stroke effect.
Background
With the development of networks, short video applications are more and more favored, and when making short videos, words such as lyrics, subtitles, cover titles and the like are often added to the videos, and when adding the words, it is expected that the words can exhibit different display effects.
In practical application, a character stroke effect is a common character display effect, but the UITextView (a text editing control provided by a system) of the current system (Android, iOS and other systems) can only realize a simple character display effect, for example, when designing characters on a front cover, only a single-layer stroke display can be performed on the characters, and a more complex character effect cannot be realized.
Disclosure of Invention
The embodiment of the application provides a method, a device and equipment for realizing a character multilayer stroke effect and a storage medium, so as to realize a richer character stroke effect.
In a first aspect, an embodiment of the present application provides a method for implementing a multi-layer text stroking effect, including:
receiving a text to be processed input for the strode text box;
determining a single-layer tracing processing mode corresponding to each layer of tracing effect based on the set multilayer tracing effect;
performing character edge tracing processing on the text to be processed based on the single-layer edge tracing processing mode to obtain an edge tracing effect text corresponding to a multi-layer edge tracing effect;
displaying the stroke effect text in the stroke text box.
In a second aspect, an embodiment of the present application provides a device for implementing a multi-layer text stroke effect, including a text receiving module, an effect determining module, a stroke processing module, and a text display module, where:
the text receiving module is used for receiving a text to be processed input into the stroke text box;
the effect determining module is used for determining a single-layer tracing processing mode corresponding to each layer of tracing effect based on the set multilayer tracing effect;
the stroke processing module is used for carrying out character stroke processing on the text to be processed based on the single-layer stroke processing mode so as to obtain a stroke effect text corresponding to a multi-layer stroke effect;
and the text display module is used for displaying the stroking effect text in the stroking text box.
In a third aspect, an embodiment of the present application provides a computer device, including: a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a text multi-layer stroke effect implementation method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform the text multi-layer stroke effect implementation method according to the first aspect.
The method and the device for processing the multi-layer stroke effect determine a single-layer stroke processing mode corresponding to each layer of stroke effect based on the set multi-layer stroke effect, perform character stroke processing on the text to be processed based on the corresponding single-layer stroke processing mode to obtain the stroke effect text corresponding to the multi-layer stroke effect, display the corresponding stroke effect text in the stroke text box, achieve multi-layer stroke effect display of the text to be processed, and achieve richer character stroke effects.
Drawings
Fig. 1 is a flowchart of a method for implementing a multi-layer text stroking effect according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of an effect display interface provided by an embodiment of the present application;
fig. 3 is a schematic display diagram of a text with a stroking effect provided in an embodiment of the present application;
fig. 4 is a flowchart of another method for implementing a multi-layer text stroking effect according to an embodiment of the present disclosure;
fig. 5 is a flowchart of another method for implementing a multi-layer text stroking effect according to an embodiment of the present disclosure;
fig. 6 is a flowchart of another method for implementing a multi-layer text stroking effect according to an embodiment of the present disclosure;
fig. 7 is a flowchart of another method for implementing a multi-layer text stroking effect according to an embodiment of the present disclosure;
FIG. 8 is a display diagram of a text view control provided by an embodiment of the present application;
FIG. 9 is a display diagram of another textview control provided by an embodiment of the present application;
FIG. 10 is a display diagram of another textview control provided by an embodiment of the present application;
fig. 11 is a schematic structural diagram of a device for implementing a multi-layer text stroking effect according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, specific embodiments of the present application will be described in detail with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some but not all of the relevant portions of the present application are shown in the drawings. Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a flowchart of a method for implementing a multi-layer text stroke effect according to an embodiment of the present application, where the method for implementing a multi-layer text stroke effect according to an embodiment of the present application may be implemented by a device for implementing a multi-layer text stroke effect, and the device for implementing a multi-layer text stroke effect may be implemented in a hardware and/or software manner and integrated in a computer device.
The following describes an example of the method for implementing the multi-layer text stroke effect by the text multi-layer stroke effect implementation device. Referring to fig. 1, the method for implementing the multi-layer text edge-tracing effect includes:
s101: text to be processed entered into the stroke text box is received.
For example, a stroked text box may be added to an effect display interface provided by a computer device such as a mobile phone or a tablet computer, and text input may be performed by clicking the stroked text box, or text in the stroked text box may be edited. And after the text is input or edited, receiving the text input to the stroke text box and taking the text as the text to be processed. Wherein the text to be processed can be understood as the text needing the character edge tracing processing.
The stroking text box can be added into the effect display interface after receiving and confirming the text to be processed, or the stroking text box can be used for inputting the text to be processed after the stroking text box is added into the effect display interface.
Optionally, before the text to be processed is input into the stroked text box, a prompt text is displayed in the stroked text box based on a set character stroked display effect, for example, a prompt text of "Enter title" is displayed based on a set multi-layer stroked effect, and after the stroked text box is clicked to input the text to be processed, the text enters a text input interface (for example, a virtual keyboard is called to input the text), and the display of the prompt text is cancelled.
Fig. 2 is a schematic diagram of an effect display interface according to an embodiment of the present application. Taking a video recording application program as an example, starting a video recording application and entering a video recording page, and after completing recording of a video, entering an effect display interface (which can enter the effect display interface through a cover setting button or a subtitle setting button and is respectively used for setting display effects of characters displayed in a cover or a subtitle, and the cover setting interface is taken as an example in the figure for description), where in this embodiment, the effect display interface is an interactive interface for setting display effects on corresponding video frames. As shown in fig. 2, a stroked text box (a position corresponding to "Enter title" in the figure) is added to the effect display interface, a prompt text of "Enter title" is displayed in the stroked text box, and the text to be processed can be input into the stroked text box by clicking the prompt text.
S102: and determining a single-layer stroke processing mode corresponding to each layer of stroke effect based on the set multi-layer stroke effect.
Illustratively, different multi-layer stroke effects correspond to different single-layer stroke processing modes and stroke text boxes, the stroke effects of the same multi-layer stroke effect correspond to the stroke effects of adjacent layers, and the single-layer stroke processing modes corresponding to each layer of stroke effect also differ.
In this embodiment, the set multi-layer stroke effect may be a default multi-layer stroke effect, or may be a multi-layer stroke effect determined according to a switching operation or a selecting operation for the multi-layer stroke effect. For example, selection buttons corresponding to different multi-layer stroke effects are provided in the effect display interface, and after the corresponding selection buttons are clicked, the corresponding multi-layer stroke effects are the set multi-layer stroke effects.
For example, when entering the effect display interface, a stroking text box is added to the effect display interface according to a default multi-layer stroking effect, a text to be processed input to the stroking text box is received, the multi-layer stroking effect corresponding to the stroking text box is determined, and then a single-layer stroking processing mode corresponding to each layer of stroking effect is determined.
Further, when a switching operation or a selecting operation of the multi-layer stroke effect is detected, the corresponding stroke text box is switched, the multi-layer stroke effect corresponding to the stroke text box is determined, and then the single-layer stroke processing mode corresponding to each layer of stroke effect is determined.
S103: and performing character edge tracing processing on the text to be processed based on the single-layer edge tracing processing mode to obtain an edge tracing effect text corresponding to the multi-layer edge tracing effect.
After the single-layer tracing processing mode corresponding to each layer of tracing effect is determined, character tracing processing is respectively carried out on the text to be processed based on each single-layer tracing processing mode, single-layer tracing texts corresponding to each layer of tracing effect are respectively obtained, and the single-layer tracing texts of each layer are superposed to obtain a multi-layer tracing effect text corresponding to the multi-layer tracing effect.
S104: displaying the stroke effect text in the stroke text box.
Illustratively, after the stroke effect text is obtained, the stroke effect text is displayed in the corresponding stroke text box.
Optionally, a delete button or a zoom button may be added to the outlined text box to perform a delete operation or a zoom operation on the outlined text box, or a zoom operation on the outlined text box may be implemented by a two-finger operation. And after the stroking text box is subjected to zooming operation, performing character stroking processing on the text to be processed with the reset size to obtain a stroking effect text with the corresponding size, and displaying the stroking effect text in the stroking text box. In addition, the position of the stroked text box in the effect display interface can be moved in response to the dragging operation of the stroked text box.
Fig. 3 is a schematic display diagram of a text with a stroking effect provided in an embodiment of the present application. As shown in fig. 3, after the stroke effect text is obtained, the stroke effect text is displayed on the effect display interface. The figure is exemplarily depicted with the stroke effect text corresponding to the double-layer stroke effect, namely, the inner red text, the middle white stroke, and the outer purple stroke, wherein the white stroke and the outer purple stroke correspond to the white and purple single-layer stroke text, respectively.
In the above, the single-layer stroke processing mode corresponding to each layer of stroke effect is determined based on the set multi-layer stroke effect, character stroke processing is performed on the text to be processed based on the corresponding single-layer stroke processing mode, the stroke effect text corresponding to the multi-layer stroke effect is obtained, the corresponding stroke effect text is displayed in the stroke text box, multi-layer stroke effect display of the text to be processed is achieved, and richer character stroke effects are achieved.
On the basis of the foregoing embodiment, fig. 4 is a flowchart of another method for implementing a multi-layer text stroke effect according to an embodiment of the present application, where the method for implementing a multi-layer text stroke effect is an embodiment of the method for implementing a multi-layer text stroke effect. Referring to fig. 4, the method for implementing the multi-layer text edge-tracing effect includes:
s201: text to be processed entered into the stroke text box is received.
S202: and determining the stroke color and the stroke width corresponding to each layer of stroke effect based on the set multilayer stroke effect.
The multi-layer tracing effect comprises a plurality of single-layer tracing effects, and the tracing color and the tracing width of each layer of the tracing effect can be set according to the display requirements of the tracing of different layers of the multi-layer tracing effect.
Specifically, the preset multi-layer stroke effect may be determined according to a default multi-layer stroke effect in the effect display interface, or by a switching operation or a selecting operation of the character stroke effect, and the stroke color and the stroke width of each layer of stroke effect may be determined according to the multi-layer stroke effect.
S203: and carrying out layering processing on the text to be processed according to the stroke color and the stroke width corresponding to each layer of stroke effect.
Specifically, after the stroke color and the stroke width of each layer of stroke effect are determined, the text to be processed is subjected to layering processing according to the stroke color and the stroke width corresponding to each layer of stroke effect. And drawing the text to be processed according to the corresponding stroke color and stroke width, so that the text to be processed which is correspondingly drawn by the stroke effect of the layer has strokes with corresponding colors and widths.
Correspondingly, after text drawing is carried out on each layer of stroke effect, the texts to be processed with the stroke effect with the corresponding layer number are obtained. Generally, the stroking widths corresponding to different layers of stroking effects are different so as to reduce the situation that the stroking widths are the same to cause complete superposition of the stroking, and the stroking colors corresponding to adjacent layers of stroking effects are set to be different colors, so as to reduce the situation that the multi-layer stroking cannot be embodied due to the fact that the adjacent stroking colors are the same or close to each other.
In a possible embodiment, the layering processing on the text to be processed may be a processing sequence from bottom to top, and specifically, the layering processing on the text to be processed includes:
s2031: and sequentially determining the stroking color and the stroking width corresponding to the stroking effect of each layer from the bottommost layer, and processing the text to be processed of each layer by layer, wherein the stroking colors of adjacent layers are different, and the stroking widths of different layers are gradually decreased layer by layer.
Specifically, from the bottommost stroke effect, the stroke color and the stroke width corresponding to the stroke effect of each layer are determined in sequence. The stroking colors can be directly determined according to the stroking colors corresponding to the stroking effects of the corresponding layers, and the stroking colors of adjacent layers are different, so that the boundary between the stroking of the adjacent layers is ensured to be represented, and the multi-layer stroking effect is better represented.
Furthermore, the stroke widths of different layers decrease gradually from layer to layer, that is, the stroke width decreases from the bottommost stroke effect to the upper layer.
Optionally, the stroke width corresponding to the stroke effect of each layer is a difference between the stroke width of the lower layer stroke and the visual width, where the visual width is a visual width of the stroke effect of the corresponding layer, for example, the stroke width of the first layer stroke is 3 pixels, the stroke width of the second layer stroke is 2 pixels, after the second layer stroke is superimposed on the first layer stroke, a portion of the first layer stroke that is not covered by the second layer stroke is a visual stroke, and the corresponding visual width is 1 pixel.
For example, the stroke width of each layer stroke may be determined based on a width formula of Y (n) ═ Y (n-1) -S (n-1), where n is the number of layer levels, the number of lowermost layers n is 1, Y (n) is the stroke width of the nth layer stroke, and S (n-1) is the visual width of the nth-1 layer stroke.
And further, starting from the bottommost tracing effect, drawing the text to be processed layer by layer according to the tracing color and the tracing width corresponding to each layer of the tracing effect.
S204: and overlapping the texts to be processed after the layering processing.
Specifically, after the text to be processed is layered, the text to be processed obtained by drawing each layer is superimposed to obtain the text with the stroke effect corresponding to the multi-layer stroke effect. Generally, when a text to be processed is superimposed, the text to be processed with a larger stroking width is placed at a lower layer of the text to be processed with a smaller stroking width, so that the stroking of the text to be processed at an upper layer only shields the stroking of the inner part of the text to be processed at the lower layer, and at this time, the stroking corresponding to the text to be processed at different levels can be displayed simultaneously.
It can be understood that the overlapping of the texts to be processed after the hierarchical processing may be performed after all the texts to be processed are drawn, or the overlapping of the texts to be processed after the processing may be performed while the single-layer edge tracing effect is performed corresponding to the drawing of the texts to be processed. After the texts to be processed are overlapped, the corresponding overlapping range of the texts to be processed at the lower layer is shielded by the texts to be processed at the upper layer, so that the texts to be processed at multiple levels jointly form the tracing effect texts corresponding to the multi-layer tracing effect.
S205: displaying the stroke effect text in the stroke text box.
In the above, by setting the stroking colors and the stroking widths corresponding to different layers of stroking effects, and performing layering processing on the text to be processed according to the stroking colors and the stroking widths corresponding to each layer of stroking effect, the text to be processed having the corresponding different stroking colors and the stroking widths is drawn, and the text to be processed after layering processing is superposed, the stroking effect text corresponding to multiple layers of stroking effects is obtained, and the character stroking effects of multiple stroking colors and second widening are realized.
On the basis of the foregoing embodiment, fig. 5 is a flowchart of another method for implementing a multi-layer text stroke effect according to an embodiment of the present application, where the method for implementing a multi-layer text stroke effect is an embodiment of the method for implementing a multi-layer text stroke effect. Referring to fig. 5, the method for implementing the multi-layer text edge-tracing effect includes:
s301: text to be processed entered into the stroke text box is received.
S302: and determining the stroke color and the stroke width corresponding to each layer of stroke effect based on the set multilayer stroke effect.
S303: and initializing a stroked text view control according to each layer of stroked effect, wherein the view position and the view size of each stroked text view control are kept consistent.
Specifically, a stroke text view control (a text view control provided by the uis system) is initialized for each layer of stroke effect. The initialization operation of the stroked text view control corresponding to each layer of stroked effect can be performed synchronously or sequentially (after the stroked drawing corresponding to one layer of stroked effect is completed, the next stroked text view control is initialized).
Further, when the stroked text view control is initialized, the stroked text view control is set at the same plane coordinate position and set to the same pixel size, so that the view position and the view size of each stroked text view control are consistent. For example, based on the UITextView [ [ UITextView alloc ] initWithFrame: CGRectMake (x, y, width, height) ], the position of the stroke text view control is set to (x, y), the trial position, the width and the height are set to width and height, respectively, the view size is set, and the view position and the view size of the stroke text view control corresponding to each layer of stroke effect are set to the same attribute value.
S304: and drawing the text to be processed according to the corresponding stroking colors and the stroking widths based on each stroking text view control.
Illustratively, the corresponding color value and width value of the stroke text view control can be set based on the stroke color and stroke width instructions, respectively, for example, the stroke color and the stroke width can be set to purple and 1 pixel respectively based on the stroke color: [ UIColor purpleColor ] and the stroke width: [ NSStringStringWithFormat: @ "% d ], 1 ].
Specifically, according to the stroking color and the stroking width corresponding to each layer of the stroking effect, the text to be processed is drawn in the stroking text view control of the corresponding layer, so that the characters corresponding to the text to be processed and the stroking drawn on the edges of the characters are drawn in the stroking text view control of each layer, and the color and the width of the stroking correspond to the stroking color and the stroking width of the stroking effect of the corresponding layer.
S305: and overlapping the texts to be processed after the layering processing.
Specifically, according to the principle that the stroke width is reduced from bottom to top in sequence, the stroke text view controls of all layers are overlapped, so that the text to be processed is overlapped, and the stroke effect text corresponding to the multiple layers of stroke effects is obtained.
Optionally, the overlapping of the stroked text view controls may be performed after the texts to be processed are drawn on all layers of the stroked text view controls, or may be performed sequentially after the drawing of one layer of the texts to be processed is completed.
Further, the overlapping sequence of the stroked text view controls can be that the stroked text view controls are overlapped from the upper layer to the lower layer in sequence, or the stroked text view controls are overlapped from the lower layer to the upper layer in sequence, or the stroked text view controls are overlapped in sequence by comparing the sizes of corresponding stroked widths of two layers of the stroked text view controls.
S306: displaying the stroke effect text in the stroke text box.
By initializing one stroking text view control for each layer of stroking effect to draw the text to be processed, and setting each stroking text view control based on the same view position and view size, the characters corresponding to the text to be processed drawn in each layer of stroking text view control are completely overlapped, the condition that the display of the multilayer stroking effect is influenced due to the offset of the texts to be processed in different layers is reduced, and the display effect of the multilayer stroking is effectively improved.
On the basis of the foregoing embodiment, fig. 6 is a flowchart of another method for implementing a multi-layer text stroke effect according to an embodiment of the present application, where the method for implementing a multi-layer text stroke effect is an embodiment of the method for implementing a multi-layer text stroke effect. Referring to fig. 6, the method for implementing the multi-layer text edge-tracing effect includes:
s401: text to be processed entered into the stroke text box is received.
S402: and determining the stroke color and the stroke width corresponding to each layer of stroke effect based on the set multilayer stroke effect.
S403: and initializing a stroked text view control according to each layer of stroked effect, wherein the view position and the view size of each stroked text view control are kept consistent.
S404: and drawing the text to be processed according to the corresponding stroking colors and the stroking widths based on each stroking text view control.
S405: and initializing a text view control based on the text effect corresponding to the text to be processed.
The character effect is the display effect of the text characters to be processed, and different character effects are correspondingly set for different multilayer stroke effects.
Specifically, a text view control (UITextView) is initialized based on a text effect, and the view position and the view size of the text view control are consistent with those of other stroke text view controls, and the setting mode of the view position and the view size of the text view control and the stroke text view control is consistent, which is not described in detail in this embodiment.
It will be appreciated that the default stroke color and stroke width of the text view control are null and 0, i.e., no stroke processing is performed on the text as it is being rendered. Optionally, when the text view control is initialized, attribute values of the stroking color and the stroking width are null (nil) and 0, so as to ensure that the text to be processed is not stroked when the text to be processed is drawn.
S406: and setting font color based on the character effect.
Specifically, the font color and font size of the text view control are set to be the font color and font size corresponding to the text effect. Illustratively, the font color and font size of the text view control may be set based on the attributes setObject instruction, for example by the [ attributes setObject: [ UIColor redColor ] forKey: NSForeground polar AttributeName ] and [ attributes setObject: [ UIFount systems FontOfSize:14.f ] forKey: NSFontAttributeName ] instructions to set the font color and font size of the text view control to red and 1.4f, respectively.
S407: and drawing the text to be processed according to the font color based on the text view control.
Specifically, according to the font color and font size corresponding to the character effect, the text to be processed is drawn in the character text view control, so that the text to be processed is drawn in the character text view control, the characters corresponding to the text to be processed are displayed in the character text view control, and the color and size of the characters correspond to the font color and font size corresponding to the character effect.
S408: and overlapping the texts to be processed after the layering processing.
Specifically, according to the principle that the stroke width is reduced from bottom to top in sequence, the stroke text view controls of all layers are overlapped, the text view control is overlapped above the stroke text view control of the uppermost layer, overlapping of texts to be processed is achieved, and stroke effect texts corresponding to multiple layers of stroke effects are obtained.
S409: displaying the stroke effect text in the stroke text box.
In the above, the word text view control is added to the topmost layer to draw the words of the text to be processed, so that the words of the text to be processed cover the topmost layer of the text with the stroking effect, the situation that the display of the words of the text to be processed is affected due to interference between different layers of stroking effects is reduced, and the normal display of the words of the text to be processed is ensured.
In a possible embodiment, the font color in the stroked text view control may be set to the font color corresponding to the text effect, at this time, when the stroked text view control draws the text to be processed, the color of the drawn text to be processed corresponds to the text effect, the text view control may not be added, and the stroked text corresponding to the multilayer stroked effect may also be obtained.
On the basis of the foregoing embodiment, fig. 7 is a flowchart of another method for implementing a multi-layer text stroke effect according to an embodiment of the present application, where the method for implementing a multi-layer text stroke effect is an embodiment of the method for implementing a multi-layer text stroke effect. Referring to fig. 7, the method for implementing the multi-layer text edge-tracing effect includes:
s501: text to be processed entered into the stroke text box is received.
S502: and determining the stroke color, stroke width and font color corresponding to the stroke effect of each layer based on the set multilayer stroke effect, wherein the font color and the stroke color of the same layer are consistent.
Specifically, after the stroke color and the stroke width of each layer of stroke effect are determined according to the multiple layers of stroke effects, the font color of each layer of stroke effect is further determined to be consistent with the stroke color of the same layer, and then the characters corresponding to the text to be processed in the layer of stroke effect and the strokes are fused into a whole, so that the boundaries between the fonts and the strokes cannot be visually seen. For example, if the stroke color corresponding to the layer stroke effect is purple, the font color corresponding to the layer stroke effect is also purple.
S503: and initializing a stroked text view control according to each layer of stroked effect, wherein the view position and the view size of each stroked text view control are kept consistent.
Specifically, when the stroked text view control draws the text to be processed, the text itself of the text to be processed and the stroked edges at the edges of the text are drawn. For setting the stroke color and the stroke width in the stroke text view control, reference may be made to step S304 in the foregoing embodiment, which is not described in detail in this embodiment.
Further, the font size of the stroked text view control is set to a font size corresponding to the text effect, and the font color is set to the same color value as the stroked color. And setting the font color of the corresponding stroked text view control to be purple on the assumption that the stroked color of the corresponding layer stroked effect is purple.
S504: and drawing the text to be processed according to the corresponding stroking colors and the stroking widths based on each stroking text view control.
When the text to be processed is drawn, the characters drawn on the same stroke text view control and the strokes are in the same color.
S505: and initializing a text view control based on the text effect corresponding to the text to be processed.
S506: and setting font color based on the character effect.
S507: and drawing the text to be processed according to the font color based on the text view control.
S508: and overlapping the texts to be processed after the layering processing.
S509: displaying the stroke effect text in the stroke text box.
Fig. 8 is a display diagram of a text view control provided in an embodiment of the present application, fig. 9 is a display diagram of another text view control provided in an embodiment of the present application, and fig. 10 is a display diagram of another text view control provided in an embodiment of the present application. As shown in fig. 8-10, assuming that the multi-layer stroke effect is specifically a double-layer stroke effect, a stroke text view control corresponding to the two layers of stroke effects and a text view control corresponding to the text effect are correspondingly set, and shown in fig. 8 is the stroke text view control corresponding to the first-layer (bottom-layer) stroke effect, wherein the stroke color and the font color of the stroke text view control are both set to be purple, the stroke width is 1 pixel, and the display effect of the first-layer stroke text view control is as shown in fig. 8.
In fig. 9, a display screen in which the stroked text view control corresponding to the second layer of stroked effect is superimposed on the stroked text view control corresponding to the first layer of stroked effect is shown, the stroked color and the font color of the second layer of stroked text view control are both set to white, the stroked width is 0.5 pixel, and since both the character itself and the stroked side are white, the character itself corresponding to the second layer of display effect and the stroked side are integrated. After the second layer of the stroked text view control is overlaid on the first layer of the stroked text view control, the text to be processed of the second layer shields the text to be processed of the first layer, so that the text to be processed of the first layer only shows a stroked effect of 0.5 pixel width, and the effect is shown as shown in fig. 9.
Fig. 10 shows a display screen in which a text view control is superimposed on two layers of stroked text view controls, the font color of the text view control is set to red, the text itself of the red text to be processed is drawn, and after the text view control is superimposed on the second layer of stroked text view control, the text to be processed on the third layer (top layer) shields the text to be processed on the second layer, so that the text to be processed on the second layer only shows a stroked effect with a width of 0.5 pixel, and the multi-layer stroked effect shown in fig. 10 is achieved.
By setting the font color in the stroked text view control to be consistent with the stroked color, the character text view control is overlapped on the stroked text view control, the situation that display abnormity or interference occurs at the real edge between adjacent layers of texts to be processed is reduced, and the effect of multilayer stroked is effectively ensured.
In one possible embodiment, only the font color of the top stroked text view control may be set to be consistent with the stroked color, and the occurrence of abnormal display or interference of the real edge between adjacent layers of text to be processed may also be reduced.
Fig. 11 is a schematic structural diagram of a device for implementing a multi-layer text stroking effect according to an embodiment of the present application. Referring to fig. 11, the text multi-layer stroke effect implementation apparatus includes a text receiving module 61, an effect determining module 62, a stroke processing module 63, and a text display module 64.
The text receiving module 61 is configured to receive a text to be processed input into the stroked text box; an effect determining module 62, configured to determine, based on the set multi-layer stroking effect, a single-layer stroking processing mode corresponding to each layer of stroking effect; a stroke processing module 63, configured to perform character stroke processing on the text to be processed based on the single-layer stroke processing manner, so as to obtain a stroke effect text corresponding to a multi-layer stroke effect; a text display module 64 for displaying the stroked effect text in the stroked text box.
In the above, the single-layer stroke processing mode corresponding to each layer of stroke effect is determined based on the set multi-layer stroke effect, character stroke processing is performed on the text to be processed based on the corresponding single-layer stroke processing mode, the stroke effect text corresponding to the multi-layer stroke effect is obtained, the corresponding stroke effect text is displayed in the stroke text box, multi-layer stroke effect display of the text to be processed is achieved, and richer character stroke effects are achieved.
The embodiment of the application also provides computer equipment which can integrate the device for realizing the multilayer text stroking effect. Fig. 12 is a schematic structural diagram of a computer device according to an embodiment of the present application. Referring to fig. 12, the computer apparatus includes: an input device 73, an output device 74, a memory 72, and one or more processors 71; the memory 72 for storing one or more programs; when executed by the one or more processors 71, the one or more programs cause the one or more processors 71 to implement the method for implementing a text multi-layer stroke effect as provided in the above embodiments. The input device 73, the output device 74, the memory 72 and the processor 71 may be connected by a bus or other means, and fig. 12 illustrates the bus connection.
The memory 72 is a storage medium readable by a computing device and can be used for storing software programs, computer executable programs, and modules, such as program instructions/modules corresponding to the method for implementing the multi-layer character edge-tracing effect according to any embodiment of the present application (for example, the text receiving module 61, the effect determining module 62, the edge processing module 63, and the text display module 64 in the multi-layer character edge-tracing effect implementing apparatus). The memory 72 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the device, and the like. Further, the memory 72 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some examples, the memory 72 may further include memory located remotely from the processor 71, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 73 may be used to receive input numeric or character information and generate key signal inputs relating to user settings and function control of the apparatus. The output device 74 may include a display device such as a display screen.
The processor 71 executes various functional applications and data processing of the device by running software programs, instructions and modules stored in the memory 72, that is, implements the above-described text multi-layer stroke effect implementation method.
The device, the equipment and the computer for realizing the multi-layer character stroking effect can be used for executing the method for realizing the multi-layer character stroking effect provided by any embodiment, and have corresponding functions and beneficial effects.
The embodiment of the present application further provides a storage medium containing computer executable instructions, where the computer executable instructions are used to execute the method for implementing the multi-layer text stroke effect provided by the foregoing embodiment when executed by a computer processor, and the method for implementing the multi-layer text stroke effect includes: receiving a text to be processed input for the strode text box; determining a single-layer tracing processing mode corresponding to each layer of tracing effect based on the set multilayer tracing effect; performing character edge tracing processing on the text to be processed based on the single-layer edge tracing processing mode to obtain an edge tracing effect text corresponding to a multi-layer edge tracing effect; displaying the stroke effect text in the stroke text box.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application and containing computer-executable instructions is not limited to the above-mentioned method for implementing a text multi-layer stroke effect, and may also perform related operations in the method for implementing a text multi-layer stroke effect provided in any embodiments of the present application.
The device, the apparatus, and the storage medium for implementing a multi-layer text stroke effect provided in the foregoing embodiments may execute the method for implementing a multi-layer text stroke effect provided in any embodiments of the present application, and refer to the method for implementing a multi-layer text stroke effect provided in any embodiments of the present application without detailed technical details described in the foregoing embodiments.
The foregoing is considered as illustrative of the preferred embodiments of the invention and the technical principles employed. The present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the claims.

Claims (11)

1. A method for realizing a multi-layer character depicting effect is characterized by comprising the following steps:
receiving a text to be processed input for the strode text box;
determining a single-layer tracing processing mode corresponding to each layer of tracing effect based on the set multilayer tracing effect;
performing character edge tracing processing on the text to be processed based on the single-layer edge tracing processing mode to obtain an edge tracing effect text corresponding to a multi-layer edge tracing effect;
displaying the stroke effect text in the stroke text box.
2. The method for realizing multi-layer text stroke effect according to claim 1, wherein the determining a single-layer stroke processing mode corresponding to each layer stroke effect based on the set multi-layer stroke effect comprises:
and determining the stroke color and the stroke width corresponding to each layer of stroke effect based on the set multilayer stroke effect.
3. The method for implementing multi-layer character stroking effect according to claim 2, wherein the performing character stroking on the text to be processed based on the single-layer stroking manner includes:
carrying out layering processing on the text to be processed according to the drawing color and the drawing width corresponding to each layer of the drawing effect;
and overlapping the texts to be processed after the layering processing.
4. The method for realizing multi-layer character stroking effect according to claim 3, wherein the step of layering the text to be processed according to the stroking color and the stroking width corresponding to each layer of stroking effect comprises the following steps:
initializing a stroked text view control according to each layer of stroked effect, wherein the view position and the view size of each stroked text view control are kept consistent;
and drawing the text to be processed according to the corresponding stroking colors and the stroking widths based on each stroking text view control.
5. The method of claim 4, wherein after rendering the text to be processed according to the corresponding stroke color and stroke width based on each of the stroke text view controls, further comprising:
initializing a text view control based on the text effect corresponding to the text to be processed;
setting font color based on the character effect;
and drawing the text to be processed according to the font color based on the text view control.
6. The method for realizing multi-layer character stroking effect according to claim 3, wherein the step of layering the text to be processed according to the stroking color and the stroking width corresponding to each layer of stroking effect comprises the following steps:
and sequentially determining the stroking color and the stroking width corresponding to the stroking effect of each layer from the bottommost layer, and processing the text to be processed of each layer by layer, wherein the stroking colors of adjacent layers are different, and the stroking widths of different layers are gradually decreased layer by layer.
7. The method for realizing a multi-layer character stroking effect according to claim 6, wherein a stroking width corresponding to the stroking effect of each layer is a difference between a stroking width of a lower layer stroking and a visual width, and the visual width is a visual width of the stroking effect of the corresponding layer.
8. The method for realizing multi-layer text stroke effect according to claim 1, wherein the determining a single-layer stroke processing mode corresponding to each layer stroke effect based on the set multi-layer stroke effect comprises:
and determining the stroke color, stroke width and font color corresponding to the stroke effect of each layer based on the set multilayer stroke effect, wherein the font color and the stroke color of the same layer are consistent.
9. The device for realizing the multi-layer character stroke effect is characterized by comprising a text receiving module, an effect determining module, a stroke processing module and a text display module, wherein:
the text receiving module is used for receiving a text to be processed input into the stroke text box;
the effect determining module is used for determining a single-layer tracing processing mode corresponding to each layer of tracing effect based on the set multilayer tracing effect;
the stroke processing module is used for carrying out character stroke processing on the text to be processed based on the single-layer stroke processing mode so as to obtain a stroke effect text corresponding to a multi-layer stroke effect;
and the text display module is used for displaying the stroking effect text in the stroking text box.
10. A computer device, comprising: a memory and one or more processors;
the memory for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-8.
11. A storage medium containing computer-executable instructions for performing the method of any one of claims 1-8 when executed by a computer processor.
CN202011038820.1A 2020-09-28 2020-09-28 Method, device and equipment for realizing multilayer character edge tracing effect and storage medium Pending CN112329385A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011038820.1A CN112329385A (en) 2020-09-28 2020-09-28 Method, device and equipment for realizing multilayer character edge tracing effect and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011038820.1A CN112329385A (en) 2020-09-28 2020-09-28 Method, device and equipment for realizing multilayer character edge tracing effect and storage medium

Publications (1)

Publication Number Publication Date
CN112329385A true CN112329385A (en) 2021-02-05

Family

ID=74302953

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011038820.1A Pending CN112329385A (en) 2020-09-28 2020-09-28 Method, device and equipment for realizing multilayer character edge tracing effect and storage medium

Country Status (1)

Country Link
CN (1) CN112329385A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220189090A1 (en) * 2020-04-21 2022-06-16 Canva Pty Ltd Systems and methods for applying effects to design elements

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124666A (en) * 2017-04-21 2017-09-01 深圳市普天宜通技术股份有限公司 A kind of yuv video captions retouch side method and system
CN108986193A (en) * 2018-07-10 2018-12-11 武汉国遥新天地信息技术有限公司 It is a kind of three-dimensional text retouch side method for drafting

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107124666A (en) * 2017-04-21 2017-09-01 深圳市普天宜通技术股份有限公司 A kind of yuv video captions retouch side method and system
CN108986193A (en) * 2018-07-10 2018-12-11 武汉国遥新天地信息技术有限公司 It is a kind of three-dimensional text retouch side method for drafting

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
史晓燕 等: "网络广告设计与制作", vol. 1, 31 March 2014, 武汉:华中科技大学出版社, pages: 56 - 58 *
将哥哥: "自定义TextView实现文字描边功能", pages 1 - 2, Retrieved from the Internet <URL:https://blog.csdn.net/u011932309/article/details/95475986> *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220189090A1 (en) * 2020-04-21 2022-06-16 Canva Pty Ltd Systems and methods for applying effects to design elements
US11763505B2 (en) * 2020-04-21 2023-09-19 Canva Pty Ltd Systems and methods for applying effects to design elements

Similar Documents

Publication Publication Date Title
EP3220249B1 (en) Method, device and terminal for implementing regional screen capture
CN102356375B (en) Smooth layout animation of continuous and non-continuous properties
US8423909B2 (en) System and method for an interactive filter
US8760464B2 (en) Shape masks
CN110928459B (en) Writing operation method, device, equipment and storage medium of intelligent interactive tablet
US20150172534A1 (en) Electronic camera, image display device, and storage medium storing image display program
US20230084269A1 (en) Screenshot method, terminal, and non-transitory computer-readable storage medium
CN109324722B (en) Method, device and equipment for adding nodes of thought guide graph and storage medium
US11039196B2 (en) Method and device for displaying a screen shot
US20090282325A1 (en) Sparklines in the grid
AU2019457052B2 (en) Table processing method and apparatus, and intelligent interactive tablet and storage medium
CN109032446B (en) Method, device, equipment and storage medium for generating node relation of thinking guide graph
CN103425452A (en) Multi-layer overlapping display method and device for mobile terminal
CN109710362B (en) Screenshot processing method, computing device and computer storage medium
CN111782114B (en) Element display method, device, equipment and medium in manuscript editing application
US10241651B2 (en) Grid-based rendering of nodes and relationships between nodes
CN112329385A (en) Method, device and equipment for realizing multilayer character edge tracing effect and storage medium
US10650576B1 (en) Snapping experience with clipping masks
US20190179507A1 (en) Method, Device and Computer Storage Medium for Multichannel Touch Control of All-in-One Machine
CN112329383A (en) Method, device and equipment for realizing character edge tracing effect and storage medium
CN112329384A (en) Method, device and equipment for realizing character shadow effect and storage medium
EP0775980A2 (en) Image processing apparatus
CN113625931A (en) Desktop switching method, computing device and readable storage medium
CN112269520A (en) Element display control method and device, interactive panel and storage medium
KR20190115401A (en) Method, apparatus and program for linked view

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