Text animation generation method and device, electronic equipment and storage medium
By obtaining and processing the font data of the input text, generating text animations, and changing character outlines with different variation rules, the problem of insufficient animation effects of single character in the prior art is solved, and the flexibility and visual expressiveness of text animation are improved.
Patent Information
- Application Number
- CN202510230968.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-17
AI Technical Summary
The prior art cannot achieve independent animation effects for a single character, resulting in low flexibility in text animation and single visual expression.
By obtaining the font data of the input text, including vector information and text animation information, text animation is generated, so that the character outlines of at least two text characters change over time with different variation rules.
It realizes the independent animation effect of a single character, improving the flexibility and visual expressiveness of text animation.
Smart Images

Figure CN120163126A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of image processing technologies, and in particular, to a method, apparatus, electronic device, and storage medium for generating text animations. Background Art
[0002] Currently, as a text information display method with good visual effects and low production costs, text animations are widely used in the production processes of websites, applications (APPs), and short videos, making the expression of text information more vivid and beautiful.
[0003] In the prior art, text animations are usually implemented based on pre-configured text animation templates. Through the text animation templates, global animations can be added to the input text, that is, each character in each text moves based on the same rule.
[0004] However, the text animation implementation solutions in the prior art cannot achieve independent animation effects for individual characters, resulting in problems of low flexibility and single visual expressiveness of text animations. Summary of the Invention
[0005] Embodiments of the present disclosure provide a method, apparatus, electronic device, and storage medium for generating text animations to overcome the problem that independent animation effects for individual characters cannot be achieved.
[0006] In a first aspect, embodiments of the present disclosure provide a method for generating a text animation, including:
[0007] Obtain an input text, where the input text includes at least one text character; according to the input text, obtain font data corresponding to the text characters in the input text, where the font data includes vector information and text animation information corresponding to the text characters, and where the vector information is used to represent the standard character contour of the text character, and the text animation information is used to control the deformation of the text character; generate a text animation of the input text according to the font data, where the character contours of at least two text characters in the text animation change with time according to different change rules.
[0008] In a second aspect, embodiments of the present disclosure provide a text animation generation apparatus, including:
[0009] An obtaining module, configured to obtain an input text, where the input text includes at least one text character;
[0010] A font module, configured to obtain font data corresponding to text characters in the input text according to the input text, where the font data includes vector information and text animation information corresponding to the text characters, and wherein the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters;
[0011] A generation module, configured to generate a text animation of the input text according to the font data, wherein the character outlines of at least two text characters in the text animation change with time according to different change rules.
[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0013] The memory stores computer-executable instructions;
[0014] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text animation generation method described in the first aspect and various possible designs of the first aspect as above.
[0015] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the text animation generation method described in the first aspect and various possible designs of the first aspect as above is implemented.
[0016] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, the text animation generation method described in the first aspect and various possible designs of the first aspect as above is implemented.
[0017] The text animation generation method, device, electronic device, and storage medium provided in this embodiment obtain an input text, where the input text includes at least one text character; according to the input text, obtain the font data corresponding to the text characters in the input text, where the font data includes the vector information and text animation information corresponding to the text characters, and where the vector information is used to represent the standard character outline of the text character, and the text animation information is used to control the deformation of the text character; according to the font data, generate the text animation of the input text, where the character outlines of at least two text characters in the text animation change with time according to different change rules. By obtaining font data containing text animation information corresponding to different characters and utilizing the characteristic that the text animation information can represent the maximum deformation vector of the standard character outline for a single character, the character outlines of the text characters in the generated text animation change with time according to different change rules, thereby realizing the independent animation effect of a single character, and further improving the flexibility and visual expressiveness of the text animation. Description of the Drawings
[0018] To more clearly illustrate the technical solutions in the embodiments of the present disclosure or in the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0019] Figure 1 It is an application scenario diagram of the text animation generation method provided in the embodiments of the present disclosure;
[0020] Figure 2 It is a flowchart of the text animation generation method provided in the embodiments of the present disclosure Figure 1 ;
[0021] Figure 3 It is a schematic diagram of vector information and text animation information provided in the embodiments of the present disclosure;
[0022] Figure 4 It is a flowchart of the text animation generation method provided in the embodiments of the present disclosure Figure 2 ;
[0023] Figure 5 For Figure 4 It is a flowchart of the specific implementation manner of step S203 in the illustrated embodiment;
[0024] Figure 6 For Figure 5 It is a flowchart of a specific implementation manner of step S2031 in the illustrated embodiment;
[0025] Figure 7 For Figure 5 The flowchart of another specific implementation manner of step S2031 in the illustrated embodiment;
[0026] Figure 8 The schematic diagram of the process for determining the actual offset information based on the second animation configuration provided by the embodiment of the present disclosure;
[0027] Figure 9 For Figure 5 The flowchart of the specific implementation manner of step S2032 in the illustrated embodiment;
[0028] Figure 10 The structural block diagram of the text animation generation device provided by the embodiment of the present disclosure;
[0029] Figure 11 The structural schematic diagram of an electronic device provided by the embodiment of the present disclosure;
[0030] Figure 12 The hardware structural schematic diagram of the electronic device provided by the embodiment of the present disclosure. Specific implementation manners
[0031] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are some but not all of the embodiments of the present disclosure. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present disclosure without making creative efforts shall fall within the protection scope of the present disclosure.
[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present disclosure are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of relevant countries and regions, and corresponding operation entrances are provided for the user to select authorization or rejection.
[0033] The application scenarios of the embodiments of the present disclosure are explained below:
[0034] The text animation generation method provided by the embodiments of the present disclosure can be applied to an application program (APP, Application) with text animation generation functions, such as video editing application programs, animation editing application programs, etc. More specifically, it can be applied to the application scenario of adding text animations to a target video during the process of video editing. The execution entity of this embodiment can be a terminal device running the above-mentioned application program with text animation generation functions, or a server deploying the server side corresponding to the above-mentioned application program, or other electronic devices with similar functions. Among them, when the execution entity is a terminal device, the terminal device executes the method provided by this embodiment by running the above-mentioned application program; when the execution entity is a server, the server side of the above-mentioned application program with text animation generation functions can run partially or entirely on the server, and execute the method provided by this embodiment on the server side, while the terminal device runs the client of the application program. Based on the server-client communication between the server and the terminal device, the terminal device can obtain the execution result of the method provided by this embodiment and display it as needed.
[0035] Among them, in some embodiments, the terminal device or the server can implement the text animation generation method provided by the embodiments of the present disclosure by running various computer-executable instructions or computer programs. For example, the computer-executable instructions can be program-level commands, machine instructions, or software instructions. The computer program can be a native program or software module in the operating system; it can be a local application program, that is, a program that needs to be installed in the operating system to run, or a small program embedded in any APP, that is, a program running based on the browser environment. In summary, the above-mentioned computer-executable instructions can be instructions in any form, and the above-mentioned computer programs can be application programs, modules, or plugins in any form, and the specific implementation form can be configured according to needs. Further, during the process of implementing the text animation generation method provided by the embodiments of the present disclosure, the terminal device can execute the method by running computer-executable instructions or computer programs set locally, or by calling computer-executable instructions or computer programs set in an external server. In some embodiments, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud storage, cloud communication, cloud databases, cloud computing, cloud functions, network services, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms. Among them, the cloud service can be an interactive processing service for the terminal device to call.
[0036] Figure 1This is an application scenario diagram of the text animation generation method provided by the embodiments of the present disclosure. Refer to Figure 1 As shown in
[0037] Taking a terminal device as an example, a target application with text animation generation function runs in the terminal device. The user inputs the text to be processed through the interaction interface of the target application. After that, the terminal device adds animation effects to the text to be processed through a previously or subsequently selected text animation template, so as to generate an animation whose outline and position can change over time, that is, a text animation. For example, as shown in the figure, after the user inputs the text "ABC" and selects the text animation effect #1, the terminal device generates a corresponding text animation through the target application, that is, an animation in which the outlines of the characters "A", "B", and "C" in the text change over time.
[0038] The embodiments of the present disclosure provide a text animation generation method to solve the above problems.
[0039] Refer to Figure 2 , Figure 2 This is a flowchart of the text animation generation method provided by the embodiments of the present disclosure. Figure 1 The method of this embodiment can be applied to a terminal device or a server. The text animation generation method includes:
[0040] Step S101: Obtain the input text, where the input text includes at least one text character.
[0041] Step S102: According to the input text, obtain the font data corresponding to the text characters in the input text. The font data includes the vector information corresponding to the text characters and the text animation information. The vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters.
[0042] Exemplarily, refer to Figure 1As shown in the schematic diagram of the application scenario, first, the terminal device receives the text input by the user, i.e., the input text, by running the target application and through the interactive interface of the target application. The input text includes at least one text character, and the text character can be any identifier such as a word, letter, number, expression, etc. Specifically, for example, the content of the input text is "The weather is good!". Then the input text is composed of five text characters: "天", "氣", "不", "错", and "!". Of course, in another possible implementation, the text characters may not include punctuation, that is, the above-mentioned input text is composed of four text characters: "天", "氣", "不", and "错", which can be set as needed.
[0043] After that, based on the above input text, the terminal device obtains the font data corresponding to each text character in the input text. The font data can be stored in the program file of the target application, that is, stored locally on the terminal device. The terminal device directly obtains the font data of the above text characters by reading the program file. In another possible implementation, the font data is stored in the cloud, such as the server of the target application. By retrieving the above text characters in the cloud, the corresponding font data is obtained. The font data can be designed and generated in advance for common text characters. The specific production method of the font data can be set as needed and will not be specifically limited here. Further, in the font data, vector information and text animation information corresponding to the text characters are included. The vector information is used to represent the standard character outline of the text character, and the text animation information is used to control the deformation of the text character. In one possible implementation, the text animation information is used to represent the maximum deformation vector for the standard character outline. Specifically, the vector information can be a kind of outline information used to describe the font outline. Different fonts can be distinguished through the vector information, and characters of different fonts correspond to different vector information. In one possible implementation, the vector information includes at least two contour identifiers, and the contour identifiers are used to represent the coordinates of the contour points that make up the standard character outline of the text character. That is, the vector information corresponding to the text character is a set of coordinate points, and each coordinate point corresponds to a contour point, so as to describe the font outline through the set of coordinate points. Among them, the contour points include the first contour points located on the standard character outline and the second contour points located outside the standard character outline. The first contour points are the drawing points of the standard character outline, and the second contour points are the control points for controlling the line shape between two drawing points. Specifically, the drawing points are the points used to draw irregular lines. By connecting multiple first contour points in sequence, an irregular line can be formed, that is, the standard character outline. And the second contour points are points located outside the standard character outline, that is, the control points in the Bezier curve. Through this control, the shape of the line between two drawing points can be adjusted. The specific implementation method of representing the font outline through drawing points and control points will not be elaborated here. The text animation information is a kind of information used to describe the change relative to the standard character outline. Specifically, that is, the text animation information is used to represent the maximum deformation vector for the standard character outline. In one possible implementation, the text animation information includes offset identifiers corresponding one by one to each contour identifier, and the offset identifiers are used to represent the offset vectors relative to the corresponding contour points, that is, the offset distance and direction relative to each contour point of the standard character outline. Based on the text animation information and the above vector information, another deformed font outline, that is, the maximum deformation vector of the standard character outline, can be determined.The text animation information corresponds one-to-one with the text characters. Therefore, each text character corresponds to a deformed font outline, that is, the maximum deformation vector for the standard character outline. In subsequent steps, the outline of the text font can vary between the standard font outline and the deformed font outline described above, thereby achieving an animation effect for the character.
[0044] Figure 3 FIG. is a schematic diagram of vector information and text animation information provided by an embodiment of the present disclosure. The following will be described in conjunction with Figure 3 the above steps. As Figure 3 shown, by way of example, the vector information is a set of coordinates of the contour points describing the standard character outline L1 of the text character, such as the points p1, p2, p3, and p4 shown in the figure. Among them, p1, p2, and p3 are the first contour points, and p4 is the second contour point. The text animation information includes offset vectors for each of the above contour points. For example, the offset vector v1 corresponding to the p1 point, the offset vector v2 corresponding to the p2 point, the offset vector v3 corresponding to the p3 point, and the offset vector v4 corresponding to the p4 point shown in the figure. According to the offset vectors included in the above text animation information, another contour line L2 can be obtained, that is, the contour line corresponding to the maximum deformation vector. The content of the animation formed by the text font later is the process of the contour line of the text font moving between the contour line L1 and the contour line L2.
[0045] Step S103: Generate a text animation of the input text according to the font data, wherein the character outlines of at least two text characters in the text animation change with time according to different change rules.
[0046] By way of example, after obtaining the font data based on the above steps, since the font data contains text animation information corresponding to the text characters, based on the vector information and text animation information corresponding to each text character, an independent animation corresponding to the text font can be generated, and the combination of the independent animations corresponding to each text character is the text animation of the input text. In the specific implementation process, first, according to the font data, each text character is drawn as a character bitmap at different time nodes. For example, if the text animation is an animation video or a GIF with a duration of one second and 10 frames per second, then for each text byte in the input text, a corresponding 10-frame character bitmap is generated. Then, the character bitmaps of the text bytes corresponding to the generated sequence are combined into one animation frame. In this way, 10 animation frames can be obtained, and then based on the 10 animation frames, a text animation with a duration of 1 second and a frame rate of 10 frames per second is generated. In the above process, since the character bitmap corresponding to each text character in the input text is independently generated based on its own text animation information, the character outlines of the text characters in the generated text animation can change with time according to different change rules, achieving an independent animation effect for each text character.
[0047] By obtaining input text, the input text includes at least one text character; according to the input text, obtaining font data corresponding to the text characters in the input text, the font data includes vector information and text animation information corresponding to the text characters, wherein the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters; according to the font data, generating a text animation of the input text, wherein the character outlines of at least two text characters in the text animation change with time according to different change rules. By obtaining font data containing text animation information corresponding to different characters, and using the characteristic that the text animation information can represent the maximum deformation vector of the standard character outline for a single character, the character outlines of the text characters in the generated text animation change with time according to different change rules, so as to achieve an independent animation effect for a single character, and further improve the flexibility and visual expressiveness of the text animation.
[0048] Reference Figure 4 , Figure 4 is a schematic flowchart of a text animation generation method provided by an embodiment of the present disclosure Figure 2 . This embodiment further refines step S103 on the basis of the embodiment shown in Figure 2 . The text animation generation method includes:
[0049] Step S201: Obtain input text, and the input text includes at least one text character.
[0050] Step S202: According to the input text, obtain font data corresponding to the text characters in the input text, the font data includes vector information and text animation information corresponding to the text characters, wherein the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters.
[0051] Step S203: Generate target signed distance field data corresponding to a time series according to the font data of the target text character.
[0052] Step S204: Draw a character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series.
[0053] Step S205: Generate a text animation of the target text character based on the character bitmap corresponding to the time series.
[0054] Exemplarily, signed distance field data, also known as Signed Distance Field (SDF) map, is a kind of map data that represents the distance between a pixel or a voxel and the surrounding pixels or voxels. Among them, if a certain pixel or voxel is inside the object, its distance value is negative; if it is outside the object, the distance value is positive; if it is exactly on the object boundary, the distance value is zero. This representation method enables the SDF map to accurately describe the shape and contour of the object. Specifically, in this embodiment, the target text character is at least one text character in the input text. In a specific implementation manner, each text character in the input text can be determined as the target text character in sequence or simultaneously, and subsequent processing steps are executed to generate the text animation of each target text character. Specifically, taking the case of processing a specific target text character as an example, first, a time series is generated, or a pre-generated time series is obtained. This time series can have a specified duration and / or a specified number of time nodes. Through this time series, the frame rate and duration of the subsequent generated text animation can be controlled. The specific generation method and implementation manner of the time series can be set as needed and will not be elaborated here. Among them, further, the time series includes at least two time nodes, such as N time nodes. In a possible implementation manner, this time series is corresponding to the input text, that is, the terminal device generates a time series including N time nodes based on this input text. Each text character in the input text shares this time series and generates N signed distance field data respectively, that is, the target signed distance field data. In another possible implementation manner, each text character corresponds to a time series, that is, in a possible implementation manner, different text characters correspond to time series with different durations and numbers of time nodes. In this embodiment, taking the case where each text character corresponds to the same time series as an example, based on this time series, the target signed distance field data corresponding to the target text character is generated. For example, if the time series contains 10 ordered time nodes, the target signed distance field data corresponding to this time series includes 10 signed distance field data corresponding one-to-one to the time nodes, that is, 10 SDF maps are generated, and each SDF map corresponds to one time node in the time series.
[0055] Furthermore, in a possible implementation manner for the process of generating the above-mentioned target signed distance field data, the content recorded in the text animation information is related to the content in the signed distance field data. The corresponding signed distance field data can be generated by inputting the text animation information into a corresponding processing function. Specifically, for example, the text animation information represents the maximum deformation vector for the standard character contour. Each time node in the time series is mapped to an ordered serial number within a finite range, and then each serial number is mapped to an offset. After that, on the basis of the maximum deformation vector, the offset mapped by the serial number is added respectively, and an offset sequence related to the time series can be obtained, that is, the target signed distance field data corresponding to the time series.
[0056] In another possible implementation manner, as Figure 5 shown, the specific implementation manner of step S203 includes:
[0057] Step S2031: For the target time node, obtain the corresponding first drawing parameter, and the first drawing parameter is used to represent the weighting coefficient of the maximum deformation vector for the standard character contour at the target time node.
[0058] Step S2032: According to the first drawing parameter and the text animation information in the font data corresponding to the target text character, obtain the actual offset information, and the actual offset information represents the actual deformation amount of the standard character contour for the target text character.
[0059] Step S2033: According to the actual offset information and the vector information, obtain the target signed distance field data corresponding to the target time node.
[0060] Among them, the target time node can be any time node in the time series, that is, for any time node in the time series, the above steps can be used for processing. Exemplarily, for the target time node, the first drawing parameter having a mapping relationship therewith is obtained. The first drawing parameter is used to characterize the weighting coefficient of the maximum deformation vector for the standard character contour under the target time node. Among them, the first drawing parameter is used to indicate the deformation amount of each contour point under the target time node, that is, the weighting coefficient of the maximum deformation vector for the standard character contour. Specifically, the first drawing parameter can be a coefficient value, such as 0.8; it can also be a coefficient vector, such as [0.5, 0.8], that is, a coefficient describing both size and direction changes. In a more specific embodiment, for example, the time series includes multiple time nodes such as time node T1 and time node T2. For time node T1, that is, taking time node T1 as the target time node, its corresponding weighting coefficient is 0.8; for time node T2, that is, taking time node T2 as the target time node, its corresponding weighting coefficient is 0.72. Then, according to the first drawing parameter and the text animation information in the font data corresponding to the target text character, the actual offset information is obtained. For example, multiplying the above first drawing parameter (weighting coefficient) by the maximum deformation vector characterized by the text animation information can obtain the actual offset information. This first drawing parameter is equivalent to a control parameter for the deformation amount of the contour of the target text character. Exemplarily, after obtaining the first drawing parameters corresponding to the above time nodes, calculate to control the change of the font contour by changing the first drawing parameters corresponding to different target time nodes. Finally, for each time node, according to the actual offset information and the vector information, such as calculating the vector sum of the two, the signed distance field data corresponding to each time node is generated, and finally the target signed distance field data corresponding to the time series is obtained.
[0061] Further, the first drawing parameter can be a value corresponding one-to-one with the target time node. When the target time nodes in the time series are linearly distributed, the first drawing parameter also changes linearly. For example, the first drawing parameters for the same time series are 0.1, 0.2, 0.3, etc. In another possible implementation, the first drawing parameter can have a more complex variation law based on the target time node, so as to achieve a more complex text animation effect. In one possible implementation, as Figure 6 shown, the specific manner of step 2031 includes:
[0062] Step 2031-1: Obtain the first animation configuration information for the input text. The first animation configuration information is used to characterize the variation law of the weighting coefficient of the maximum deformation amount for the standard character contour over time.
[0063] Step 2031-2: Obtain first drawing parameters according to the first animation configuration information and the target time node.
[0064] Exemplarily, the first animation configuration information is information characterizing the variation law of the weighting coefficient of the maximum deformation amount with time for the input text, that is, the shape change information of all characters of the input text. This first animation configuration information can be determined based on an animation template. That is, after the user selects a certain text animation template in the target application, the first animation configuration information stored in the text animation template can be obtained. The variation law of the weighting coefficient with time characterized by this first animation configuration information can be linear or non-linear, so that the animation effect of the final text animation's contour change does not present a non-linear change effect, thereby improving the visual perception of the text animation.
[0065] In another possible implementation manner, the font data further includes second animation configuration information, which is used to characterize the variation law of the weighting coefficient of the maximum deformation amount of the standard character contour for the target text character, as Figure 7 shown, the specific manner of step 2031 includes:
[0066] Step 2031-3: Obtain the second animation configuration information for the target text character.
[0067] Step 2031-4: Obtain first drawing parameters according to the second animation configuration information and the target time node.
[0068] Exemplarily, in another possible implementation manner, in the font data of the target text character, there is also second animation configuration information characterizing the variation law of the weighting coefficient of the maximum deformation amount of the standard character contour for the target text character. Different from the first animation configuration for the input text, this second animation configuration information is the configuration information for a single text character. Through this second animation configuration information, the weighting coefficient of a single target text character at different time nodes can be realized, so that different target texts can have different weighting coefficients for the maximum deformation amount of the standard character contour at the same time node, and thus a more flexible and variable text animation mode can be realized.
[0069] Figure 8 FIG. is a schematic diagram of a process for determining actual offset information based on the second animation configuration provided by an embodiment of the present disclosure. The above solution will be further introduced below in conjunction with Figure 8 as Figure 8As shown, exemplarily, for the target text character "A" in the input text, its font outline is composed of multiple outline points. Taking the outline points p1, p2, and p3 shown in the figure as examples, the maximum outline vectors corresponding to the outline points p1, p2, and p3 are V1, V2, and V3 respectively. On this basis, according to the second animation configuration information of the target text character "A", at time node t1, the first drawing parameter val_p1 corresponding to the outline point p1 = 0.5, the first drawing parameter val_p2 corresponding to the outline point p2 = 0.6, and the first drawing parameter val_p3 corresponding to the outline point p3 = 0.8. Schematically, according to the first drawing parameters corresponding to each outline point, the actual offset vectors (i.e., actual offset information, the same below) corresponding to the outline point p1 are obtained as v11, the actual offset vector v12 corresponding to the outline point p2, and the actual offset vector v13 corresponding to the outline point p3; at time node t2, the first drawing parameter corresponding to the outline point p1 is 0.7, the first drawing parameter corresponding to the outline point p2 is 0.8, and the first drawing parameter corresponding to the outline point p3 is 0.4. According to the first drawing parameters corresponding to each outline point, the actual offset vectors (i.e., actual offset information, the same below) corresponding to the outline point p1 are obtained as v21, the actual offset vector v22 corresponding to the outline point p2, and the actual offset vector v23 corresponding to the outline point p3. And so on. At different time nodes, the actual deformation amounts corresponding to each outline point can change independently, so that the font outline of the target text character "A" composed of the above outline points can achieve more complex shape changes, thereby improving the diversity of the motion styles and visual expressiveness of each text character in the finally generated text animation.
[0070] Further, exemplarily, the text animation information includes a vector set composed of a target number of vector values. The target number is the number of outline points of the standard character outline of the target text character, and each vector value corresponds one-to-one to an outline point of the standard character outline of the text character. As Figure 9 shown, the specific implementation manner of step S2032 includes:
[0071] Step S2032-1: Obtain the offset vectors corresponding to each outline point according to the product of each vector value in the vector set and the first drawing parameter;
[0072] Step S2032-2: Obtain the actual offset information according to the offset vectors corresponding to each outline point.
[0073] Exemplarily, the text animation information includes a vector set composed of a target number of vector values. Each vector value corresponds to a contour point of the standard character outline of a target text character and is used to describe the deformation of the contour point. The first drawing parameter can be used to indicate the deformation amount (weighting coefficient) of each contour point at the target time node. The first drawing parameter can be a coefficient value or a coefficient vector. After obtaining the first drawing parameter, based on the same time node, calculate the product of the first drawing parameter and the corresponding vector value to obtain the offset vector of the contour point corresponding to the vector value. Furthermore, based on the offset vectors corresponding to each contour point, obtain the actual offset information.
[0074] Furthermore, in a possible implementation manner, the font data further includes color animation information, which is used to represent the starting color value and the ending color value of the font color of the text character of the clock hand; for example, both the starting color value and the ending color value are represented by RGB color values. Then, according to the above color animation information in the font data, during the process of forming the text animation, control the font color to also change, so that in the generated text animation, the font colors of the character outlines of at least two text characters change with time according to different change rules.
[0075] Specifically, for the above situation, that is, when the font data includes the vector information, text animation information, and color animation information corresponding to the text character, the specific implementation manner of step S204 includes:
[0076] Step S204A: Obtain the color change data corresponding to the time series;
[0077] Step S204B: Draw the character bitmap corresponding to the time series according to the target signed distance field data and the color change data corresponding to the time series.
[0078] Exemplarily, referring to the step of generating the target signed distance field data corresponding to the time series according to the font data of the target text character in step S203, in this embodiment, according to the font data of the target text character, obtain the color change data corresponding to the time series. Specifically, for example, first, for each target time node in the generated time series, obtain the corresponding second drawing parameter, where the second drawing parameter is used to represent the weighting coefficient for the font color at the target time node; then, according to the second drawing parameter, the starting color value, and the ending color value in the font data corresponding to the target text character, obtain the actual color information, where the actual color information represents the actual font color of the target text character at the target time node. Finally, according to the target signed distance field data and the color change data corresponding to the time series, perform font rendering to draw the character bitmap corresponding to the target time node, and repeat or execute the above steps in parallel, and then obtain the character bitmap corresponding to the time series.
[0079] In this embodiment, by using the starting color value and the ending color value in the sub-font data, independent control of the font color of each text character in the input text is achieved, so that the generated text animation has a changing visual expression.
[0080] In this embodiment, the implementation manners of steps S201 - S202 are the same as those of steps S101 - S102 in the embodiment shown in this disclosure Figure 2 and will not be elaborated herein one by one.
[0081] Corresponding to the text animation generation method in the above embodiment, Figure 10 is a structural block diagram of a text animation generation device provided by an embodiment of this disclosure. The method introduced in the above embodiment can be executed by this text animation generation device, and the device can be implemented in a software and / or hardware manner and can be integrated in an electronic device with certain data processing capabilities. Among them, the electronic device may include, but is not limited to, a mobile terminal with big data processing capabilities, and a fixed terminal such as a desktop computer and a supercomputer with big data processing capabilities.
[0082] For ease of explanation, only parts related to the embodiments of this disclosure are shown. Referring to Figure 10 , the text animation generation device 3 includes:
[0083] An acquisition module 31, configured to acquire an input text, where the input text includes at least one text character;
[0084] A font module 32, configured to acquire font data corresponding to the text characters in the input text according to the input text. The font data includes vector information corresponding to the text characters and text animation information, where the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters;
[0085] A generation module 33, configured to generate a text animation of the input text according to the font data, where the character outlines of at least two text characters in the text animation change with time according to different change rules.
[0086] According to one or more embodiments of this disclosure, the generation module 33 is specifically configured to: generate target signed distance field data corresponding to a time series according to the font data of a target text character; draw a character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series; and generate a text animation of the target text character based on the character bitmap corresponding to the time series.
[0087] According to one or more embodiments of the present disclosure, the time series includes at least two time nodes. When generating the target signed distance field data corresponding to the time series according to the font data of the target text characters, the generating module 33 is specifically configured to: for a target time node, obtain a corresponding first drawing parameter, where the first drawing parameter is used to characterize the weighting coefficient of the maximum deformation vector for the standard character contour at the target time node; obtain actual offset information according to the first drawing parameter and the text animation information in the font data corresponding to the target text characters, where the actual offset information characterizes the actual deformation amount of the standard character contour of the target text characters; and obtain the target signed distance field data corresponding to the target time node according to the actual offset information and the vector information.
[0088] According to one or more embodiments of the present disclosure, when obtaining the first drawing parameter for a target time node, the generating module 33 is specifically configured to: obtain first animation configuration information for the input text, where the first animation configuration information is used to characterize the variation law of the weighting coefficient of the maximum deformation amount for the standard character contour over time; and obtain the first drawing parameter according to the first animation configuration information and the target time node.
[0089] According to one or more embodiments of the present disclosure, the font data further includes second animation configuration information, where the second animation configuration information is used to characterize the variation law of the weighting coefficient of the maximum deformation amount for the standard character contour of the target text characters over time; when obtaining the first drawing parameter for a target time node, the generating module 33 is specifically configured to: obtain the second animation configuration information for the target text characters; and obtain the first drawing parameter according to the second animation configuration information and the target time node.
[0090] According to one or more embodiments of the present disclosure, the text animation information includes a vector set composed of a target number of vector values, and each vector value corresponds to a contour point of the standard character contour of the target text characters one by one; when obtaining the actual offset information according to the first drawing parameter and the text animation information in the font data corresponding to the target text characters, the generating module 33 is specifically configured to: obtain the offset vector corresponding to each contour point according to the product of each vector value in the vector set and the first drawing parameter; and obtain the actual offset information according to the offset vectors corresponding to each contour point.
[0091] According to one or more embodiments of the present disclosure, the font data further includes color animation information, where the color animation information is used to indicate the starting color value and the ending color value of the font color of the text characters; the font colors of the character contours of at least two text characters in the text animation change over time according to different change rules.
[0092] According to one or more embodiments of the present disclosure, when generating module 33 draws a character bitmap corresponding to a time series based on target signed distance field data corresponding to the time series, it is specifically configured to: obtain color change data corresponding to the time series; draw a character bitmap corresponding to the time series based on the target signed distance field data and the color change data corresponding to the time series.
[0093] According to one or more embodiments of the present disclosure, the vector information includes at least two contour identifiers, and the contour identifier is used to represent the coordinates of the contour points of the standard character contour that constitutes the text character; the text animation information includes offset identifiers corresponding one-to-one to at least two contour identifiers, and the offset identifier is used to represent an offset vector relative to the corresponding contour point.
[0094] Among them, the acquisition module 31, the font module 32, and the generation module 33 are connected in sequence. The text animation generation device 3 provided in this embodiment can execute the technical solutions of the above method embodiments, and its implementation principle and technical effects are similar, which will not be elaborated here in this embodiment.
[0095] Figure 11 The following is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As Figure 11 shown, the electronic device 4 includes:
[0096] a processor 41 and a memory 42 communicatively connected to the processor 41;
[0097] The memory 42 stores computer-executable instructions;
[0098] The processor 41 executes the computer-executable instructions stored in the memory 42 to implement the text animation generation method in the embodiment as Figures 2 - 9 shown.
[0099] Optionally, the processor 41 and the memory 42 are connected through a bus 43.
[0100] For relevant descriptions, reference can be made to Figures 2 - 9 the relevant descriptions and effects corresponding to the steps in the corresponding embodiments for understanding, and no further elaboration will be made here.
[0101] An embodiment of the present disclosure provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, they are used to implement the text animation generation method provided in any one of the embodiments corresponding to the present disclosure Figures 2 - 9 .
[0102] An embodiment of the present disclosure provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the text animation generation method provided in any one of the embodiments corresponding to the present disclosure Figures 2 - 9 .
[0103] To implement the above embodiments, embodiments of the present disclosure also provide an electronic device.
[0104] Referring to Figure 12 , which shows a schematic structural diagram of an electronic device 900 suitable for implementing embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. Among them, the terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers, portable media players (PMPs), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 12 The electronic device shown is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present disclosure.
[0105] As Figure 12 shown, the electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 are also stored. The processing device 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0106] Generally, the following devices may be connected to the I / O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 12 shows the electronic device 900 having various devices, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had.
[0107] In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, an embodiment of the present disclosure includes a computer program product that includes a computer program carried on a computer-readable medium, the computer program including program code for performing the methods shown in the flowcharts. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
[0108] It should be noted that the above-mentioned computer-readable medium in the present disclosure can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of a computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0109] The above-mentioned computer-readable medium can be included in the above-mentioned electronic device; or it can exist separately without being assembled into the electronic device.
[0110] The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is caused to execute the methods shown in the above embodiments.
[0111] Computer program code for performing the operations of this disclosure may be written in one or more programming languages or combinations thereof. The programming languages include object-oriented programming languages such as Java, Smalltalk, C++, and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computer, partially on the user's computer, execute as a stand-alone software package, execute partially on the user's computer and partially on a remote computer, or execute entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0112] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a part of code that contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions noted in the blocks may occur in a different order than noted in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, may be implemented by a dedicated hardware-based system for performing the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
[0113] The units or modules involved in the embodiments described in this disclosure may be implemented in software or in hardware. Among them, the name of the unit or module does not constitute a limitation on the unit itself in some cases.
[0114] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGA), application specific integrated circuits (ASIC), application specific standard products (ASSP), system on a chip (SOC), complex programmable logic devices (CPLD), and so on.
[0115] In the context of the present disclosure, a machine-readable medium may be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of the machine-readable storage medium would include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0116] In a first aspect, according to one or more embodiments of the present disclosure, there is provided a method for generating text animation, including:
[0117] Obtaining an input text, where the input text includes at least one text character; obtaining, according to the input text, font data corresponding to the text characters in the input text, where the font data includes vector information and text animation information corresponding to the text characters, and where the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters; generating, according to the font data, text animation of the input text, where the character outlines of at least two text characters in the text animation change with time according to different change rules.
[0118] According to one or more embodiments of the present disclosure, the generating, according to the font data, text animation of the input text includes: generating target signed distance field data corresponding to a time series according to the font data of a target text character; drawing a character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series; and generating text animation of the target text character based on the character bitmap corresponding to the time series.
[0119] According to one or more embodiments of the present disclosure, the time series includes at least two time nodes. Generating target signed distance field data corresponding to the time series according to the font data of the target text characters includes: for a target time node, obtaining a corresponding first drawing parameter, where the first drawing parameter is used to characterize a weighting coefficient of a maximum deformation vector for a standard character contour under the target time node; obtaining actual offset information according to the first drawing parameter and text animation information in the font data corresponding to the target text characters, where the actual offset information characterizes an actual deformation amount of the standard character contour of the target text characters; and obtaining target signed distance field data corresponding to the target time node according to the actual offset information and the vector information.
[0120] According to one or more embodiments of the present disclosure, obtaining the first drawing parameter for the target time node includes: obtaining first animation configuration information for the input text, where the first animation configuration information is used to characterize a variation rule of a weighting coefficient of a maximum deformation amount for a standard character contour over time; and obtaining the first drawing parameter according to the first animation configuration information and the target time node.
[0121] According to one or more embodiments of the present disclosure, the font data further includes second animation configuration information, where the second animation configuration information is used to characterize a variation rule of a weighting coefficient of a maximum deformation amount for a standard character contour of the target text characters over time; obtaining the first drawing parameter for the target time node includes: obtaining second animation configuration information for the target text characters; and obtaining the first drawing parameter according to the second animation configuration information and the target time node.
[0122] According to one or more embodiments of the present disclosure, the text animation information includes a vector set composed of a target number of vector values, and each vector value corresponds to a contour point of a standard character contour of the target text characters one by one; obtaining actual offset information according to the first drawing parameter and the text animation information in the font data corresponding to the target text characters includes: obtaining offset vectors corresponding to the contour points according to products of the vector values in the vector set and the first drawing parameter; and obtaining the actual offset information according to the offset vectors corresponding to the contour points.
[0123] According to one or more embodiments of the present disclosure, the font data further includes color animation information, where the color animation information is used to indicate a starting color value and an ending color value of a font color of the text characters; and font colors of character contours of at least two text characters in the text animation vary over time according to different variation rules.
[0124] According to one or more embodiments of the present disclosure, drawing the character bitmap corresponding to the time series based on the target signed distance field data corresponding to the time series includes: obtaining the color change data corresponding to the time series; and drawing the character bitmap corresponding to the time series according to the target signed distance field data and the color change data corresponding to the time series.
[0125] According to one or more embodiments of the present disclosure, the vector information includes at least two contour identifiers, and the contour identifiers are used to represent the coordinates of the contour points of the standard character contour constituting the text character; the text animation information includes offset identifiers corresponding one-to-one to the at least two contour identifiers, and the offset identifiers are used to represent the offset vectors relative to the corresponding contour points.
[0126] In a second aspect, according to one or more embodiments of the present disclosure, there is provided a text animation generation device, including:
[0127] An acquisition module, configured to acquire an input text, where the input text includes at least one text character;
[0128] A font module, configured to acquire font data corresponding to the text characters in the input text according to the input text, where the font data includes vector information and text animation information corresponding to the text characters, and wherein the vector information is used to represent the standard character contour of the text character, and the text animation information is used to control the deformation of the text character;
[0129] A generation module, configured to generate a text animation of the input text according to the font data, where the character contours of at least two text characters in the text animation change with time according to different change rules.
[0130] According to one or more embodiments of the present disclosure, the generation module is specifically configured to: generate target signed distance field data corresponding to a time series according to the font data of a target text character; draw a character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series; and generate a text animation of the target text character based on the character bitmap corresponding to the time series.
[0131] According to one or more embodiments of the present disclosure, the time series includes at least two time nodes. When generating the target signed distance field data corresponding to the time series according to the font data of the target text characters, the generating module is specifically configured to: for a target time node, obtain a corresponding first drawing parameter, where the first drawing parameter is used to characterize a weighting coefficient of a maximum deformation vector for a standard character contour under the target time node; obtain actual offset information according to the first drawing parameter and the text animation information in the font data corresponding to the target text characters, where the actual offset information characterizes an actual deformation amount of the standard character contour of the target text characters; and obtain the target signed distance field data corresponding to the target time node according to the actual offset information and the vector information.
[0132] According to one or more embodiments of the present disclosure, when obtaining the first drawing parameter for a target time node, the generating module is specifically configured to: obtain first animation configuration information for the input text, where the first animation configuration information is used to characterize a variation rule of a weighting coefficient of a maximum deformation amount for a standard character contour over time; and obtain the first drawing parameter according to the first animation configuration information and the target time node.
[0133] According to one or more embodiments of the present disclosure, the font data further includes second animation configuration information, where the second animation configuration information is used to characterize a variation rule of a weighting coefficient of a maximum deformation amount for a standard character contour of the target text characters over time; when obtaining the first drawing parameter for a target time node, the generating module is specifically configured to: obtain the second animation configuration information for the target text characters; and obtain the first drawing parameter according to the second animation configuration information and the target time node.
[0134] According to one or more embodiments of the present disclosure, the text animation information includes a vector set composed of a target number of vector values, and each vector value corresponds to a contour point of a standard character contour of the target text characters one by one; when obtaining the actual offset information according to the first drawing parameter and the text animation information in the font data corresponding to the target text characters, the generating module is specifically configured to: obtain offset vectors corresponding to the contour points according to the product of each vector value in the vector set and the first drawing parameter; and obtain the actual offset information according to the offset vectors corresponding to the contour points.
[0135] According to one or more embodiments of the present disclosure, the font data further includes color animation information, where the color animation information is used to indicate a starting color value and an ending color value of the font color of the text characters; the font colors of the character contours of at least two text characters in the text animation change over time according to different change rules.
[0136] According to one or more embodiments of the present disclosure, when the generation module draws the character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series, it is specifically configured to: obtain the color change data corresponding to the time series; and draw the character bitmap corresponding to the time series according to the target signed distance field data and the color change data corresponding to the time series.
[0137] According to one or more embodiments of the present disclosure, the vector information includes at least two contour identifiers, and the contour identifier is used to represent the coordinates of the contour points of the standard character contour constituting the text character; the text animation information includes offset identifiers corresponding one-to-one to the at least two contour identifiers, and the offset identifier is used to represent the offset vector relative to the corresponding contour point.
[0138] In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor and a memory;
[0139] The memory stores computer-executable instructions;
[0140] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the text animation generation method as described in the first aspect above and various possible designs of the first aspect.
[0141] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored, and when the processor executes the computer-executable instructions, the text animation generation method as described in the first aspect above and various possible designs of the first aspect is implemented.
[0142] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the text animation generation method as described in the first aspect above and various possible designs of the first aspect is implemented.
[0143] The above description is only a preferred embodiment of the present disclosure and an explanation of the applied technical principle. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features with similar functions disclosed in the present disclosure.
[0144] Moreover, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the foregoing discussion, these should not be construed as limitations on the scope of the present disclosure. Certain features that are described in the context of separate embodiments may also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment may also be implemented separately or in any suitable subcombination in multiple embodiments.
[0145] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A text animation generation method, characterized in that: include: Obtaining input text, wherein the input text includes at least one text character; According to the input text, font data corresponding to text characters in the input text are obtained, wherein the font data includes vector information and text animation information corresponding to the text characters, wherein the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters; A text animation of the input text is generated according to the font data, wherein character outlines of at least two text characters in the text animation change over time according to different change rules.
2. The method according to claim 1, characterized in that Generating the text animation of the input text according to the font data includes: Generate target signed distance field data corresponding to the time series according to the font data of the target text characters; Drawing a character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series; Based on the character bitmap corresponding to the time series, a text animation of the target text character is generated.
3. The method according to claim 2, characterized in that The time sequence includes at least two time nodes, and generating target signed distance field data corresponding to the time sequence according to the font data of the target text characters includes: For a target time node, obtaining a corresponding first drawing parameter, where the first drawing parameter is used to represent a weighted coefficient of a maximum deformation vector for the standard character contour at the target time node; According to the first drawing parameter and the text animation information in the font data corresponding to the target text character, actual offset information is obtained, the text animation information is used to represent the maximum deformation vector of the standard character contour, and the actual offset information represents the actual deformation amount of the standard character contour of the target text character; The target signed distance field data corresponding to the target time node is obtained according to the actual offset information and the vector information.
4. The method according to claim 3, characterized in that The step of obtaining a first drawing parameter for a target time node includes: Acquire first animation configuration information for the input text, where the first animation configuration information is used to characterize a change rule of a weighted coefficient of a maximum deformation amount of a standard character outline over time; The first drawing parameter is obtained according to the first animation configuration information and the target time node.
5. The method according to claim 3, characterized in that: The font data also includes second animation configuration information, and the second animation configuration information is used to characterize the change rule of the weighted coefficient of the maximum deformation amount of the standard character outline of the target text character over time; The step of obtaining a first drawing parameter for a target time node includes: Acquire second animation configuration information for the target text character; The first drawing parameter is obtained according to the second animation configuration information and the target time node.
6. The method according to claim 3, characterized in that The text animation information includes a vector set consisting of a target number of vector values, each of the vector values corresponding one-to-one to a contour point of a standard character contour of the target text character; the actual offset information is obtained according to the first drawing parameter and the text animation information in the font data corresponding to the target text character, including: Obtaining an offset vector corresponding to each of the contour points according to the product of each vector value in the vector set and the first drawing parameter; Obtaining the actual offset information according to the offset vector corresponding to each of the contour points; The contour points include a first contour point located on the standard character contour and a second contour point located outside the standard character contour, the first contour point is a drawing point of the standard character contour, and the second contour point is a control point for controlling the shape of a line between two drawing points.
7. The method according to claim 2, characterized in that The font data also includes color animation information, and the color animation information is used to indicate the starting color value and the ending color value of the font color of the text character; The font colors of the character outlines of at least two text characters in the text animation change over time according to different change rules.
8. The method according to claim 7, characterized in that Drawing a character bitmap corresponding to the time series according to the target signed distance field data corresponding to the time series includes: Obtaining color change data corresponding to the time series; A character bitmap corresponding to the time series is drawn according to the target signed distance field data and the color change data corresponding to the time series.
9. The method according to claim 1, characterized in that: The vector information includes at least two contour identifiers, which are used to represent the coordinates of contour points that constitute the standard character contour of the text character; the text animation information includes offset identifiers that correspond one-to-one to the at least two contour identifiers, and the offset identifiers are used to represent the offset vectors of the corresponding contour points.
10. A text animation generating device, characterized in that: include: An acquisition module, used for acquiring input text, wherein the input text includes at least one text character; A font module, used for obtaining font data corresponding to text characters in the input text according to the input text, wherein the font data includes vector information and text animation information corresponding to the text characters, wherein the vector information is used to represent the standard character outline of the text characters, and the text animation information is used to control the deformation of the text characters; A generating module is used to generate a text animation of the input text according to the font data, wherein the character outlines of at least two text characters in the text animation change over time according to different change rules.
11. An electronic device, characterized in that: include: Processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor executes the text animation generation method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the processor executes the computer-executable instructions, the text animation generation method according to any one of claims 1 to 9 is implemented.
13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the text animation generating method according to any one of claims 1 to 9 is implemented.