A method, device, electronic device and storage medium for generating handwritten fonts

By identifying the user's historical handwritten word pattern images to obtain glyph feature information and generate personalized handwritten fonts, it solves the problems of poor operation complexity and flexibility caused by template dependence in the prior art, and achieves more efficient personalized font generation.

CN114283422BActive Publication Date: 2025-07-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202111001073.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-30
Publication Date
2025-07-22
Estimated Expiration
2041-08-30

AI Technical Summary

Technical Problem

The existing handwritten font generation software requires downloading font templates and writing them strictly in accordance with the template requirements. The operation is complex and flexible, making it difficult to generate personalized handwritten fonts.

Method used

By obtaining the historical handwritten text image of the target object, identifying the glyph feature information, and generating the corresponding handwritten font text when entering standard font text, avoiding downloading templates and directly generating personalized fonts based on the user's writing style.

Benefits of technology

Improves the flexibility and efficiency of handwritten font generation. Users do not need to download templates, but only upload historical handwritten fonts to generate personalized fonts, simplifying the operation process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114283422B_ABST
    Figure CN114283422B_ABST
Patent Text Reader

Abstract

This application relates to the field of computer technology, and in particular, to a method, device, electronic device, and storage medium for generating handwritten fonts, which are used to reduce the operation complexity and improve the generation efficiency of handwritten fonts. Among them, the method includes: in response to a text material collection operation triggered by a target object, obtaining a font material image uploaded by the target object and glyph feature information corresponding to the target object determined based on the font material image, where the font material image is an image of the target object's historical handwritten manuscript; in response to an input operation triggered by the target object, obtaining a standard font target text input by the target object, and in a text preview interface, displaying a handwritten font target text corresponding to the generated standard font target text, where the handwritten font target text is at least generated based on the glyph feature information. Since this application only needs to upload an image of the target object's historical handwritten manuscript and is not restricted by the text of the font template, it has higher flexibility and is more convenient and faster.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] With the rapid development of the Internet, personalized fonts make information dissemination more vivid and intuitive. People's desire for beauty and personalization is becoming stronger and stronger.

[0003] Compared with standard printed fonts, more and more people hope to use personalized fonts, especially handwritten fonts, when communicating. Personalized fonts can express the style and feelings of the writer more flexibly.

[0004] Under the related technology, in a handwritten font generation software, first, a font template provided by the official website needs to be downloaded, and then the handwritten font is generated based on the template. Since the font template stipulates which specific characters are included in the template, only the characters that appear in the template can be handwritten, and the writing needs to be carried out strictly in accordance with the template requirements. Therefore, the flexibility of generating personalized fonts is poor, and the operation process of writing according to the template is relatively cumbersome and time-consuming. Summary of the Invention

[0005] Embodiments of the present application provide a method, device, electronic device, and storage medium for generating handwritten fonts, so as to reduce the operation complexity and improve the generation efficiency of handwritten fonts.

[0006] The first handwritten font generation method provided by the embodiments of the present application includes:

[0007] In response to a text material collection operation triggered by a target object, obtaining a font material image uploaded by the target object, and glyph feature information corresponding to the target object determined based on the font material image, where the font material image is an image of the target object's historical handwritten manuscript;

[0008] In response to an input operation triggered by the target object, obtaining a standard font target text input by the target object, and displaying a handwritten font target text corresponding to the generated standard font target text in a text preview interface, where the handwritten font target text is at least generated based on the glyph feature information.

[0009] The second handwritten font generation method provided by the embodiments of the present application includes:

[0010] Obtaining a font material image uploaded by a target object, where the font material image is an image of the target object's historical handwritten manuscript;

[0011] Obtaining the glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image;

[0012] Obtain the standard font target text input by the target object, generate a handwritten font target text corresponding to the standard font target text based on the glyph feature information, and feedback the handwritten font target text to the client, so that the client can display the handwritten font target text in the text preview interface.

[0013] The first handwritten font generation device provided by the embodiments of the present application includes:

[0014] A feature acquisition unit, configured to respond to a text material collection operation triggered by a target object, obtain a font material image uploaded by the target object, and glyph feature information corresponding to the target object determined based on the font material image, where the font material image is an image of the target object's historical handwritten manuscript;

[0015] A display unit, configured to respond to an input operation triggered by the target object, obtain the standard font target text input by the target object, and display the handwritten font target text corresponding to the generated standard font target text in the text preview interface, where the handwritten font target text is at least generated based on the glyph feature information.

[0016] Optionally, the handwritten font target text includes a first type of handwritten font target sub - text generated based on the glyph feature information, and a second type of handwritten font target sub - text generated based on context information; specifically, the display unit is configured to:

[0017] Determine the context information of the standard font target text by performing semantic word segmentation on the standard font target text;

[0018] Display the first type of handwritten font target sub - text and the second type of handwritten font target sub - text generated based on the context information in the text preview interface, where different context information corresponds to different handwritten font glyphs.

[0019] Optionally, the glyph of the second type of handwritten font target sub - text is: generated by adjusting the glyph of the first type of handwritten font target sub - text based on the context information; or determined based on the mapping relationship between different context information and different glyphs, and the glyph corresponding to the context information.

[0020] Optionally, the handwritten font target text includes a first type of handwritten font target sub - text generated based on the glyph feature information, and a third type of handwritten font target sub - text generated based on a specified language; specifically, the display unit is configured to:

[0021] Determine the specified language corresponding to the standard font target text;

[0022] In the text preview interface, display the first type of handwritten font target sub - text and the third type of handwritten font target sub - text in the specified language, where the glyph of the third type of handwritten font target text is determined based on the glyph feature information.

[0023] Optionally, if the number of handwritten font target texts is multiple, the device further includes:

[0024] A feedback unit, after the display unit displays the handwritten font target text corresponding to the generated standard font target text in the text preview interface, in response to the selection operation triggered by the target object for multiple handwritten font target texts, obtains the target handwritten font target text selected by the target object, and sends the target handwritten font target text and the corresponding standard font target text to the interaction object of the target object, so that the interaction object can view the target handwritten font target text in the corresponding interaction interface, and when triggering an auxiliary control, displays the standard font target text in the interaction interface.

[0025] Optionally, the device further includes:

[0026] A first conversion unit, configured to obtain the first object feature information of the interaction object;

[0027] Based on the first object feature information, determine the first text format feature corresponding to the interaction object;

[0028] Convert the target handwritten font target text selected by the target object into a target handwritten font target text that conforms to the first text format feature, and send the converted target handwritten font target text to the interaction object.

[0029] Optionally, the display unit is further configured to:

[0030] Receive an interaction message sent by the interaction object of the target object, and display the handwritten font interaction text corresponding to the interaction message in the interaction interface, where the handwritten font interaction text is generated based on the glyph feature information;

[0031] In response to the trigger operation of the target object for the auxiliary control, display the standard font interaction text corresponding to the interaction message at the associated display position of the interaction message.

[0032] Optionally, the device further includes:

[0033] A second conversion unit, configured to obtain the second object feature information of the target object;

[0034] Based on the second object feature information, determine the second text format feature corresponding to the target object;

[0035] Convert the handwritten font interaction text into a handwritten font interaction text that conforms to the second text format feature, and display the converted handwritten font interaction text on the interaction interface.

[0036] Optionally, the display unit is further configured to:

[0037] After the feature acquisition unit acquires the font material image uploaded by the target object and the glyph feature information corresponding to the target object determined based on the font material image, and before responding to the input operation triggered by the target object, display the text recognition result for the font material image in the text recognition interface, where the text recognition result includes each recognized handwritten font text and the standard font text corresponding to each handwritten font text;

[0038] In response to the trigger operation of the target object selecting the target text, correct at least one of the handwritten font text and the standard font text corresponding to the target text.

[0039] Optionally, the text preview interface further includes an adjustment control for adjusting the style of the handwritten font; the device further includes:

[0040] An adjustment unit, configured to display style reference information corresponding to each font adjustment style in response to a viewing operation triggered for the adjustment control;

[0041] In response to the selection operation triggered by the target object for multiple font adjustment styles, obtain the target font adjustment style selected by the target object, and perform corresponding style adjustment on the handwritten font target text based on the style reference information corresponding to the target font adjustment style.

[0042] The second handwritten font generation device provided by an embodiment of the present application includes:

[0043] An image acquisition unit, configured to acquire a font material image uploaded by a target object, where the font material image is an image of the historical handwritten manuscript of the target object;

[0044] A feature acquisition unit, configured to obtain the glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image;

[0045] A generation unit, configured to obtain the standard font target text input by the target object, generate a handwritten font target text corresponding to the standard font target text based on the glyph feature information, and feedback the handwritten font target text to the client, so that the client displays the handwritten font target text in the text preview interface.

[0046] Optionally, the feature acquisition unit is specifically configured to:

[0047] Input the font material image into a trained font generation model, perform glyph feature recognition on the font material image based on the font generation model, and obtain the glyph feature information corresponding to the target object;

[0048] The generation unit is specifically configured to:

[0049] Input the standard font target text into the font generation model, and based on the glyph feature information, obtain the handwritten font target text generated by the font generation model.

[0050] Optionally, the font generation model includes a discriminator and a generator; the device further includes:

[0051] A training unit, configured to train the font generation model through the following method:

[0052] Perform iterative training on the untrained font generation model according to the training samples in the training sample dataset, and output the trained font generation model when the training is completed; wherein, each iterative training process includes the following operations:

[0053] Select a training sample from the training sample dataset, where the training sample includes a standard font image with random noise and label information for identifying each character in the standard font image;

[0054] Input the standard font image and the corresponding label information in the training sample into the generator in the font generation model, and obtain the handwritten font image corresponding to the standard font image generated by the generator;

[0055] Input the standard font image and the handwritten font image into the discriminator in the font generation model, and by identifying each character in the handwritten font image, obtain the predicted character label corresponding to each character output by the discriminator and the corresponding recognition accuracy;

[0056] Adjust the model parameters of the font generation model based on the predicted character label, label information corresponding to each character, and the corresponding recognition accuracy.

[0057] Optionally, the device further includes:

[0058] A feedback unit, configured to perform character recognition on the font material image, obtain each handwritten font character in the recognized font material image, and the standard font character corresponding to each handwritten font character;

[0059] Use the respective handwritten font texts and the standard font texts corresponding to the respective handwritten font texts as the text recognition results, and feedback them to the client corresponding to the target object, so that the client corresponding to the target object can display the text recognition results for the font material image in the text recognition interface.

[0060] Optionally, if the number of the handwritten font target texts is multiple, the device further includes:

[0061] A first interaction unit, configured to obtain the target handwritten font target text selected by the target object;

[0062] Send the target handwritten font target text and the corresponding standard font target text to the client corresponding to the interaction object of the target object, so that the client corresponding to the interaction object can display the target handwritten font target text in the corresponding interaction interface, and when the interaction object triggers the auxiliary control, display the standard font target text in the interaction interface.

[0063] Optionally, the device further includes:

[0064] A second interaction unit, configured to receive the interaction message sent by the interaction object of the target object;

[0065] Generate a handwritten font interaction text corresponding to the interaction message based on the handwriting feature information, and send the handwritten font interaction text and the standard font interaction text corresponding to the interaction message to the client corresponding to the target object, so that the client corresponding to the target object can display the handwritten font interaction text in the interaction interface, and when the target object triggers the auxiliary control, display the standard font interaction text at the associated display position of the interaction message.

[0066] An electronic device provided by an embodiment of the present application includes a processor and a memory. Among them, the memory stores program codes, and when the program codes are executed by the processor, the processor is caused to execute the steps of any of the above handwritten font generation methods.

[0067] An embodiment of the present application provides a computer program product or a computer program. The computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of any of the above handwritten font generation methods.

[0068] An embodiment of the present application provides a computer-readable storage medium, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps of any of the above-mentioned handwritten font generation methods.

[0069] The beneficial effects of the present application are as follows:

[0070] An embodiment of the present application provides a handwritten font generation method, device, electronic device, and storage medium. In the embodiment of the present application, the target object only needs to upload a font material image, and then learn the glyph features corresponding to the target object through the font material image. Based on this, when the target object inputs a standard font target text, a handwritten font target text corresponding to the standard font target text can be generated. In this way, the target object does not need to download a font template, and only needs to upload an image of its own historical handwritten manuscript. Moreover, it is not restricted by the characters of the font template, has higher flexibility, is more convenient and fast, and can effectively improve the efficiency of handwritten font generation.

[0071] Other features and advantages of the present application will be described in the subsequent specification, and part of them will become obvious from the specification, or be understood by implementing the present application. The objectives and other advantages of the present application can be realized and obtained through the structures specifically pointed out in the written specification, claims, and drawings. Description of the Drawings

[0072] The drawings described herein are used to provide a further understanding of the present application, and constitute a part of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application, and do not constitute an improper limitation of the present application. In the drawings:

[0073] Figure 1A is an optional schematic diagram of an operation flowchart related to a handwritten font generation software on a personal computer in the related art;

[0074] Figure 1B is an optional schematic diagram of a template provided by a platform in the related art;

[0075] Figure 1C is an optional schematic diagram of a handwritten English font in the related art;

[0076] Figure 1D is an optional schematic diagram of a schematic diagram of a method for a font generation software in the related art to obtain user handwriting;

[0077] Figure 1E is an optional schematic diagram of a schematic diagram of another method for a font generation software in the related art to obtain user handwriting;

[0078] Figure 2Schematic diagram of an application scenario in an embodiment of the present application;

[0079] Figure 3 Schematic flowchart of the first handwritten font generation method in an embodiment of the present application;

[0080] Figure 4 An optional schematic diagram of a font material image in an embodiment of the present application;

[0081] Figure 5 An optional schematic diagram of a target text in an embodiment of the present application;

[0082] Figure 6 An optional schematic diagram of a text preview interface in an embodiment of the present application;

[0083] Figure 7 An optional schematic diagram of a context and glyph mapping table in an embodiment of the present application;

[0084] Figure 8 An optional schematic diagram of a chat interface in an embodiment of the present application;

[0085] Figure 9 An optional schematic diagram of another chat interface in an embodiment of the present application;

[0086] Figure 10 An optional schematic diagram of a text recognition result in an embodiment of the present application;

[0087] Figure 11 An optional schematic diagram of yet another text preview interface in an embodiment of the present application;

[0088] Figure 12 Schematic flowchart of the second handwritten font generation method in an embodiment of the present application;

[0089] Figure 13 Schematic diagram of a product usage process in an embodiment of the present application;

[0090] Figure 14A Schematic diagram of the network structure of a generator in an embodiment of the present application;

[0091] Figure 14B Schematic diagram of the network structure of a discriminator in an embodiment of the present application;

[0092] Figure 15 Schematic flowchart of a training method for a font generation model in an embodiment of the present application;

[0093] Figure 16 Schematic diagram of the comparison result of glyphs generated by different networks in an embodiment of the present application;

[0094] Figure 17 It is a schematic diagram of an optional interaction implementation timing process in an embodiment of the present application;

[0095] Figure 18 It is a schematic diagram of the composition structure of the first handwritten font generation device in an embodiment of the present application;

[0096] Figure 19 It is a schematic diagram of the composition structure of the second handwritten font generation device in an embodiment of the present application;

[0097] Figure 20 It is a schematic diagram of a hardware composition structure of an electronic device applying an embodiment of the present application;

[0098] Figure 21 It is a schematic diagram of a hardware composition structure of another electronic device applying an embodiment of the present application. Detailed implementation manners

[0099] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the technical solutions of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments recorded in this application document without making creative efforts shall fall within the scope of protection of the technical solutions of the present application.

[0100] Some concepts involved in the embodiments of the present application are introduced below.

[0101] Font material image: An image containing the user's handwritten font. In the embodiments of the present application, the font image may refer to an image of the historical handwritten manuscript of the target object, such as an image of a handwritten ancient poem written by the user before.

[0102] Standard font: It refers to a specially designed font used to represent the enterprise name or brand. Therefore, the design of the standard font includes the design of the enterprise name standard font and the brand standard font. In the embodiments of the present application, it refers to the fonts commonly seen in common office software that are not generated by user handwritten, such as Song typeface, regular script, official script, etc.

[0103] Handwritten font: It is a kind of text written purely by hand with a hard pen or a soft pen, and can also refer to text written by hand on the screen. Such handwritten text varies in size and shape, and it is difficult to achieve a well-proportioned effect in the computer font library. It can only be passed on by the method of handwritten writing. In the embodiments of the present application, it mainly refers to the font generated by the user's handwriting.

[0104] Generative Adversarial Networks (GAN): It is a deep learning model. Through the mutual game learning of (at least) two modules in the framework: the Generative Model and the Discriminative Model, the model can generate quite good outputs. Its core is to use the adversarial loss to prompt the generator G to generate images that cannot be distinguished from real images.

[0105] Conditional Generative Adversarial Networks (CGAN): It adds label conditions on the basis of the adversarial network. The adversarial network has become a new method for training the prediction ability of machines, and can make predictions simply by observation. An adversarial network has a generator that generates certain types of data from random inputs. It also has a discriminator that obtains inputs from the generator or from a real data set. The discriminator must distinguish inputs from different sources and tell the true from the false. The two neural networks can optimize themselves, thus generating more real inputs and a network with a more reasonable worldview. The discriminator will optimize itself to prevent being deceived by the generator. On the contrary, the generator is also optimizing itself to confuse the discriminator as much as possible and make it difficult to distinguish the true from the false.

[0106] Client: It refers to a program that provides local services corresponding to the server. Except for some applications that only run locally, it is generally installed on ordinary client computers and needs to cooperate with the server to run. After the development of the Internet, common clients include web browsers used for the World Wide Web, email clients for sending and receiving emails, and instant messaging client software, etc. For this type of application, corresponding servers and service programs in the network are required to provide corresponding services, such as database services, email services, etc. Therefore, specific communication connections need to be established between the client computer and the server to ensure the normal operation of the application.

[0107] Text preview interface: It is a user-oriented page for displaying the generated handwritten fonts to users; in addition, the interface may further include adjustment controls, and users can also adjust the styles of the target text of the handwritten fonts displayed on the text preview interface based on these controls.

[0108] Text recognition interface: It is a user-oriented page for displaying the text recognition results of the font material images uploaded by users. Users can view each handwritten font text recognized from the font material images uploaded by them and the corresponding standard font texts on the text recognition interface, and manual correction is allowed.

[0109] The embodiments of this application relate to artificial intelligence (AI) and machine learning technologies, and are designed based on computer vision technology and machine learning (ML) in artificial intelligence.

[0110] Artificial intelligence uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, and is a theory, method, technology, and application system that can perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a way similar to human intelligence.

[0111] Artificial intelligence also studies the design principles and implementation methods of various intelligent machines, enabling machines to have the functions of perception, reasoning, and decision-making. Artificial intelligence technologies mainly include several major directions such as computer vision technology, natural language processing technology, and machine learning / deep learning. With the research and progress of artificial intelligence technologies, artificial intelligence has been studied and applied in multiple fields. For example, common applications include smart homes, intelligent customer service, virtual assistants, smart speakers, intelligent marketing, driverless, autonomous driving, robots, intelligent healthcare, etc. It is believed that with the development of technology, artificial intelligence will be applied in more fields and play an increasingly important role.

[0112] Machine learning is an interdisciplinary subject that involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills, and reorganize the existing knowledge structure to continuously improve their own performance. Compared with data mining, which looks for mutual characteristics among big data, machine learning pays more attention to the design of algorithms, enabling computers to automatically "learn" rules from data and use these rules to predict unknown data.

[0113] Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, and inductive learning. The font generation model in the embodiments of this application is trained using machine learning or deep learning technologies. Based on the training method of the font generation model in the embodiments of this application, a handwritten font text corresponding to the target text can be generated.

[0114] The method for training a font generation model proposed in the embodiments of the present application can be divided into two parts, including a training part and an application part; among them, the training part involves the technical field of machine learning. In the training part, the font generation model is trained through machine learning. Specifically, the training samples given in the embodiments of the present application are used to train the font generation model. After the training samples pass through the font generation model, the output result of the font generation model is obtained. Combining the output result, the model parameters are continuously adjusted to output the trained font generation model; the application part is used to use the font generation model trained in the training part to generate a handwritten font target text corresponding to the standard font target text input by the target object.

[0115] The following briefly introduces the design concept of the embodiments of the present application:

[0116] In the related art, there are mainly three common handwritten font generation softwares. First, there is the English font generation software. This type of software only needs to train the corresponding model according to the upper and lower cases of the 26 handwritten letters, which is relatively simple. As Figure 1A shown, it is a flowchart of the operation related to a handwritten font generation software on a personal computer (PC) side in the related art.

[0117] This platform adopts the method of allowing users to fill in the templates provided by the platform. As Figure 1B shown, it is a schematic diagram of a font template in the related art. There are 26 letters to be filled in on the template and positioned with a QR code, similar to the "answer sheet" used in exams. After the user fills it out, they can take a photo and upload it. The platform uses optical character recognition technology to extract the writing style characteristics of the user, and finally generates English fonts. As Figure 1C shown, it is a schematic diagram of a handwritten English font in the related art. Compared with the 26 English letters, there are as many as 27,533 Chinese characters under the GB 18030-2000 standard. Obviously, such a method cannot be analogized to the generation of handwritten Chinese characters.

[0118] Secondly, there is the template-based font generation software, which requires writing the text one by one according to the requirements, taking a photo and uploading it to the system, and has high requirements for the standard of taking photos. Or, the user needs to download the template provided by the official website, print it, write it by hand and then take a photo and upload it. Therefore, the flexibility of generating personalized fonts is poor, and it is a time-consuming and laborious task.

[0119] As Figure 1D shown, it is a schematic diagram of the way for a font generation software in the related art to obtain the user's handwriting. The user needs to write the specified text set by hand on the screen, and the software will generate the corresponding font according to the written text. The user needs to spend a lot of time, and it is very difficult to write with fingers on the screen to be consistent with the usual handwriting, and the writing difficulty and operation difficulty are high.

[0120] Alternatively, as Figure 1E shown, it is a schematic diagram of another way for a font generation software in the related art to obtain user's handwriting. The user needs to download the template provided by the system and print it. After filling it out, it needs to be uploaded to the system one by one. Downloading, printing, and filling are required, and the operation is complex.

[0121] In view of this, the embodiments of the present application provide a handwritten font generation method, device, electronic device, and storage medium. In the embodiments of the present application, the target object only needs to upload a font material image, and then learn the glyph features corresponding to the target object through the font material image. Based on this, when the target object inputs a standard font target text, a handwritten font target text corresponding to the standard font target text can be generated. In this way, the target object does not need to download a font template, but only needs to upload an image of its own historical handwritten manuscript. Moreover, it is not restricted by the text of the font template, with higher flexibility and more convenient and fast.

[0122] The following describes the preferred embodiments of the present application with reference to the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. And without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

[0123] As Figure 2 shown, it is a schematic diagram of the application scenario of the embodiments of the present application. This application scenario diagram includes two terminal devices 210 and a server 220. A client for generating handwritten fonts can be installed on the terminal device 210 in the embodiments of the present application. The client can be software, or a web page, a small program, etc. The server is a background server corresponding to the software or the web page, the small program, etc. The present application does not make specific limitations.

[0124] In the embodiments of the present application, the user can log in to the relevant operation interface through the terminal device 210. The terminal device 210 generates and displays handwritten fonts by responding to various operations triggered by the user in the relevant operation interface. The relevant operation interface can include a text preview interface, a text result interface, etc.

[0125] In one implementation, the terminal device 210 and the server 220 can communicate through a communication network.

[0126] In one implementation, the communication network is a wired network or a wireless network.

[0127] In the embodiments of the present application, the terminal device 210 is a computer device used by a user, which can be a personal computer, mobile phone, tablet computer, notebook, e-reader, in-vehicle terminal, etc., a computer device with certain computing capabilities and running instant messaging software and websites or social software and websites. Each terminal device 210 is connected to the server 220 through a wireless network. The server 220 is a single server or a server cluster or cloud computing center composed of several servers, or a virtualization platform.

[0128] It should be noted that Figure 2 The above are only examples. In fact, the number of terminal devices and servers is not limited and is not specifically defined in the embodiments of the present application.

[0129] Next, in combination with the above-described application scenario, the video detection method provided by the exemplary embodiments of the present application will be described with reference to the accompanying drawings. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in this regard.

[0130] Refer to Figure 3 As shown, it is a flowchart of the implementation of the first handwritten font generation method provided by the embodiments of the present application, which is applied to a terminal device. The specific implementation process of this method is as follows:

[0131] S31: In response to a text material collection operation triggered by a target object, the terminal device acquires a font material image uploaded by the target object and glyph feature information corresponding to the target object determined based on the font material image;

[0132] Among them, the font material image is an image of the historical handwritten manuscript of the target object, such as a handwritten copy of an ancient poem previously written by the target object. The glyph feature information refers to the information obtained by learning the handwritten font in the font material image uploaded by the user and used to characterize the user's writing style and glyph style.

[0133] As Figure 4 shown, it is a schematic diagram of a font material image in the embodiments of the present application. This font material image is an image of the user's existing paper handwritten work, and the user can upload it by taking a photo of the existing paper handwritten work. In addition, the user can also click on the plus sign in the dotted box shown in Figure 4 to upload more font material images.

[0134] It should be noted that the embodiment of the present application does not require downloading the font template provided by the official website. The font material image is not limited by the font template, and the user does not need to write strictly according to the template requirements, and strictly follow the established photography rules to shoot and upload. The font material image in the embodiment of the present application is an image of the user's historical handwritten manuscript, that is, the user only needs to find the previous handwriting and upload it, which is simpler and more convenient.

[0135] S32: The terminal device obtains the standard font target text input by the target object in response to the input operation triggered by the target object, and displays the handwritten font target text corresponding to the generated standard font target text in the text preview interface, wherein the handwritten font target text is generated at least based on the glyph feature information.

[0136] See also Figure 5 As shown, it is a schematic diagram of a target text in an embodiment of the present application. The user can type or voice input the target text. For example, the target text typed by the user is "When did I first see the moon by the river? When did the moon by the river first shine on me?" Then, the system converts the target text into the user's handwritten font for the user to choose based on the font generation model. Figure 6 As shown, it is a schematic diagram of a text preview interface in an embodiment of the present application, showing three generated handwriting fonts, two of which are Chinese handwriting fonts and one is English handwriting font. The font shapes of the two types of Chinese handwriting fonts are very different.

[0137] In the embodiment of the present application, the number of handwriting font target texts can be multiple, specifically, the handwriting font target text generated based on the glyph feature information can be used as the first type of handwriting font target subtext. In addition, the handwriting font target text can further include: a second type of handwriting font target subtext generated based on the context information of the target text; and a third type of handwriting font target subtext generated based on a specified language.

[0138] Among them, the first type of handwriting font target subtext is generated based on the glyph feature information of the target object. The handwriting font target text is at least generated based on the glyph feature information of the target object. It can also be generated based on at least one of the context information and the specified language, which is not specifically limited here.

[0139] Optionally, the handwriting font target text may include, in addition to the first type of handwriting font target sub-text generated based on the glyph feature information, a second type of handwriting font target sub-text generated based on the context information; in this case, the handwriting font target text may be displayed in the text preview interface in the following manner:

[0140] First, by performing semantic word segmentation on the target text in standard font, the context information of the target text in standard font is determined; then, in the text preview interface, the first type of handwritten font target sub-text and the second type of handwritten font target sub-text generated based on the context information are displayed, where different context information corresponds to different handwritten font glyphs.

[0141] In the embodiments of the present application, the glyph of the second type of handwritten font target sub-text can be generated by adjusting the glyph of the first type of handwritten font target sub-text based on the context information; or, it can be determined based on the mapping relationship between different context information and different glyphs, that is, the glyph corresponding to a certain context information.

[0142] For example, in the present application, several mapping relationships between different context information and different glyphs are preset, as Figure 7 shown, which is a schematic diagram of a context and glyph mapping table in the embodiments of the present application. Among them, context A corresponds to glyph a, context B corresponds to glyph b, context c corresponds to glyph c, context D corresponds to glyph d,.... By performing semantic word segmentation on the target text "Who was the first to see the moon by the riverside? When did the river moon first shine on people?" input by the user, that is, performing semantic analysis and word segmentation processing on the target text, and according to the semantic analysis and word segmentation results, the context of the target text is determined. If the context of the target text is context A, then the corresponding handwritten font can be determined as glyph a, and the handwritten font corresponding to glyph a is generated, which is the second type of handwritten font target sub-text in the embodiments of the present application; if the context of the target text is context B, then the corresponding handwritten font can be determined as glyph b, and the handwritten font corresponding to glyph b is generated, which is another second type of handwritten font target sub-text in the embodiments of the present application.

[0143] Based on the above implementation manner, the present application can modify the glyph of the target text according to the context of the target text based on context analysis. Different contexts result in different glyphs, enriching the styles of the generated handwritten font texts.

[0144] Optionally, in addition to the first type of handwritten font target sub-text generated based on glyph feature information, the handwritten font target text may further include a third type of handwritten font target sub-text generated based on a specified language; in this case, the handwritten font target text can be displayed in the text preview interface in the following manner:

[0145] First, determine the specified language corresponding to the target text in standard font; then, in the text preview interface, display the first type of handwritten font target sub-text and the third type of handwritten font target sub-text in the specified language, and the glyph of the third type of handwritten font target text is determined based on the glyph feature information.

[0146] Still taking Figure 6As shown in the figure, it is a schematic diagram of a third type of handwritten font target sub - text in an embodiment of the present application. Among them, the language of the standard font target text input by the user is Chinese, and the corresponding specified language is English. This specified language can be set by the user, or be the system default, or be obtained based on user preference analysis, etc., and no specific limitation is made here.

[0147] It should be noted that the glyph of the third - type handwritten font target sub - text obtained by the above - mentioned method is still determined based on the glyph feature information of the target object, such as learned by unsupervised machine - learning methods, etc., and no specific limitation is made here.

[0148] Based on the above - mentioned implementation manner, different handwritten font texts corresponding to multiple languages and multiple contexts can be generated, enriching the styles of the generated handwritten font texts.

[0149] In an embodiment of the present application, the above - listed font generation method can also be applied to social software, and handwritten characters can be generated instantaneously during the process of chatting using social software, enabling users to have personalized chatting scenarios.

[0150] An optional implementation manner is that if the number of handwritten font target texts is multiple, after step S32, information interaction can be performed based on the target handwritten font target text selected by the user, which specifically includes the following process:

[0151] On the current text preview page, multiple generated handwritten font target texts are displayed. When the target object selects a certain handwritten font target text, the client responds to the selection operation triggered by the target object for the multiple handwritten font target texts, obtains the target handwritten font target text selected by the target object, and sends the target handwritten font target text and the corresponding standard font target text to the interaction object of the target object, so that the interaction object can view the target handwritten font target text in the corresponding interaction interface, and when the auxiliary control is triggered, the standard font target text is displayed in the interaction interface.

[0152] Among them, the interaction object of the target object can be a certain friend, group, or followed user, etc. during the chatting process, also known as the chatting object.

[0153] In an embodiment of the present application, when the number of handwritten font target texts is multiple, there are multiple situations. Among these multiple handwritten font target texts, there are multiple first - type handwritten font target sub - texts; or, among these multiple handwritten font target texts, there is at least one first - type handwritten font target sub - text, and there are at least one second - type or third - type handwritten font target sub - text. As Figure 6 shown, there are two first - type handwritten font target sub - texts and one third - type handwritten font target sub - text among them.

[0154] Assuming that the target object is user A, and the interactive object of user A is user B, after user A selects a target handwriting font target text, for example, one of the first-category handwriting font target subtexts is selected as the target handwriting font target text, the target handwriting font target text selected by user A can be sent to user B. In addition, in order to facilitate user B to identify some fonts with distinctive features and difficult to recognize, the corresponding standard font target text can be further sent to user B, so that when user B is unsure of the target handwriting font target text, he can view the standard font target text corresponding to the target handwriting font target text through the auxiliary control.

[0155] In addition, the client in the embodiment of the present application further provides a function of converting the received handwritten font text into a system standard font. When only the target handwritten font target text selected by user A is sent to user B, the target handwritten font target text can be converted into the corresponding standard font target text based on the above function to assist users in identifying some distinctive and difficult to identify fonts.

[0156] See also Figure 8 As shown, it is a schematic diagram of a chat interface in an embodiment of the present application. Figure 8 This is the chat interface on the user B side. During the chat between user B and user A, user A sent the target handwriting font target text "Who first shines the moon on the riverside? When did the moon on the river first shine on people" to user B. When user B long presses the target handwriting font target text, the auxiliary control will be displayed. The user can trigger the auxiliary control by clicking. Figure 8 By clicking the "Convert to Standard Font" control in the chat message interface, the corresponding standard font target text can be displayed at the associated display position of the chat message in the interactive interface, such as below the chat message (it can also be above the chat message, or other positions, which are not specifically limited here).

[0157] In the above implementation, the user can instantly generate handwritten text while chatting using social software, providing the user with a personalized chat scene.

[0158] In addition, in addition to generating handwritten fonts according to context, specified language, etc., the embodiments of the present application can further convert the generated handwritten fonts.

[0159] In an alternative implementation, in a chat scenario, the first object feature information of the interaction object of the target object can be obtained; wherein, the object feature information can characterize the common format habits of the object when writing or using text, such as commonly used simplified Chinese characters, commonly used traditional Chinese characters, bold, italic, etc.; furthermore, based on the first object feature information, the first text format feature corresponding to the interaction object is determined; if the text format of the target handwritten font target text selected by the current target object is inconsistent with the determined first text format, then the target handwritten font target text selected by the target object is converted into a target handwritten font target text that conforms to the first text format feature, and the converted target handwritten font target text is sent to the interaction object.

[0160] For example, if the target object is user A and the interaction object of the target object is user B, based on the object feature information of user B (i.e., the first object feature information in this application), it is determined that the first text format commonly used by user B is traditional Chinese, and the target handwritten font target text currently selected by user A is simplified Chinese, then the text format of this target handwritten font target text can be converted, and the converted target handwritten font target text obtained is a traditional Chinese handwritten text.

[0161] In addition, instead of directly sending the converted target handwritten font target text (traditional Chinese) to user B, it is also possible to perform text format conversion on this text after user B receives the target handwritten font target text, such as converting it to traditional Chinese, etc., which is not specifically limited here.

[0162] Based on the above implementation, automatic conversion of text format can be achieved, such as automatic conversion between simplified and traditional Chinese according to different objects, which is not specifically limited here.

[0163] In a chat scenario, in addition to being able to instantaneously generate handwritten text during the chat and send it to the interaction object, it is also possible to further receive the interaction message sent by the interaction object and display the handwritten font corresponding to the interaction text in the interaction message in the interaction interface, that is, the handwritten font interaction text. This handwritten font interaction text is obtained by performing font conversion on the text information in the interaction message.

[0164] In an alternative implementation, the interaction message sent by the interaction object of the target object is received, and the handwritten font interaction text corresponding to the interaction message is displayed in the interaction interface, and the handwritten font interaction text is generated based on the glyph feature information; in response to the triggering operation of the target object on the auxiliary control, the standard font interaction text corresponding to the interaction message is displayed at the associated display position of the interaction message.

[0165] In a chat scenario, for example, the target object is user A and the interaction object of the target object is user B. When user B sends an interaction message to user A, the text information in the interaction message is "Who was the first to see the moon by the riverside? When did the river moon first shine on man?". After the interaction message is sent from user B's client to the server corresponding to the chat software, the server can perform font conversion on the text information, generate a handwritten font interaction text corresponding to the interaction message based on the glyph feature information of user A, and send it to user A's client. User A's client can then display it in the chat interface. When user A triggers an auxiliary control, in response to the trigger operation on the auxiliary control, the standard font interaction text corresponding to the interaction message is displayed at the associated display position of the interaction message. As Figure 9 shown, it is a schematic diagram of another chat interface in an embodiment of the present application, Figure 9 which is user A's chat interface. During the chat between user A and user B, when user A receives the interaction message sent by user B, the interaction text is "Who was the first to see the moon by the riverside? When did the river moon first shine on man?". When user A long-presses the target handwritten font target text, the auxiliary control can be displayed, and the user can trigger the auxiliary control through a click operation, that is, Figure 9 the "Convert to Standard Font" control in it, and the corresponding standard font target text can be displayed at the associated display position of the chat message in the interaction interface, such as below the chat message (it can also be above the chat message, or other positions, which are not specifically limited here).

[0166] In an optional implementation manner, the second object feature information of the target object can also be obtained; based on the second object feature information, the second text format feature corresponding to the target object is determined; if the text format of the interaction text in the interaction message sent by the current interaction object is inconsistent with the determined second text format, the handwritten font interaction text corresponding to the interaction message is converted into a handwritten font interaction text that conforms to the second text format feature, and the converted handwritten font interaction text is displayed in the interaction interface.

[0167] For example, based on the object feature information of user A (i.e., the second object feature information in the present application), it is determined that the second text format commonly used by user A is simplified Chinese, and the handwritten font interaction text corresponding to the current interaction message sent by user B is traditional Chinese. Then, the text format of the handwritten font interaction text can be converted, and the converted handwritten font interaction text obtained is the simplified Chinese handwritten text.

[0168] In addition, instead of directly sending the converted handwritten font interaction text (simplified Chinese) to user A, the text can be converted into simplified Chinese, etc. after user A receives the target handwritten font target text, which is not specifically limited here.

[0169] Based on the above implementation, automatic conversion of text formats can be achieved, such as automatic conversion between simplified and traditional Chinese according to different object-oriented formats, etc., which is not specifically limited here.

[0170] In an optional implementation, after step S31 and before step S32, the text recognition result may be further displayed, and the specific implementation method is as follows:

[0171] The text recognition results for the font material image are displayed in the text recognition interface, and the text recognition results include each handwritten font character that has been recognized, and the standard font characters corresponding to each handwritten font character; in response to the trigger operation of selecting the target text by the target object, at least one of the handwritten font characters and the standard font characters corresponding to the target text is corrected.

[0172] See also Figure 10 As shown, it is a schematic diagram of a text recognition result in an embodiment of the present application. In this schematic diagram, each handwritten font character recognized is shown. Figure 10 There are 17 handwritten fonts in total, and the corresponding standard fonts for each handwritten font. Users can select one or more characters as target characters by long pressing or checking, and then modify or correct the handwritten fonts or standard fonts corresponding to the selected target characters to improve the accuracy of the dataset.

[0173] For example, there are two handwritten font characters corresponding to the standard font character "月" obtained through text recognition. When the system analyzes and selects the one with clearer and more obvious features as the recognition result, the user can also trigger correction through the above operation and select another handwritten font character as the recognition result for display; for another example, the standard font character corresponding to the handwritten font character "土" obtained through text recognition is "士", and the standard font character corresponding to the character can be corrected at this time.

[0174] It should be noted that the several correction methods listed above are only examples, and any correction method for text recognition results is applicable to the embodiments of the present application. In the above implementation, the user can view the various handwritten fonts recognized for the font material image uploaded by the user in the text recognition interface, as well as the corresponding standard fonts, allowing the user to make manual corrections.

[0175] In an optional implementation, the text preview interface further includes an adjustment control for adjusting the style of the handwritten font; the user can also adjust the style of the handwritten font target text displayed in the text preview interface based on the control.

[0176] For example, as shown in Figure 11, it is a schematic diagram of another text preview interface in an embodiment of the present application. Figure 11The "custom" control in [description] is a type of adjustment control in the embodiments of this application. Users can trigger a viewing operation by clicking on this control. The client responds to the viewing operation triggered for the adjustment control and displays the style reference information corresponding to each font adjustment style; for example Figure 11 As shown, after the user clicks on "customize", color font conversion, personalized decoration, etc. can be performed. When the user clicks on "color font conversion" and determines the adjusted color, the client responds to the selection operation triggered by the target object for multiple font adjustment styles, obtains the target font adjustment style selected by the target object, and based on the style reference information corresponding to the target font adjustment style, performs corresponding style adjustments on the handwritten font target text, and adjusts the font color of each handwritten font target text (or the target handwritten font target text selected by the user) in the text preview interface.

[0177] Based on the above implementation, personalized style adjustments can be made to the generated handwritten fonts, enabling the generated handwritten fonts to provide functions such as color font changes and adding personalized decorations in addition to traditional black and white, meeting the personalized and diversified needs of users.

[0178] Refer to Figure 12 As shown, it is the implementation flowchart of the second handwritten font generation method provided by the embodiments of this application, which is applied to the server. The specific implementation process of this method is as follows:

[0179] S121: The server obtains the font material image uploaded by the target object, and the font material image is an image of the target object's historical handwritten manuscript;

[0180] S122: The server obtains the glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image;

[0181] S123: The server obtains the standard font target text input by the target object, generates the handwritten font target text corresponding to the standard font target text based on the glyph feature information, and feeds back the handwritten font target text to the client, so that the client can display the handwritten font target text in the text preview interface.

[0182] Refer to Figure 13As shown, it is a schematic diagram of the usage process of a handwritten font generation product in an embodiment of the present application. After the user uploads an existing paper handwritten product by taking a photo through the client, the server can obtain the font material image uploaded by the user. Furthermore, the font generation model deployed on the server side is used to learn the glyph feature information of the target object, learn the handwriting features according to the user's handwritten product, and generate a corresponding font generation model. Furthermore, the user enters or voice-inputs the target text through the client. The system converts the target text into the user's handwritten font for the user to select according to the font generation model. The user can choose to upload their own font to the font warehouse for everyone to share.

[0183] In the handwritten font generation method in the embodiment of the present application, only the photo of the existing handwritten product needs to be uploaded. The system recognizes the written text information through optical character recognition, and then learns the glyph features to generate a corresponding generation model. When the user enters the standard font target text, it only needs to be generated through the generation model, which is more convenient and fast to use.

[0184] Optionally, step S122 and step S123 in the embodiment of the present application can also be implemented based on machine learning.

[0185] An optional implementation method is to input the font material image into the trained font generation model, perform glyph feature recognition on the font material image based on the font generation model, and obtain the glyph feature information corresponding to the target object. Furthermore, input the standard font target text into the font generation model, and based on the glyph feature information, obtain the handwritten font target text generated by the font generation model.

[0186] In the embodiment of the present application, in order to further generate more data from a small amount of handwritten data, the traditional method of splitting and recombining Chinese characters is abandoned, and instead, the GANs network is used to construct a font generation model to learn the style of handwritten Chinese characters, and then other Chinese characters with the style of the existing small amount of Chinese characters can be generated.

[0187] In addition, considering that it is difficult to obtain a large number of paired handwritten Chinese character training sets in the related art under real conditions, and conditional generative adversarial networks such as Pix2pix and zi2zi based on paired data sets are difficult to be popularized, so the present application selects the CycleGAN network that can realize the training of unpaired data sets through forward and reverse mappings.

[0188] In addition, considering that although the feature matching method based on the Maximum Mean Discrepancy (MMD) improves the training stability compared to GANs, the training process not only requires a large batch of data input, making the training speed very slow, but also cannot generate convincing images in practical applications. Therefore, in the embodiments of this application, an Optimized Feature Matching Conditional GAN (OFM-cGAN), also known as OFM-CycleGAN, which uses an improved feature matching algorithm as the font generation model, is adopted. It includes two GANs networks to achieve the mapping from the generator to the discriminator without paired data, accelerating the training and reducing the contour blurring of the generated Chinese characters.

[0189] Next, the GANs networks in the embodiments of this application will be introduced in detail. In order to be able to further generate more data from a small amount of handwritten data, the method of splitting and recombining Chinese characters in the related art is abandoned, and instead, the GANs network is selected to learn the style of handwritten Chinese characters, so as to be able to generate more fonts with the style of the existing small number of Chinese characters.

[0190] Next, the structure of the font generation model in the embodiments of this application will be introduced in detail. Combining Figure 14A and Figure 14B the generator G and the discriminator D in the embodiments of this application will be introduced in detail. Refer to Table 1 as follows:

[0191] Table 1

[0192]

[0193]

[0194] From Figure 14A , Figure 14B and Table 1, it can be seen that the generator G and the discriminator D in this application are two convolutional neural networks with different structures respectively. The generator G consists of a fully connected layer, three transposed convolutional layers and activation functions. The number of convolutional kernels of these three transposed convolutional layers is 128, 64 and 1 in sequence, the size of the convolutional kernels is 5x5, and the stride is set to 2. After each transposed convolutional layer is the ReLU activation function. The discriminator D consists of three convolutional layers, activation functions and two fully connected layers. The number of convolutional kernels of the convolutional layers is 64, 128 and 256 respectively, the size of the convolutional kernels is 5x5, and the stride is 2. After each convolutional layer is also the ReLU activation function.

[0195] Among them, the generator is used to generate handwritten Chinese character data that is as similar as possible to the original data space; the discriminator is used to generate a discriminator that can accurately distinguish real samples and generated samples, so that the generated data for the style conversion from standard Chinese characters to handwritten Chinese characters is more accurate. The last two layers of the discriminator are fully connected layers. The first layer outputs the probability value (the probability value that the image is real) for judging the authenticity of the input image, and the second layer outputs the predicted value of the label of the input image.

[0196] It should be noted that when training the font generation model in this application, a semi-supervised learning method is adopted. For the handwritten Chinese character generation task, due to the large structural differences among different Chinese characters, it is difficult for unsupervised GANs to learn the features of each type of Chinese character. Therefore, in the embodiments of this application, handwritten Chinese character generation based on conditional generative adversarial networks is adopted. By expanding unsupervised learning to semi-supervised learning, the labels of Chinese characters can be used as prior information in training to guide the model to learn a more realistic data distribution.

[0197] Refer to Figure 15 As shown, it is a schematic flowchart of a training method for a font generation model in an embodiment of this application, which specifically includes the following steps:

[0198] Perform iterative training on the untrained font generation model according to the training samples in the training sample dataset, and output the trained font generation model when the training is completed; among them, each iterative training process includes the following operations:

[0199] S151: The server selects training samples from the training sample dataset. The training samples include standard font images with random noise and label information for identifying each character in the standard font images.

[0200] S152: The server inputs the standard font images and the corresponding label information in the training samples into the generator in the font generation model to obtain the handwritten font images corresponding to the standard font images generated by the generator.

[0201] S153: The server inputs the standard font images and the handwritten font images into the discriminator in the font generation model, and by identifying each character in the handwritten font images, obtains the predicted character labels corresponding to each character output by the discriminator and the corresponding recognition accuracy.

[0202] S154: The server adjusts the model parameters of the font generation model based on the predicted character labels, label information, and the corresponding recognition accuracy corresponding to each character.

[0203] In step S154, the feature matching loss can be calculated based on the predicted text labels corresponding to each character, the label information, and the corresponding recognition accuracy. Among them, the L1 norm is used in the feature matching loss. Specifically, compared with the original L2 norm, the L1 norm can generate a sparser model than the L2 norm. When the parameter w is relatively small, the L1 regularization can directly reduce to 0, so it can play a role in feature selection to reduce the blurred outline of the generated Chinese characters.

[0204] In the embodiment of the present application, by inputting the standard font image (including random noise) and the label information (which character) into the generator in the font generation model, the generator outputs the generated data (handwritten text image); the discriminator takes the standard font image and the image generated by the generator as inputs, and each convolutional layer outputs the corresponding feature map (here referring to the features of the image generated by the generator), and finally outputs the predicted text label and the accuracy rate (how likely it is to be recognized as this character).

[0205] Optionally, the server is further configured to perform text recognition on the font material image, obtain each handwritten font text in the recognized font material image, and the standard font text corresponding to each handwritten font text; use each handwritten font text and the standard font text corresponding to each handwritten font text as the text recognition result, and feedback it to the client corresponding to the target object, so that the client corresponding to the target object can display the text recognition result for the font material image in the text recognition interface, as Figure 10 shown. For the specific implementation method, refer to the above embodiments, and the repeated parts will not be elaborated.

[0206] In addition, the font generation method in the embodiment of the present application can also be applied to the chat scenario. Users can instantaneously generate handwritten text during the process of using social software to chat, providing a personalized chat scenario for users.

[0207] In an alternative embodiment, if the number of handwritten font target texts is multiple, the target object can select one as the target handwritten font target text, and then the server obtains the target handwritten font target text selected by the target object; send the target handwritten font target text and the corresponding standard font target text to the client corresponding to the interaction object of the target object, so that the client corresponding to the interaction object can display the target handwritten font target text in the corresponding interaction interface, and when the interaction object triggers the auxiliary control, display the standard font target text in the interaction interface, as Figure 8 shown. For the repeated parts, no further elaboration will be provided.

[0208] In an alternative embodiment, the server may also receive an interaction message sent by the interaction object of the target object; generate a handwritten font interaction text corresponding to the interaction message based on the handwriting feature information of the target object, and send the handwritten font interaction text and the standard font interaction text corresponding to the interaction message to the client corresponding to the target object, so that the client corresponding to the target object displays the handwritten font interaction text in the interaction interface, and displays the standard font interaction text at the associated display position of the interaction message when the target object triggers the auxiliary control.

[0209] In addition, when the server forwards the message, the server may perform a text format conversion on the interaction text in the interaction message. Alternatively, the server may perform a text format conversion on the target handwritten font target text sent by the target object.

[0210] For example, based on the object feature information of user A (i.e., the second object feature information in this application), it is determined that the second text format commonly used by user A is simplified Chinese, and the handwritten font interaction text corresponding to the interaction message sent by the current user B is traditional Chinese. Then, the text format of the handwritten font interaction text can be converted. The converted handwritten font interaction text obtained is the simplified handwritten text, etc. For specific implementation manners, reference can be made to the deleted embodiments, and repeated parts will not be elaborated.

[0211] In the embodiments of this application, the fonts generated by using CycleGAN and OFM-CycleGAN are compared. Refer to Figure 16 As shown, it is a schematic diagram of the comparison result of the glyphs generated by CycleGAN and OFM-CycleGAN in the embodiments of this application.

[0212] Table 2 shows the accuracy comparison (the higher the value, the better) of the fonts generated by CycleGAN and OFM-CycleGAN through the HCCRN handwritten recognition model. The rightmost column is the accuracy of handwritten recognition using the Chinese character training sets HW252 and HW292.

[0213] Table 2

[0214] Chinese characters CycleGAN OFM-CycleGAN Training set Craftsman 36.30% 99.98% 89.58% Shoulder 98.94% 99.98% 99.99% Kun 39.72% 99.86% 98.65% Carving 10.46% 98.46% 99.10% And 6.69% 97.83% 99.95% Canon 6.44% 99.99% 99.99% Shell 37.76% 96.96% 99.92% Both 2.24% 74.93% 99.99% Average value 29.82% 95.99% 98.40%

[0215] It can be seen from the data in Table 2 that the results generated by OFM-CycleGAN are easier to recognize than those of CycleGAN.

[0216] In summary, the handwritten font generation method in the embodiments of the present application can meet the needs of people who want to create personalized fonts, providing a convenient and effective generation means to solve the problem of too few Chinese fonts in the related art. The handwritten font generation method can generate fonts according to personal handwriting, making monotonous computer fonts more profound and emotional, and providing various font styles for users to select suitable styles for various scenarios.

[0217] In addition, the handwritten font generation method in the embodiments of the present application uses a generative adversarial network to generate Chinese handwritten fonts with similar styles, greatly improving the production efficiency of Chinese fonts. Compared with the Chinese font design process in the related art, in the past, the design of Chinese fonts required multiple people to design at least 3,500 common characters before they could be applied to daily use. The handwritten font generation method no longer needs to spend a lot of time drawing characters one by one, nor does it need to purchase expensive font design software licenses. Just take a picture of the handwritten notes at hand and upload them to the handwritten font generation product made based on this method. After the model recognizes and extracts the handwritten features, a Chinese font belonging to one's own style can be easily generated. Compared with the traditional design mode, the font generation of this handwritten font generation method does not require a large amount of manpower and time, and greatly reduces cost resources.

[0218] Refer to Figure 17 As shown, it is an interaction timing diagram between a terminal device and a server in the embodiments of the present application. The specific implementation process of this method is as follows:

[0219] Step S1701: The client responds to the text material collection operation triggered by the target object, obtains the font material image uploaded by the target object, and feeds it back to the server;

[0220] Step S1702: The server performs text recognition on the font material image, obtains each handwritten font character in the recognized font material image, and the standard font character corresponding to each handwritten font character;

[0221] Step S1703: The server takes each handwritten font character and the standard font character corresponding to each handwritten font character as the text recognition result, and feeds it back to the client corresponding to the target object;

[0222] Step S1704: The client displays the text recognition result for the font material image in the text recognition interface;

[0223] Step S1705: The client responds to the trigger operation of the target object selecting the target text, and corrects at least one of the handwritten font character and the standard font character corresponding to the target text;

[0224] Step S1706: The client responds to the input operation triggered by the target object, obtains the target text in the standard font input by the target object, and feeds it back to the server;

[0225] Step S1707: The server obtains the glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image;

[0226] Step S1708: The server obtains the target text in the standard font input by the target object, generates the target text in the handwritten font corresponding to the target text in the standard font based on the glyph feature information, and feeds the target text in the handwritten font back to the client;

[0227] Step S1709: The client displays the target text in the handwritten font corresponding to the generated target text in the standard font in the text preview interface.

[0228] Based on the same inventive concept, an embodiment of the present application further provides a font generation device. As Figure 18 shown, it is a schematic structural diagram of the font generation device 1800, and may include:

[0229] The feature acquisition unit 1801 is configured to respond to the text material collection operation triggered by the target object, obtain the font material image uploaded by the target object, and the glyph feature information corresponding to the target object determined based on the font material image, where the font material image is an image of the historical handwritten manuscript of the target object;

[0230] The display unit 1802 is configured to respond to the input operation triggered by the target object, obtain the target text in the standard font input by the target object, and display the target text in the handwritten font corresponding to the generated target text in the standard font in the text preview interface, where the target text in the handwritten font is at least generated based on the glyph feature information.

[0231] Optionally, the target text in the handwritten font includes a first type of target sub-text in the handwritten font generated based on the glyph feature information, and a second type of target sub-text in the handwritten font generated based on the context information; the display unit 1802 is specifically configured to:

[0232] Determine the context information of the target text in the standard font by performing semantic word segmentation on the target text in the standard font;

[0233] Display the first type of target sub-text in the handwritten font and the second type of target sub-text in the handwritten font generated based on the context information in the text preview interface, where different context information corresponds to different handwritten font glyphs.

[0234] Optionally, the glyphs of the second type of handwritten font target sub - text are: generated by adjusting the glyphs of the first type of handwritten font target sub - text based on context information; or, determined based on the mapping relationship between different context information and different glyphs, and are the glyphs corresponding to the context information.

[0235] Optionally, the handwritten font target text includes a first type of handwritten font target sub - text generated based on glyph feature information, and a third type of handwritten font target sub - text generated based on a specified language; the display unit 1802 is specifically configured to:

[0236] Determine the specified language corresponding to the standard font target text;

[0237] In the text preview interface, display the first type of handwritten font target sub - text and the third type of handwritten font target sub - text in the specified language, and the glyphs of the third type of handwritten font target text are determined based on the glyph feature information.

[0238] Optionally, if the number of handwritten font target texts is multiple, the device further includes:

[0239] A feedback unit 1803, configured to, after the display unit 1802 displays the handwritten font target text corresponding to the generated standard font target text in the text preview interface, in response to a selection operation triggered by a target object for multiple handwritten font target texts, obtain the target handwritten font target text selected by the target object, and send the target handwritten font target text and the corresponding standard font target text to the interaction object of the target object, so that the interaction object can view the target handwritten font target text in the corresponding interaction interface, and when triggering an auxiliary control, display the standard font target text in the interaction interface.

[0240] Optionally, the device further includes:

[0241] A first conversion unit 1804, configured to obtain first object feature information of the interaction object;

[0242] Based on the first object feature information, determine the first text format feature corresponding to the interaction object;

[0243] Convert the target handwritten font target text selected by the target object into a target handwritten font target text that conforms to the first text format feature, and send the converted target handwritten font target text to the interaction object.

[0244] Optionally, the display unit 1802 is further configured to:

[0245] Receive an interaction message sent by the interaction object of the target object, and display the handwritten font interaction text corresponding to the interaction message in the interaction interface, where the handwritten font interaction text is generated based on the glyph feature information;

[0246] In response to a trigger operation of a target object on an auxiliary control, display the standard font interaction text corresponding to the interaction message at the associated display position of the interaction message.

[0247] Optionally, the apparatus further includes:

[0248] A second conversion unit 1805, configured to obtain second object feature information of the target object;

[0249] Based on the second object feature information, determine a second text format feature corresponding to the target object;

[0250] Convert the handwritten font interaction text into a handwritten font interaction text that conforms to the second text format feature, and display the converted handwritten font interaction text on the interaction interface.

[0251] Optionally, the display unit 1802 is further configured to:

[0252] After the feature acquisition unit 1801 acquires the font material image uploaded by the target object and the glyph feature information corresponding to the target object determined based on the font material image, and before responding to the input operation triggered by the target object, display the text recognition result for the font material image in the text recognition interface, where the text recognition result includes each recognized handwritten font text and the standard font text corresponding to each handwritten font text;

[0253] In response to a trigger operation in which the target object selects a target text, correct at least one of the handwritten font text and the standard font text corresponding to the target text.

[0254] Optionally, the text preview interface further includes an adjustment control for adjusting the style of the handwritten font; the apparatus further includes:

[0255] An adjustment unit 1806, configured to display style reference information corresponding to each font adjustment style in response to a viewing operation triggered on the adjustment control;

[0256] In response to a selection operation in which the target object selects multiple font adjustment styles, obtain the target font adjustment style selected by the target object, and perform corresponding style adjustment on the handwritten font target text based on the style reference information corresponding to the target font adjustment style.

[0257] Based on the same inventive concept, an embodiment of the present application further provides a font generation apparatus. As Figure 19 shown, it is a schematic structural diagram of a font generation apparatus 1900, and may include:

[0258] An image acquisition unit 1901, configured to acquire a font material image uploaded by a target object, where the font material image is an image of a historical handwritten manuscript of the target object;

[0259] A feature acquisition unit 1902, configured to acquire glyph feature information corresponding to a target object by performing glyph feature recognition on a font material image;

[0260] A generation unit 1903, configured to acquire a standard font target text input by a target object, generate a handwritten font target text corresponding to the standard font target text based on the glyph feature information, and feed back the handwritten font target text to a client, so that the client can display the handwritten font target text in a text preview interface.

[0261] Optionally, the feature acquisition unit 1902 is specifically configured to:

[0262] Input the font material image into a trained font generation model, perform glyph feature recognition on the font material image based on the font generation model, and acquire glyph feature information corresponding to the target object;

[0263] The generation unit 1903 is specifically configured to:

[0264] Input the standard font target text into the font generation model, and obtain a handwritten font target text generated by the font generation model based on the glyph feature information.

[0265] Optionally, the font generation model includes a discriminator and a generator; the apparatus further includes:

[0266] A training unit 1904, configured to train a font generation model through the following method:

[0267] Perform loop iterative training on an untrained font generation model according to training samples in a training sample dataset, and output a trained font generation model when the training is completed; wherein, each loop iterative training process includes the following operations:

[0268] Select a training sample from the training sample dataset, where the training sample includes a standard font image with random noise and label information for identifying each character in the standard font image;

[0269] Input the standard font image and the corresponding label information in the training sample into the generator in the font generation model, and acquire a handwritten font image corresponding to the standard font image generated by the generator;

[0270] Input the standard font image and the handwritten font image into the discriminator in the font generation model, and obtain a predicted character label corresponding to each character output by the discriminator and the corresponding recognition accuracy rate by recognizing each character in the handwritten font image;

[0271] Based on the predicted text labels corresponding to each character, the label information, and the corresponding recognition accuracy rates, the model parameters of the font generation model are adjusted.

[0272] Optionally, the apparatus further includes:

[0273] A feedback unit 1905, configured to perform character recognition on the font material image, obtain each handwritten font character in the recognized font material image, and the standard font character corresponding to each handwritten font character;

[0274] Use each handwritten font character and the standard font character corresponding to each handwritten font character as the character recognition result, and feedback it to the client corresponding to the target object, so that the client corresponding to the target object can display the character recognition result for the font material image in the character recognition interface.

[0275] Optionally, if the number of handwritten font target texts is multiple, the apparatus further includes:

[0276] A first interaction unit 1906, configured to obtain the target handwritten font target text selected by the target object;

[0277] Send the target handwritten font target text and the corresponding standard font target text to the client corresponding to the interaction object of the target object, so that the client corresponding to the interaction object can display the target handwritten font target text in the corresponding interaction interface, and display the standard font target text in the interaction interface when the interaction object triggers the auxiliary control.

[0278] Optionally, the apparatus further includes:

[0279] A second interaction unit 1907, configured to receive the interaction message sent by the interaction object of the target object;

[0280] Generate a handwritten font interaction text corresponding to the interaction message based on the handwriting feature information, and send the handwritten font interaction text and the standard font interaction text corresponding to the interaction message to the client corresponding to the target object, so that the client corresponding to the target object can display the handwritten font interaction text in the interaction interface, and display the standard font interaction text at the associated display position of the interaction message when the target object triggers the auxiliary control.

[0281] For the convenience of description, the above parts are divided into each module (or unit) according to functions and described separately. Of course, when implementing the present application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.

[0282] After introducing the handwritten font generation method and apparatus of the exemplary embodiment of the present application, next, a handwritten font generation apparatus according to another exemplary embodiment of the present application is introduced.

[0283] Those skilled in the art to which the present application pertains will understand that various aspects of the present application can be implemented as a system, a method, or a program product. Therefore, various aspects of the present application can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to herein as "circuit", "module", or "system".

[0284] In some possible implementation manners, the handwritten font generation device according to the present application may at least include a processor and a memory. Among them, the memory stores program code, and when the program code is executed by the processor, the processor is caused to execute the steps in the handwritten font generation method according to various exemplary implementation manners of the present application described in this specification. For example, the processor may execute the steps as Figure 3 shown.

[0285] Based on the same inventive concept as the above method embodiment, an electronic device is further provided in an embodiment of the present application. In one embodiment, the electronic device may be a server, such as Figure 2 the server 220 shown. In this embodiment, the structure of the electronic device may be as Figure 20 shown, including a memory 2001, a communication module 2003, and one or more processors 2002.

[0286] The memory 2001 is used to store the computer program executed by the processor 2002. The memory 2001 may mainly include a program storage area and a data storage area. Among them, the program storage area may store an operating system and programs required to run the instant messaging function, etc.; the data storage area may store various instant messaging information and operation instruction sets, etc.

[0287] The memory 2001 may be a volatile memory, such as a random-access memory (RAM); the memory 2001 may also be a non-volatile memory, such as a read-only memory, a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or the memory 2001 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2001 may be a combination of the above memories.

[0288] The processor 2002 may include one or more central processing units (CPUs) or be a digital processing unit, etc. The processor 2002 is used to implement the above-mentioned handwritten font generation method when calling the computer program stored in the memory 2001.

[0289] The communication module 2003 is used to communicate with terminal devices and other servers.

[0290] In the embodiments of the present application, the specific connection medium between the above-mentioned memory 2001, communication module 2003 and processor 2002 is not limited. In the embodiments of the present application Figure 20 it is described that the memory 2001 and the processor 2002 are connected through a bus 2004. The bus 2004 is described in thick lines in Figure 20 The connection manners between other components are only for illustrative purposes and are not to be construed as limiting. The bus 2004 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of description, Figure 20 it is only described by a thick line in

[0291] The memory 2001 stores a computer storage medium, and the computer storage medium stores computer-executable instructions. The computer-executable instructions are used to implement the handwritten font generation method of the embodiments of the present application. The processor 2002 is used to execute the above-mentioned handwritten font generation method, as Figure 12 shown.

[0292] In another embodiment, the electronic device may also be other electronic devices, such as Figure 2 the terminal device 210 shown. In this embodiment, the structure of the electronic device may be as Figure 21 shown, including components such as a communication component 2110, a memory 2120, a display unit 2130, a camera 2140, a sensor 2150, an audio circuit 2160, a Bluetooth module 2170, and a processor 2180.

[0293] The communication component 2110 is used to communicate with the server. In some embodiments, it may include a Wireless Fidelity (WiFi) module. The WiFi module belongs to a short-range wireless transmission technology, and the electronic device can help users send and receive information through the WiFi module.

[0294] The memory 2120 can be used to store software programs and data. The processor 2180 executes various functions and data processing of the terminal device 210 by running the software programs or data stored in the memory 2120. The memory 2120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices. The memory 2120 stores an operating system that enables the terminal device 210 to run. In this application, the memory 2120 can store the operating system and various application programs, and can also store the code for executing the handwritten font generation method according to the embodiments of this application.

[0295] The display unit 2130 can also be used to display information input by the user or information provided to the user, as well as the graphical user interface (GUI) of various menus of the terminal device 210. Specifically, the display unit 2130 may include a display screen 2132 disposed on the front of the terminal device 210. Among them, the display screen 2132 can be configured in the form of a liquid crystal display, a light-emitting diode, etc. The display unit 2130 can be used to display the application operation interface and the like in the embodiments of this application.

[0296] The display unit 2130 can also be used to receive input numerical or character information, and generate signal inputs related to the user settings and function controls of the terminal device 210. Specifically, the display unit 2130 may include a touch screen 2131 disposed on the front of the terminal device 210, which can collect touch operations of the user thereon or nearby, such as clicking a button, dragging a scroll box, etc.

[0297] Among them, the touch screen 2131 can cover the display screen 2132, or the touch screen 2131 and the display screen 2132 can be integrated to implement the input and output functions of the terminal device 210. After integration, it can be simply referred to as a touch display screen. In this application, the display unit 2130 can display application programs and corresponding operation steps.

[0298] The camera 2140 can be used to capture static images. The user can post comments on the images captured by the camera 2140 through an application. The camera 2140 can be one or multiple. An object generates an optical image through a lens and projects it onto a photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 2180 to convert it into a digital image signal.

[0299] The terminal device may further include at least one sensor 2150, such as an acceleration sensor 2151, a distance sensor 2152, a fingerprint sensor 2153, and a temperature sensor 2154. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.

[0300] The audio circuit 2160, the speaker 2161, and the microphone 2162 can provide an audio interface between the user and the terminal device 210. The audio circuit 2160 can transmit the electrical signal converted from the received audio data to the speaker 2161, and the speaker 2161 converts it into a sound signal for output. The terminal device 210 may also be configured with volume buttons for adjusting the volume of the sound signal. On the other hand, the microphone 2162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 2160, converted into audio data, and then the audio data is output to the communication component 2110 to be sent to, for example, another terminal device 210, or the audio data is output to the memory 2120 for further processing.

[0301] The Bluetooth module 2170 is used to interact with other Bluetooth devices having a Bluetooth module through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 2170, so as to perform data interaction.

[0302] The processor 2180 is the control center of the terminal device, connecting various parts of the entire terminal using various interfaces and lines. By running or executing the software programs stored in the memory 2120, and by calling the data stored in the memory 2120, it executes various functions of the terminal device and processes data. In some embodiments, the processor 2180 may include one or more processing units; the processor 2180 may also integrate an application processor and a baseband processor, where the application processor mainly processes the operating system, the user interface, and application programs, etc., and the baseband processor mainly processes wireless communication. It can be understood that the above baseband processor may not be integrated into the processor 2180. In this application, the processor 2180 can run the operating system, application programs, user interface display, and touch response, as well as the handwritten font generation method of the embodiments of this application. In addition, the processor 2180 is coupled to the display unit 2130.

[0303] In some possible implementation manners, various aspects of the handwritten font generation method provided in this application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to cause the computer device to execute the steps in the handwritten font generation method according to various exemplary embodiments described in this specification above. For example, the computer device can execute as Figure 3 orFigure 12 Steps of the method shown therein.

[0304] The program product can adopt any combination of one or more readable media. The readable media can be a readable signal medium or a readable storage medium. The 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 (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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.

[0305] The program product of the embodiments of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can run on a computing device. However, the program product of the present application is not limited thereto. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with a command execution system, apparatus, or device.

[0306] The readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the 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. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with a command execution system, apparatus, or device.

[0307] The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.

[0308] The program code for performing the operations of this application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, executed as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user's computing device through any type of network including a local area network (LAN) or a wide area network (WAN), or, it can be connected to an external computing device (e.g., by using an Internet service provider to connect through the Internet).

[0309] Those skilled in the art should understand that the embodiments of this application can be provided as a method, a system, or a computer program product. Therefore, this application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0310] Although the preferred embodiments of this application have been described, those skilled in the art can make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of this application.

[0311] Obviously, those skilled in the art can make various changes and variations to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalent technologies, this application is also intended to include these changes and variations.

Claims

1. A method for generating a handwritten font, characterized in that, The method includes: In response to a text material collection operation triggered by a target object, obtaining a font material image uploaded by the target object and glyph feature information corresponding to the target object determined based on the font material image, where the font material image is an image of the historical handwritten manuscript of the target object; In response to an input operation triggered by the target object, obtaining a standard font target text input by the target object, and in a text preview interface, displaying a handwritten font target text corresponding to the generated standard font target text; the handwritten font target text includes a first type of handwritten font target sub-text generated based on the glyph feature information and a second type of handwritten font target sub-text generated based on the context information of the standard font target text; different context information corresponds to different handwritten font glyphs; Receiving an interaction message sent by an interaction object of the target object and displaying a handwritten font interaction text corresponding to the interaction message in an interaction interface; if the text format of the interaction text in the interaction message is inconsistent with a determined second text format, converting the handwritten font interaction text into a handwritten font interaction text that conforms to the second text format feature and displaying the converted handwritten font interaction text in the interaction interface; the handwritten font interaction text is generated based on the glyph feature information; the second text format feature is determined based on second object feature information of the target object.

2. The method according to claim 1, characterized in that, The glyph of the second type of handwritten font target sub-text is: generated by adjusting the glyph of the first type of handwritten font target sub-text based on the context information; or determined based on the mapping relationship between different context information and different glyphs, the glyph corresponding to the context information.

3. The method according to claim 1, characterized in that The handwritten font target text further includes a third type of handwritten font target sub-text generated based on a specified language; The step of, in the text preview interface, displaying the handwritten font target text corresponding to the generated standard font target text further includes: Determining the specified language corresponding to the standard font target text; Displaying the third type of handwritten font target sub-text in the specified language in the text preview interface, where the glyph of the third type of handwritten font target sub-text is determined based on the glyph feature information.

4. The method according to claim 1, wherein If the number of handwritten font target texts is multiple, after displaying the handwritten font target text corresponding to the generated standard font target text in the text preview interface, it further includes: In response to a selection operation triggered by the target object on multiple handwritten font target texts, obtaining the target handwritten font target text selected by the target object and sending the target handwritten font target text and the corresponding standard font target text to the interaction object of the target object, so that the interaction object can view the target handwritten font target text in a corresponding interaction interface and display the standard font target text in the interaction interface when triggering an auxiliary control.

5. The method according to claim 4, characterized in that, The method further includes: Obtaining first object feature information of the interaction object; Based on the first object feature information, determining a first text format feature corresponding to the interaction object; Convert the target text of the target handwritten font selected by the target object into the target text of the target handwritten font that conforms to the first text format feature, and send the converted target text of the target handwritten font to the interaction object.

6. The method according to claim 1, wherein The method further includes: In response to the triggering operation of the target object on the auxiliary control, display the standard font interaction text corresponding to the interaction message at the associated display position of the interaction message.

7. The method according to claim 1, wherein After obtaining the font material image uploaded by the target object and the glyph feature information corresponding to the target object determined based on the font material image, and before responding to the input operation triggered by the target object, it further includes: Display the text recognition result for the font material image in the text recognition interface, where the text recognition result includes each recognized handwritten font text and the standard font text corresponding to each handwritten font text; In response to the triggering operation of the target object selecting the target text, correct at least one of the handwritten font text and the standard font text corresponding to the target text.

8. The method according to any one of claims 1 to 7, characterized in that, The text preview interface further includes an adjustment control for adjusting the style of the handwritten font; the method further includes: In response to the view operation triggered on the adjustment control, display the style reference information corresponding to each font adjustment style; In response to the selection operation of the target object on multiple font adjustment styles, obtain the target font adjustment style selected by the target object, and perform corresponding style adjustment on the target text of the handwritten font based on the style reference information corresponding to the target font adjustment style.

9. A method for generating a handwritten font, characterized in that, The method includes: Obtain a font material image uploaded by a target object, where the font material image is an image of the historical handwritten manuscript of the target object; Obtain the glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image; After obtaining the standard font target text input by the target object, generate a first type of handwritten font target sub-text corresponding to the standard font target text based on the glyph feature information, generate a second type of handwritten font target sub-text based on the context information of the standard font target text, and feedback the handwritten font target text including the first type of handwritten font target sub-text and the second type of handwritten font target sub-text to the client, so that the client displays the handwritten font target text in the text preview interface; different context information corresponds to different handwritten font glyphs; Receive an interaction message sent by an interaction object of the target object, and send the handwritten font interaction text corresponding to the interaction message to the client corresponding to the target object, so that the client corresponding to the target object displays the handwritten font interaction text in the interaction interface; if the text format of the interaction text in the interaction message is inconsistent with the determined second text format, then convert the handwritten font interaction text into a handwritten font interaction text that conforms to the second text format feature, so that the client corresponding to the target object displays the converted handwritten font interaction text in the interaction interface; the handwritten font interaction text is generated based on the glyph feature information; the second text format feature is determined based on the second object feature information of the target object.

10. The method according to claim 9, wherein, The obtaining of the glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image includes: Input the font material image into a trained font generation model, and perform glyph feature recognition on the font material image based on the font generation model to obtain the glyph feature information corresponding to the target object; The generating of the first type of handwritten font target sub-text corresponding to the standard font target text based on the glyph feature information includes: Input the standard font target text into the font generation model, and based on the glyph feature information, obtain the first type of handwritten font target sub-text generated by the font generation model.

11. The method according to claim 10, wherein The font generation model includes a discriminator and a generator; the font generation model is trained through the following method: Perform cyclic iterative training on an untrained font generation model according to the training samples in the training sample dataset, and output the trained font generation model when the training is completed; wherein, each cyclic iterative training process includes the following operations: Select a training sample from the training sample dataset, and the training sample includes a standard font image with random noise and label information for identifying each character in the standard font image; Input the standard font image and the corresponding label information in the training sample into the generator in the font generation model, and obtain the handwritten font image corresponding to the standard font image generated by the generator; Input the standard font image and the handwritten font image into the discriminator in the font generation model, and by recognizing each character in the handwritten font image, obtain the predicted character label corresponding to each character output by the discriminator and the corresponding recognition accuracy; Adjust the model parameters of the font generation model based on the predicted character label, label information corresponding to each character, and the corresponding recognition accuracy.

12. The method according to claim 9, wherein The method further includes: Perform character recognition on the font material image, and obtain each handwritten font character in the recognized font material image and the standard font character corresponding to each handwritten font character; Use the respective handwritten font characters and their corresponding standard font characters as the text recognition results, and feedback them to the client corresponding to the target object, so that the client corresponding to the target object can display the text recognition results for the font material image in the text recognition interface.

13. The method according to any one of claims 9 to 12, characterized in that If the number of handwritten font target texts is multiple, the method further includes: Obtain the target handwritten font target text selected by the target object; Send the target handwritten font target text and the corresponding standard font target text to the client corresponding to the interaction object of the target object, so that the client corresponding to the interaction object can display the target handwritten font target text in the corresponding interaction interface, and display the standard font target text in the interaction interface when the interaction object triggers the auxiliary control.

14. The method according to any one of claims 9 to 12, characterized in that The method further includes: Send the standard font interaction text corresponding to the interaction message to the client corresponding to the target object, so that the client corresponding to the target object can display the handwritten font interaction text in the interaction interface, and display the standard font interaction text at the associated display position of the interaction message when the target object triggers the auxiliary control.

15. A handwritten font generation device, characterized in that, The device includes: A feature acquisition unit, configured to, in response to a text material collection operation triggered by a target object, acquire a font material image uploaded by the target object, and glyph feature information corresponding to the target object determined based on the font material image, where the font material image is an image of the historical handwritten manuscript of the target object; A display unit, configured to, in response to an input operation triggered by the target object, acquire a standard font target text input by the target object, and display, in a text preview interface, a handwritten font target text corresponding to the generated standard font target text, where the handwritten font target text includes a first type of handwritten font target sub-text generated based on the glyph feature information, and a second type of handwritten font target sub-text generated based on the context information of the standard font target text; different context information corresponds to different handwritten font glyphs; A second conversion unit, configured to receive an interaction message sent by an interaction object of the target object, and display, in an interaction interface, a handwritten font interaction text corresponding to the interaction message; if the text format of the interaction text in the interaction message is inconsistent with a determined second text format, convert the handwritten font interaction text into a handwritten font interaction text that conforms to the second text format feature, and display the converted handwritten font interaction text in the interaction interface; the handwritten font interaction text is generated based on the glyph feature information; the second text format feature is determined based on second object feature information of the target object.

16. A handwritten font generation device, characterized in that, The device includes: An image acquisition unit, configured to acquire a font material image uploaded by a target object, where the font material image is an image of the historical handwritten manuscript of the target object; A feature acquisition unit, configured to acquire glyph feature information corresponding to the target object by performing glyph feature recognition on the font material image; A generating unit, configured to, after obtaining the standard font target text input by the target object, generate a first type of handwritten font target sub-text corresponding to the standard font target text based on the glyph feature information, generate a second type of handwritten font target sub-text based on the context information of the standard font target text, and feed back the handwritten font target text including the first type of handwritten font target sub-text and the second type of handwritten font target sub-text to the client, so that the client displays the handwritten font target text in a text preview interface; different context information corresponds to different handwritten font glyphs; receive an interaction message sent by an interaction object of the target object, and send the handwritten font interaction text corresponding to the interaction message to the client corresponding to the target object, so that the client corresponding to the target object displays the handwritten font interaction text in an interaction interface; if the text format of the interaction text in the interaction message is inconsistent with the determined second text format, convert the handwritten font interaction text into a handwritten font interaction text that conforms to the second text format feature, so that the client corresponding to the target object displays the converted handwritten font interaction text in the interaction interface; the handwritten font interaction text is generated based on the glyph feature information; the second text format feature is determined based on the second object feature information of the target object.

17. An electronic device, characterized in that, It includes a processor and a memory. Among them, the memory stores program code, and when the program code is executed by the processor, the processor is caused to execute the steps of any one of claims 1 to 8 or the steps of any one of claims 9 to 14 of the method.

18. A computer-readable storage medium, characterized in that, It includes program code, and when the storage medium runs on an electronic device, the program code is used to cause the electronic device to execute the steps of any one of claims 1 to 8 or the steps of any one of claims 9 to 14 of the method.

Citation Information

Patent Citations

  • Text transmission method of instant messaging software and transmission system thereof

    CN102611638A

  • Automatic generation method for handwritten Chinese font library based on deep neutral network

    CN107644006A

  • Font replacement method, device and equipment

    CN111651229A

  • Intelligent text enhancement in a computing environment

    US20200073936A1