Font generation method, client, electronic device, storage medium and program product

By adjusting the style of some structural elements of the first font picture on the client interface and generating the third font picture in combination with the second font picture, the problem of poor adaptability to the styles that have not been seen in the prior art and the inability of users to adjust the font structure in detail is solved, and a font style that is more in line with user needs and a higher quality font file is achieved.

CN119740549APending Publication Date: 2025-04-01BEIJING CHENGSHI WANGLIN INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411855188.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

Existing font generation technology performs poorly when adapting to unseen font styles, and users are unable to carefully adjust the style of some stroke structure of the font, resulting in poor user experience.

Method used

A font generation method is provided, by displaying the first font picture on the client interface and allowing the user to adjust the style of some of its structural elements, and generating a third font picture in combination with the second font picture. The font content of the third font picture is the same as the second font picture, and the font style is the same as the adjusted first font picture.

Benefits of technology

It improves the user's satisfaction with the font style during the font generation process, makes the generated font style more in line with user needs, and improves the quality of font files through multiple conversions and processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740549A_ABST
    Figure CN119740549A_ABST
Patent Text Reader

Abstract

According to the information processing technical scheme provided by the embodiment of the invention, after the user uploads the first font picture to the font generation client, the font in the first font picture displayed on the client interface can be subjected to style adjustment of partial structural elements; therefore, when the obtained second font picture is subsequently processed based on the style of the font content in the first font picture to generate the third picture, the font style in the generated third picture can better meet the style required by the user. Wherein the font content in the third font picture is the same as the font content in the second font picture, and the font style of the third font picture is the same as the font style in the adjusted first font picture.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of font generation technology, and in particular to a font generation method, a client, an electronic device, a storage medium and a program product. Background Art

[0002] With the rapid development of artificial intelligence technology, font generation related technologies have also developed rapidly. At present, related font generation technology solutions mainly focus on migrating the styles of other fonts to existing fonts, but they have poor adaptability to font styles that have not been seen. Moreover, during the font generation process, if the user is dissatisfied with the stroke structure style of the input font or the generated font, they cannot adjust it, or can only use special tools to adjust the overall structural style of the font, which results in a poor user experience. Summary of the invention

[0003] In view of the problems provided by the above background technology, multiple aspects of the present application provide a font generation method, a client, an electronic device, a storage medium and a program product.

[0004] In a first aspect, the present application provides a font generation method, the method comprising:

[0005] On the client interface, displaying the first font image;

[0006] In response to a partial structural element style adjustment operation triggered on a font in the first font picture, determining an adjusted first font picture;

[0007] Get the second font image;

[0008] generating a third font picture based on the adjusted first font picture and the second font picture;

[0009] The font content in the third font picture is the same as the font content in the second font picture, and the font style of the third font picture is the same as the font style in the adjusted first font picture.

[0010] In a second aspect, the present application provides a font generation method, the method comprising:

[0011] On the client interface, displaying the third font image output by the font generation model;

[0012] In response to a partial structural element style adjustment operation triggered on a font in the third font picture, determining an adjusted third font picture;

[0013] Optimizing the font generation model using the adjusted third font image;

[0014] Among them, the third font image is generated by the font generation model based on the first font image input by the user and the second font image obtained; the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the first font image.

[0015] In a third aspect, the present application provides a font generation method, the method comprising:

[0016] On the client interface, the generated third font image is displayed;

[0017] In response to a partial structural element style adjustment operation triggered on a font in the third font picture, determining an adjusted third font picture;

[0018] The adjusted third font image is processed to obtain a font file corresponding to the font in the third font image.

[0019] Among them, the third font image is generated based on the first font image input by the user and the second font image obtained; the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the first font image.

[0020] In a fourth aspect, the present application provides a font generation method, the method comprising:

[0021] In response to a partial structural element style adjustment operation triggered on a font in a displayed first font picture, determining an adjusted first font picture;

[0022] generating a third font picture based on the adjusted first font picture and second font picture;

[0023] Processing the third font image to obtain a corresponding scalable vector image;

[0024] Based on the scalable vector graph, generate a font file corresponding to the font in the third font image;

[0025] The font content in the third font picture is the same as the font content in the second font picture, and the font style of the third font picture is the same as the font style of the first font picture; the processing at least includes: converting into an intermediate font picture in a portable format.

[0026] In a fifth aspect, the present application provides a font generation client, which is developed based on a font generation model to implement the steps in the above-mentioned method embodiments provided in the present application.

[0027] In a sixth aspect, the present application provides an electronic device on which the font generation client provided by the above embodiment of the present application runs.

[0028] In a ninth embodiment, the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the steps in any of the above-mentioned font generation methods can be implemented.

[0029] In a tenth embodiment, the present application provides a computer program product, including a computer program, which implements the steps in any of the above-mentioned font generation methods when executed by a processor.

[0030] In the technical solution provided by the present application example, after the user uploads the first font image to the font generation client, the style of some structural elements of the font in the first font image displayed on the client interface can also be adjusted, which is beneficial for the subsequent processing of the acquired second font image based on the style of the font content in the first font image to generate the third image, so that the font style in the generated third image can be more in line with the style required by the user. Among them, the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the adjusted first font image. Furthermore, the third font image can also be first converted into an intermediate font image in a portable format, and then the intermediate font image is converted into a scalable vector image, so as to generate a font file of a corresponding set format (such as TTF format) corresponding to the font in the third font image (that is, the font in the second font image) based on this scalable vector image. Using this method to generate a font file corresponding to the font can effectively improve the quality of the generated font file. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0032] Figure 1 A schematic diagram of the structure of a font generation model and fine-tuning of a fluid of the font generation model provided by an exemplary embodiment of the present application;

[0033] Figure 2 A flowchart of a font generation method provided by an exemplary embodiment of the present application;

[0034] Figure 3a and Figure 3b A schematic diagram of the principle of adjusting the style of some structural elements of a font in a font image provided by an exemplary embodiment of the present application;

[0035] Figure 4 A schematic diagram of a process of generating a third font image and converting the third font image into a font file of a corresponding format provided by an exemplary embodiment of the present application;

[0036] Figure 5 A schematic diagram of the specific form of an electronic device where a font generation client is located provided in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0037] In recent years, with the rapid development of artificial intelligence technology, especially the introduction of the diffusion model, many scenarios have accelerated their integration with artificial intelligence technology, including font generation scenarios. Specifically, the font generation scenario has developed rapidly with the introduction of the diffusion model. At present, the relevant font generation technology solution focuses on using the font generation module constructed based on the diffusion model to transfer the style of other characters to the existing font, and has achieved good results. However, this font generation solution based on the extended model has the following problems:

[0038] 1) Poor adaptability to unseen font styles (such as those written by the user themselves);

[0039] 2) Before converting the generated original font image into a usable font file of the corresponding format (such as TTF), the meta-font image is directly converted without any other pre-processing, resulting in poor final conversion effect and adding additional design costs to font designers;

[0040] 3) If the user is dissatisfied with the stroke structure style of some of the input fonts or generated fonts and cannot adjust them, or can only use special tools to adjust the overall structure style of the fonts, the user experience is poor.

[0041] In response to the above problems, the present application provides a new font generation technology solution.

[0042] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0043] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0044] To facilitate understanding of the present application, before introducing the various implementation schemes provided in the present application, the model used in the present application and the model fine-tuning training are first introduced and explained.

[0045] The font generation technical solution provided by this application uses a font generation model based on a diffusion model at the underlying layer. Specifically, as Figure 1 shown, this font generation model includes a pre-trained content encoder, a style encoder, a pre-coded stroke vector table, and a pre-trained diffusion model; among them, the diffusion model is a UNet network structure, and the UNet network structure is mainly composed of two parts: an encoder and a decoder, which are connected by skip connections in the middle. The training process of this font generation model includes a forward noise addition process and a reverse denoising process, and the forward noise addition process and the reverse denoising process are as follows:

[0046] 1) Forward noise addition process (for the forward process)

[0047] S11. Select the number of steps t;

[0048] S12. Add noise to the initial sample font image x0 for t times. Among them, the added noise can be but is not limited to Gaussian noise and salt-and-pepper noise, and the noise addition process can be a Markov process. After adding noise for t times, the finally obtained noisy sample font image is x t .

[0049] Specifically, the above noise addition process can be expressed in the form of a Gaussian distribution as the following formula:

[0050]

[0051] In the above formula, β t is a preset hyperparameter, which decreases as the number of steps t increases. I is the identity matrix with the same dimension size as x0, is the mean of this Gaussian distribution, and β t I is the variance of this Gaussian distribution. x t-1 represents the sample font image obtained after adding noise to the initial sample font image x0 for t - 1 times. And, based on the above Gaussian distribution, adding noise to x t-1 to obtain x t can be expressed as the formula:

[0052]

[0053] where ε is a sampling result of the standard Gaussian distribution. Let x i represent the sample font image obtained after adding noise to the initial sample font image x0 for i times, and i is a positive integer 0 < i ≤ t. Then, iterating x t-1 , x t-2 , x t-3 , …, x1 into the above expression of x t , finally the following x tThe expression about x0 is:

[0054]

[0055] Among them, α t =1-β t ,

[0056] 2) Reverse denoising process (also known as reverse denoising process, referred to as reverse process)

[0057] In the reverse denoising process, the added conditional latent variable is z = [e con ,e sty ,e stk ], where e con e is the content vector obtained by inferring the content encoder using the font image as input. sty is the style vector obtained by inferring the font image through the style encoder, e stk is the stroke vector corresponding to the corresponding font in the pre-coded stroke vector table. Taking the conditional latent variable and the result of forward denoising as input, the inverse denoising process (the inverse denoising process can also be regarded as a Markov process) is expressed as:

[0058]

[0059] In the above, p θ (x t-1 |x t ,z) obeys Gaussian distribution (also known as normal distribution or normal distribution, etc.), specifically, its expression can be: p θ (x t-1 |x t ,z)=N(μ θ (x t ,t,z),Σ θ (x t ,t,z), where μ θ is the mean of the distribution (mathematical expectation), Σ θ (x t ,t,z) are constants.

[0060] And, using the diffusion model ∈ θ (x t ,t,z) can predict the noise added by the forward process And use the corresponding loss function such as mean square error loss function Model parameters can be optimized and diffusion models can be trained.

[0061] In addition, in order to make the font generation model better adapt to the font generation task required by this application (to generate fonts with personalized style), the parameters of the above-mentioned trained font generation model need to be fine-tuned. The fine-tuning mainly involves adjusting the parameters of the diffusion model in the font generation model.

[0062] In specific implementation, the fine-tuning process adopts full parameter fine-tuning, that is, no diffusion model parameters are frozen during the fine-tuning training stage. This can be understood to mean that all parameters of the entire diffusion model are optimized during the fine-tuning process. Of course, in other embodiments, the fine-tuning process can also adopt partial parameter fine-tuning, that is, only certain partial parameters in the diffusion model are adjusted. Preferably, in the present application, the diffusion model is fine-tuned by adopting full parameter fine-tuning.

[0063] In order to maximize the ability of the pre-trained expansion model to generate font structures and reduce the problem of the diffusion model's ability to generate fonts being reduced due to overfitting, the training dataset used for fine-tuning the diffusion model includes the following two types of images:

[0064] (1) Several hand-designed font images (also called manually designed font images, i.e., font images containing user-defined style fonts). This hand-designed font image refers to a font image of a hand-designed personalized style font, wherein hand-design can be understood as but not limited to: handwriting (including writing on a piece of paper or writing on an interface provided by a tool, etc.), or also includes custom design through corresponding tool software, etc. The fonts in the hand-designed font image belong to the 6763 Chinese characters defined in the national standard code (GB2312), and the resolution of the image meets the input image size of the diffusion model.

[0065] (2) Several other-style font images. These other-style font images are obtained by selecting several fonts from the font files trained by the previously pre-trained diffusion model and converting the several fonts into corresponding font images, and the resolution of the font images meets the input image size of the diffusion model.

[0066] It should be noted that the above training data set can be expanded or reduced based on the effect of fine-tuning training, or other font styles selected in (2) can be selected to construct fonts of other styles similar to the custom style to achieve better font generation effect.

[0067] The present application scheme uses the fine-tuning training data set constructed above to fine-tune the diffusion model in the font generation model, which can ensure a better custom style font generation effect.

[0068] Figure 1The right figure in the figure shows a schematic diagram of the fine-tuning training process of the diffusion model.

[0069] Based on the above-mentioned trained font generation model and in combination with other open source image processing tools, this application designs a font generation client (application software) that can be directly used by users. The font generation client can be an independent mobile application (mobile application, referred to as app) or a small program that can be used through other applications, etc. This application does not make specific restrictions on this. And, Figure 5 As shown, the above-mentioned font generation client is installed and runs on the corresponding electronic device, and the electronic device may include but is not limited to any terminal device such as a mobile phone, a tablet, a personal computer (such as a desktop computer, a laptop computer), a PDA (Personal Digital Assistant), and a smart wearable device. The following method embodiments provided in this application are applied to this font generation client, and when describing the various method embodiments provided in this application in detail, for the convenience of description, this font generation client is referred to as the client.

[0070] Figure 2 FIG. 1 is a flow chart of a font generation method provided by an embodiment of the present application. Figure 2 As shown, the font generation method includes the following steps:

[0071] 101. Displaying a first font image on a client interface;

[0072] 102. In response to a partial structural element style adjustment operation triggered by a user on a font in the first font image, determining an adjusted first font image;

[0073] 103. Get the second font image;

[0074] 104. Generate a third font picture based on the adjusted first font picture and the second font picture;

[0075] The font content in the third font picture is the same as the font content in the second font picture, and the font style of the font in the third font picture is the same as the font style of the font in the first font picture after adjustment.

[0076] In this embodiment, the fonts in the font images may be, but are not limited to, one or more of the following: Chinese characters, numbers, letters (such as a single letter or an English word or sentence consisting of multiple letters, etc.), and punctuation marks.

[0077] The first font image in 101 is input by the user, and the font contained therein is a font of a personalized style custom-designed by the user. The "custom-designed" method includes but is not limited to: handwriting, or manual design using a font design tool, etc.

[0078] For example, the user may handwrite a font on a piece of paper in advance, and take a photo of the handwritten font to obtain a first font image, and then upload the first font image through the upload port provided by the client, so as to display the first font image on the client interface.

[0079] For another example, the client provides a writing interface on which the user can manually write a font. After the handwriting is completed, the user can click the "OK" control on the writing interface. In response to the click operation, the client will generate and display the first font image based on the handwritten font.

[0080] For example, in the aforementioned other embodiments, when fine-tuning the font generation model that the client relies on at the bottom layer (specifically, fine-tuning the diffusion model contained therein), a corresponding data set for fine-tuning training is constructed, which includes several manually designed font images, and the user can select one from the several manually designed font images as the first font image to upload.

[0081] Furthermore, the user may select some unsatisfactory structural elements for the font in the first font image, and then adjust the style of the selected structural elements. Based on this, the above 102 "determining the adjusted first font image in response to the user triggering the style adjustment operation of some structural elements for the font in the first font image" may include:

[0082] 1021. Determine a target structural element for font selection in the first font picture;

[0083] 1022. In response to the style adjustment operation performed on the target structural element, determine the adjusted first font image.

[0084] In the above 1021, when the user selects the target structural element, the selection method adopted may be but is not limited to: point selection, box selection, etc.

[0085] For example, assume that the font contained in the first font picture is a Chinese character "Ji" handwritten by the user. When the user is dissatisfied with the writing of a certain stroke in this "Ji", such as stroke Sk, as shown in the left figure in Figure 3, the user can click on two different positions on stroke Sk. For example, click on point a where stroke Sk intersects with dotted line l1 and point b where it intersects with dotted line l2 respectively. Then, in response to this click operation, the client will determine the part of the line of stroke Sk between the two clicked different positions as the target structural element selected by the user. For example, the line between point a and point b is determined as the target structural element. Or, as shown in the right figure in Figure 3, a selection box C can also be drawn peripherally with a point on stroke Sk as the center. Then, the part of the line of stroke Sk that falls within this selection box C is the target structural element selected by the user. Among them, the selection box can be regular (such as circular, polygon (such as rectangle, pentagon, hexagon, etc.)) or can also be irregular.

[0086] The selected target structural element is the structural element of the font in the first picture to be adjusted in style. Further, in order for the user to visually and intuitively clearly identify the structural element they have selected, the display state of the target structural element can also be updated. Through this updated display state, the user can also know that this target structural element is in an adjustable state.

[0087] That is, between the above steps 1021 and 1022, the method provided in this embodiment may further include the following steps:

[0088] A21. After determining the selected target structural element, update the display state of the target structural element to characterize that the target structural element is in an adjustable state.

[0089] Here, after the client detects that the user has completed the selection of the target structural element, it will call the corresponding underlying segmentation program to separate the selected target structural element from the first font picture, and then render and display the separated target structural element to update the display state of the target structural element. Among them, the way to update the display state of the target structural element can be but is not limited to highlighting, etc., as long as it can characterize that the target structural element is in an adjustable state.

[0090] After that, the user can perform a style adjustment operation on the target structural element in an adjustable state. Among them, the style adjustment operations that can be performed include but are not limited to one or more of the following:

[0091] (1) Adjust the line shape of the target structural element, where the line shape includes line width, line curvature, and line inclination.

[0092] (2) Modify the line connection of the target structural element.

[0093] Exemplarily, after selecting the target structural element, the user can click on the "Edit" control, where the client responds to the click operation by displaying multiple adjustment options, such as a "width" adjustment option, a "bend" adjustment option, a "tilt" adjustment option, an "erase" option, etc. And, further as follows:

[0094] If the user clicks on the "width" adjustment option, a width parameter input interface will be displayed, and the user can enter the corresponding width parameter in this width parameter input interface. In addition, in this width parameter input interface, a preview screen of the target structural element can also be displayed according to the width parameter entered by the user, so that the user can preview the target structural element after the width is adjusted according to the input width parameter to decide whether to modify the input width parameter. Among them, in addition to displaying the target structural element, the remaining other structural elements of the font in the first font image except the target structural element can also be displayed in the above preview screen, and the remaining other structural elements can be displayed in low brightness, so that the user can preview the style effect of the target structural element after the width adjustment from the entire font.

[0095] If the user selects the "Bend" or "Tilt" adjustment option, the display state of the target structural element can be updated to the breakpoint state. In this state, multiple operable points will be displayed for the target structural element, such as Figure 3b The multiple blue dots shown in the figure become operable dots, and a part of the multiple operable dots can be displayed on the line of the target structural element. The user can change the curved shape and / or inclination of the target structural element, etc. by operating the operable dots.

[0096] If the user clicks on the "erase control", an eraser element will be displayed, through which part of the lines of the target structural element can be erased to modify the line connection of the target structural element. For example, erasing part of the line of the target structural element can disconnect the target structural element from other adjacent structural elements, and so on.

[0097] In the above 103, the second font image can be converted from the font that the user wants to generate from the existing font files of other styles (such as TTF format). That is, after the user uploads and adjusts the first font image, he can further select the font he wants to generate from the font files of other styles, and then the client will convert the font selected by the user into the corresponding second font image and display it in response to the user's selection operation. Alternatively, the above first font image can also be obtained autonomously by the client. For example, after the user uploads and adjusts the first font image, he clicks the "Submit Generation" control on the client interface. At this time, the client device can automatically select the font from the existing font files of other styles and convert it to generate the second font image corresponding to the font. Further, when the above step 104 is executed later, the client will use the font content in the second font image as a reference for the font shape and content, and the font style in the adjusted first font image as a style reference, thereby generating a third font image. That is, the font content in the third font image is related to the font content in the second font image, and the font style in the third font image is the same as the font style in the adjusted first font image.

[0098] In specific implementation, the underlying dependent font generation model can be called, and the first font image and the second font image can be input into the font generation model. Then, the first font image and the second font image are respectively subjected to multiple reverse denoising processes through the pre-trained content encoder, style encoder and fine-tuned diffusion model contained therein, and the third font image will be output.

[0099] That is, in an achievable technical solution, the above 104 “generating a third font image based on the adjusted first font image and the second font image” may include:

[0100] 1041. Retrieve the trained font generation module;

[0101] 1042. Input the second font image and the adjusted first font image into the font generation model, and output a third font image;

[0102] The font generation model includes a diffusion model, and the training data set used in fine-tuning the diffusion module model includes: manually designed font images (manually designed font images), and other style font images generated by converting existing font files. For a detailed description of this training data set, please refer to the relevant content described in other embodiments for fine-tuning the diffusion model, and no further details will be given here.

[0103] Furthermore, in order to convert the generated third font image into a high-quality font file in a practically usable corresponding format (such as TTF (TrueType Font) format), it is also necessary to first convert the third font image into scalable vector graphics (SVG), and then generate a corresponding font file based on the scalable vector graphics.

[0104] The implementation of converting the third font image into a scalable vector graphic may include the following steps:

[0105] S21 (optional step): Call a pre-trained resolution processing model to process the third font image to increase the resolution of the third font image. The above-mentioned resolution processing model is constructed based on the corresponding image super-resolution algorithm. Image super-resolution refers to the process of reconstructing a corresponding high-resolution image from a low-resolution (LR) image through a certain algorithm. By processing the third font image using the resolution processing model, the resolution of the third font image can be enlarged by, but not limited to, 2 times, 3 times, 4 times, etc., thereby enhancing details such as font corners, reducing the jaggedness of characters in the third font image, and enhancing the quality of subsequent generation of scalable vector graphics, etc.

[0106] S22, calling a corresponding image processing tool to convert the third font image into an intermediate font image in a portable format (PNM format). The PNM format is a cross-platform image format, which may include: portable pixel map format (PPM) and portable grayscale map format (PGM).

[0107] S23, calling corresponding font processing software to convert the intermediate font image in the portable format into a scalable vector graphic. In the conversion process, the font processing software can also adjust its corresponding parameters to make the corners of the font sharp or smooth according to the specific custom font style, control the style of curve generation, and enhance the effect of font generation.

[0108] And, the implementation of converting the above obtained scalable vector graphics into a font file of a corresponding format is as follows:

[0109] Taking the font file converted into TTF format as an example, the corresponding font editing tool is called to use the font editing tool to convert the scalable vector graphics into a usable font file in TTF format.

[0110] It should be supplemented here that: one or more second font images can be obtained in the above step 103, each second font image contains different font content, and accordingly, one or more third font images will be generated in the above step 103, and the font content in each third font image is the same as the font content in the corresponding second font image, and the font style is the same as that in the first font image. For the generated one or more third font images, the above steps S21 to S23 will be executed in a loop until each third font image is converted into a corresponding font file. Afterwards, the client can adjust the position of the font in the canvas and the font scaling size according to the actual situation of the custom style font for the one or more font files obtained by conversion, so as to finally merge one or more font files to form a complete font file. For example, the complete and usable font file finally merged may include a set of fonts with the same style as the font in the first font image, and the set of fonts includes 6763 Chinese characters defined in GB2312.

[0111] Figure 4 A schematic diagram of the flow of generating the above-mentioned font file is shown.

[0112] Based on the above content, the method provided in the embodiment of the present application may also include the following steps:

[0113] 105b, converting the third font image to obtain an intermediate font image in a portable format;

[0114] 106. Convert the intermediate font image into a scalable vector graphic;

[0115] 107. Generate a font file (such as in TTF format) corresponding to the font in the first font image based on the scalable vector graphics.

[0116] Furthermore, before executing the above step 105b, the following steps may also be included:

[0117] 105a. Perform resolution adjustment processing on the third font image, so as to trigger execution of the above step 105b based on the third font image after the resolution adjustment.

[0118] In the above, by converting the generated third font image into a scalable vector image, and then converting the scalable vector image into a font file of a set format (such as TTF format), it is beneficial to improve the generation quality of the font file, thereby helping to reduce the workload and cost of font designers in designing a set of fonts.

[0119] In summary, the technical solution provided by this embodiment is that after the user uploads the first font image to the font generation client, the style of some structural elements of the font in the first font image displayed on the client interface can be adjusted. This is used to process the acquired second font image based on the style of the font content in the first font image to generate a third image, so that the font style in the generated third image can better meet the style required by the user. Among them, the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the adjusted first font image.

[0120] The third font image generated by the font generation model can also be displayed on the client interface, and the user can also adjust the style of some structural elements of the font in the displayed third font image. After the adjustment is completed, the third font image can also be used to optimize the underlying model. Based on this, the present application also provides another font generation method embodiment. Specifically, the font generation method includes the following steps:

[0121] 201. Displaying a third font image output by a font generation model on a client interface; wherein the third font image is generated according to a first font image input by a user and an acquired second font image; and the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the first font image;

[0122] 202. In response to a partial structural element style adjustment operation triggered on a font in the third font picture, determine an adjusted third font picture;

[0123] 203. Optimize the font generation model using the adjusted third font image.

[0124] Among them, the third font image is generated by the font generation model based on the first font image input by the user and the second font image obtained; the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the first font image.

[0125] In the above 201-202, the specific implementation details of the font generation model and the generation of the third font image using the font generation model can be referred to the relevant contents in other embodiments. Also, the specific implementation of the style adjustment of some structural elements of the font in the third font image can be referred to the specific implementation of the style adjustment of some structural elements of the font in the first font image described in other embodiments, which will not be described in detail here.

[0126] In the above 203, the adjusted third font image can be used to optimize the parameters of the font generation model using a corresponding loss function. The loss function can be but is not limited to a mean square error loss function. For the mean square error loss function, please refer to the relevant content given in describing the font generation model in other embodiments.

[0127] After the third font image is adjusted as described above, in addition to using the adjusted third font image to optimize the font generation model, the third font image can also be processed (such as enhancing resolution, image format conversion, etc.) to generate a corresponding font file. Based on this, the present application also provides another font generation method embodiment. Specifically, the font generation method includes the following steps:

[0128] 301. Displaying the generated third font image on the client interface;

[0129] 302. In response to a partial structural element style adjustment operation triggered on a font in the third font image, determine an adjusted third font image;

[0130] 303. Process the adjusted third font image to obtain a font file corresponding to the font in the third font image.

[0131] Among them, the third font image is generated based on the first font image input by the user and the second font image obtained; the font content in the third font image is the same as the font content in the second font image, and the font style of the third font image is the same as the font style in the first font image.

[0132] For the specific implementation description of the above 301 to 302, please refer to the relevant content in other embodiments.

[0133] In an achievable technical solution, the above 303 “processing the adjusted third font image to obtain a font file corresponding to the font in the third font image” includes:

[0134] 3011. Convert the third font image to obtain an intermediate font image in a portable format.

[0135] 3012. Convert the intermediate font image into a scalable vector graphic;

[0136] 3013. Generate a font file corresponding to the font content in the third font image based on the scalable vector graphics.

[0137] Furthermore, before executing the above step 3011, the following steps may also be included:

[0138] 3010. Perform resolution adjustment processing on the third font image to trigger execution of the above step 3011 based on the third font image after the resolution adjustment.

[0139] For the specific implementation of the above 3010 to 3013, please refer to the relevant content in other embodiments.

[0140] In addition, the present application also provides an embodiment of a font generation method, the font generation method comprising the following steps:

[0141] 401. In response to a partial structural element style adjustment operation triggered on a font in a displayed first font picture, determine an adjusted first font picture;

[0142] 402. Generate a third font picture based on the adjusted first font picture and second font picture;

[0143] 403. Process the third font image to obtain a corresponding scalable vector image;

[0144] 404. Generate a font file corresponding to the font in the third font image based on the scalable vector image;

[0145] The font content in the third font picture is the same as the font content in the second font picture, and the font style of the third font picture is the same as the font style of the first font picture; the processing at least includes: converting into an intermediate font picture in a portable format.

[0146] For the specific implementation of the above 401-404, please refer to the relevant content in other embodiments, which will not be repeated here. In addition, in addition to the above steps, the method provided in the embodiment of the present application may also include other parts or all of the steps in the above embodiments, which can be specifically referred to the corresponding content of the above embodiments, which will not be repeated here.

[0147] The present application also provides a font generation client, which is developed based on a font generation model and is used to implement the various method embodiments provided in the present application.

[0148] The above-mentioned font generation client is installed and run on the corresponding electronic device.

[0149] Based on the above, the present application also provides an electronic device, such as Figure 5As shown, the electronic device may include but is not limited to any terminal device such as a mobile phone, a tablet, a personal computer (such as a desktop computer, a laptop computer), a PDA (Personal Digital Assistant), a smart wearable device, etc. The electronic device is installed and running with the font generation client described in other embodiments. In addition, in addition to installing and running the above-mentioned font generation client, the electronic device may also run other client applications, such as social applications, entertainment applications, etc.

[0150] The structure of the electronic device may include a memory and a processor. The memory may be configured to store various other data to support operations on the electronic device, examples of which include instructions for any application or method used to operate on the electronic device. For example, the memory may store configuration files of the font generation client and various data generated during the operation process (such as the aforementioned third font image, etc.). In specific implementations, the memory may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, disk or optical disk. Among them,

[0151] The memory mentioned above is at least used to store programs; and

[0152] The processor is coupled to the memory and is used to call and execute the program stored in the memory when the font client is running, so that the font generation client can implement the above-mentioned various method embodiments provided by the present application.

[0153] Furthermore, the above electronic device also includes: communication components, display, power components, audio components and other components.

[0154] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the steps or functions of the methods provided in the above-mentioned method embodiments can be implemented.

[0155] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, can implement the steps or functions of the methods provided in the above-mentioned method embodiments.

[0156] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware. Based on such an understanding, the above technical solution can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product can be stored in a computer-readable storage medium, such as ROM (Read Only Memory) / RAM (Random Access Memory), a disk, an optical disk, etc., including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments. Moreover, the present application can be in 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 codes.

[0157] In addition, the present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0158] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 Alternatively, these computer program instructions may also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0159] It should also be noted that in some of the processes described in the specification, claims and drawings of this application, multiple operations appearing in a specific order are included, and these operations may not be executed in the order in which they appear in this article or in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. And, the descriptions of "first", "second", etc. in this application are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. The term "or / and" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example: A or / and B, indicating that A can exist alone, A and B can exist at the same time, and B can exist alone; the character " / " in this application generally indicates that the front and back associated objects are an "or" relationship. It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a product or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such a product or system. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the product or system including the elements.

[0160] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A font generation method, characterized in that: include: On the client interface, displaying the first font image; In response to a partial structural element style adjustment operation triggered on a font in the first font picture, determining an adjusted first font picture; Get the second font image; generating a third font picture based on the adjusted first font picture and the second font picture; The font content in the third font picture is the same as the font content in the second font picture, and the font style of the third font picture is the same as the font style in the adjusted first font picture.

2. The method according to claim 1, characterized in that In response to a partial structural element style adjustment operation triggered on a font in the first font picture, determining the adjusted first font picture includes: Determining a target structural element for font selection in the first font picture; In response to the style adjustment operation performed on the target structural element, determining the adjusted first font image; The style adjustment operation includes at least one of the following: Adjusting the line shape of the target structural element, wherein the line shape includes one or more of line width, line curvature, and line inclination; Modify the line connections of the target structural element.

3. The method according to claim 2, characterized in that Also includes: After determining the selected target structural element, the display state of the target structural element is updated to indicate that the target structural element is in an adjustable state.

4. The method according to any one of claims 1 to 3, characterized in that Also includes: Converting the third font image to obtain an intermediate font image in a portable format; Converting the intermediate font image into a scalable vector graphic; Based on the scalable vector graphics, a font file corresponding to the font content in the third font image is generated.

5. The method according to any one of claims 1 to 3, characterized in that Generating a third font picture based on the adjusted first font picture and the second font picture includes: Retrieve the font generation model; Inputting the adjusted first font image and the second font image into the font generation model, and outputting the third font image; The font generation model includes a diffusion model, and the images used when performing full parameter fine-tuning training on the diffusion model include: manually designed font images, and font images generated based on existing font files.

6. A font generation method, characterized in that: include: On the client interface, displaying the third font image output by the font generation model; In response to a partial structural element style adjustment operation triggered on a font in the third font picture, determining an adjusted third font picture; Optimizing the font generation model using the adjusted third font image; The third font image is generated by the font generation model according to the first font image input by the user and the acquired second font image; The font content in the third font picture is the same as the font content in the second font picture, and the font style in the third font picture is the same as the font style in the first font picture.

7. A font generation method, characterized in that: On the client interface, the generated third font image is displayed; In response to a partial structural element style adjustment operation triggered on a font in the third font picture, determining an adjusted third font picture; Processing the adjusted third font image to obtain a font file corresponding to the font in the third font image; Wherein, the third font image is generated according to the first font image input by the user and the acquired second font image; The font content in the third font picture is the same as the font content in the second font picture, and the font style in the third font picture is the same as the font style in the first font picture.

8. A font generation method, characterized in that: In response to a partial structural element style adjustment operation triggered on a font in a displayed first font picture, determining an adjusted first font picture; generating a third font picture based on the adjusted first font picture and second font picture; Processing the third font image to obtain a corresponding scalable vector image; Based on the scalable vector graph, generate a font file corresponding to the font in the third font image; The font content in the third font picture is the same as the font content in the second font picture, and the font style of the third font picture is the same as the font style of the first font picture; the processing at least includes: converting into an intermediate font picture in a portable format.

9. A font generation client, characterized in that: The font generation client is developed based on a font generation model to implement the method described in any one of claims 1 to 8 above.

10. An electronic device, characterized in that: The font generation client according to claim 9 is running on the electronic device.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a computer, the method according to any one of claims 1 to 8 can be implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.