Visual Character Deformation Method and System

Through visual character deformation methods and systems, the problem of high cost and insufficient robustness of font watermarks in the prior art is solved, and the simplification and efficiency of character deformation are achieved, and it is suitable for multilingual and different font size scenarios.

CN114385983BActive Publication Date: 2025-07-22HEFEI HIGH DIMENSIONAL DATA TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210083850.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-25
Publication Date
2025-07-22
Estimated Expiration
2042-01-25

AI Technical Summary

Technical Problem

The existing font watermarking technology has shortcomings in terms of labor cost and robustness, especially in scenarios such as screenshots, compressions and photography, and it is only suitable for a few languages and large font scenarios when automatically generating fonts.

Method used

Provide a visual character deformation method and system, by obtaining grouping information and position information of character key points, generating a first character outline diagram, selecting modification areas, groups and methods, visualizing deformation, and saving the deformed key point information.

Benefits of technology

The character deformation process is simplified, the operation steps are reduced, and the deformation efficiency is improved, making the character deformation process more intuitive and efficient, and is suitable for multilingual and different font size scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385983B_ABST
    Figure CN114385983B_ABST
Patent Text Reader

Abstract

The present invention particularly relates to a method for visual character deformation, which includes the following steps: S100, obtaining the grouping information and position information of the key points of the character according to the data of the standard vector character; S200, generating and displaying a first character contour map; S300, selecting the modification area, group and modification method of the key points; S400, determining the key points to be offset according to the selected modification area and group, and deforming the key points to be offset according to the set modification method; S500, generating and displaying a second character contour map; S600, when the user confirms the modification, saving the grouping and position information of all the key points after deformation as a deformed character. The first character contour map can conveniently show the appearance of the character before deformation. By simply clicking or inputting parameters to select the modification area, group and modification method of the key points, the process of character deformation is greatly simplified; through the second character contour map, the effect after deformation can be seen more intuitively and clearly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of font design, and particularly relates to a visual character deformation method and system. Background Art

[0002] Font watermark is a text watermark technology that can encode specific watermark information (such as name, ID, etc.) and hide it in the characters that make up the document. Finally, the watermark information can be extracted using a specific program. After embedding the information, the document will not look significantly different, but in fact, the document has been embedded with unique watermark information, which can achieve copyright protection and leakage traceability of the text content without damaging the original document content and without being noticed by people.

[0003] Currently, there are two technical solutions related to font watermarks. The first solution mainly generates multiple similar fonts by manually fine-tuning the target font and creates a proprietary font library. At the embedding end, different font deformations are selected to express different watermark information. These fonts are almost indistinguishable to the human eye, but at the extraction end, they can be recognized by image matching to extract the watermark information. The drawback of this solution is that it requires a large amount of manual and time costs to design the font library; at the same time, since a single glyph change is used to represent information, the robustness of this solution is weak, and the watermark information cannot be successfully extracted in common scenarios such as screenshot, compression, photographing of paper documents, and photographing of screen documents.

[0004] Another solution semi-automatically generates similar fonts of the target font through a glyph flow graph, and then trains a classification network for different variants of each glyph to extract information. This solution can semi-automatically generate a font library, saving labor costs compared to the first solution. However, since a corresponding classification network needs to be trained for each glyph, this solution is only applicable to languages with fewer glyph types (such as English) and can only be used in scenarios with larger font sizes (such as posters). Summary of the Invention

[0005] The primary object of the present invention is to provide a visual character deformation method that can conveniently deform fonts.

[0006] To achieve the above object, the technical solution adopted by the present invention is as follows: A visual character deformation method, comprising the following steps: S100. Obtain the grouping information and position information of the key points of the character according to the data of the standard vector character; S200. Generate a first character contour map based on the position information of all the key points and display it; S300. Select the modification area, group, and modification method of the key points; S400. Determine the key points to be offset according to the selected modification area and group, and deform the key points to be offset according to the set modification method; S500. Generate a second character contour map based on the position information of all the key points after deformation and display it; S600. When the user confirms the modification, save the grouping and position information of all the key points after deformation as a deformed character.

[0007] Another object of the present invention is to provide a visual character deformation system, which can conveniently deform the font.

[0008] To achieve the above object, the technical solution adopted by the present invention is as follows: A visual character deformation system, comprising a character key point reading module for obtaining the grouping information and position information of the key points of the character from the data of the standard vector character; a first display module for displaying the first character contour map; a character parameter selection module for selecting the modification area, group, and modification method of the key points; a character deformation module for deforming the character according to the selected parameters; a second display module for displaying the second character contour map; and a character generation module for generating a deformed character according to the grouping and position information of the key points after deformation.

[0009] Compared with the prior art, the present invention has the following technical effects: By displaying the first character contour map, it is convenient to clearly see the appearance of the character before deformation. Then, by simply selecting the modification area, group, and modification method of the key points through point selection or parameter input, the standard vector character can be conveniently deformed, greatly simplifying the character deformation process; at the same time, this deformation process is visual, and the deformed effect can be more intuitively and clearly seen through the second character contour map. Description of the Drawings

[0010] Figure 1 is a schematic flow chart of the visual character deformation method in the present invention;

[0011] Figure 2 is a schematic block diagram of the visual character deformation system in the present invention;

[0012] Figure 3 is an interface diagram of the visual character deformation system in the present invention. Detailed Embodiments

[0013] The following combines Figures 1 to 3 to further describe the present invention in detail.

[0014] Refer to Figure 1 , a visual character deformation method, including the following steps: S100. Obtain the grouping information and position information of the key points of the character according to the data of the standard vector character; S200. Generate and display the first character contour map according to the position information of all key points; S300. Select the modification area, group and modification method of the key points; S400. Determine the key points to be offset according to the selected modification area and group, and deform the key points to be offset according to the set modification method. When deforming, the coordinates of the key points after deformation should not exceed the original boundary range. We can determine four extreme values Xmax, Xmin, Ymax, and Ymin according to the coordinates of all key points of the standard vector character, which represent the maximum abscissa, minimum abscissa, maximum ordinate, and minimum ordinate of all key points of the standard vector character respectively. The coordinates (x, y) of all key points after deformation should be within these extreme values; S500. Generate and display the second character contour map according to the position information of all key points after deformation; S600. When the user confirms the modification, save the grouping and position information of all key points after deformation as the deformed character. By displaying the first character contour map, it is convenient to clearly see the appearance of the character before deformation. Then, by simply clicking or parameter input to select the modification area, group and modification method of the key points, the standard vector character can be deformed conveniently, greatly simplifying the process of character deformation; at the same time, this deformation process is visual, and the effect after deformation can be seen more intuitively and clearly through the second character contour map.

[0015] There are two key points in the present invention: First, by displaying the first character contour map and the second character contour map, it is convenient to see the appearance of the character before and after deformation. When displaying the second character contour map, it can be superimposed and displayed on the first character contour map at the same time, so that the difference before and after deformation is more intuitive; Second, here the character is modified by selecting the modification area, group and modification method of the key points. By defining these three parameters, the deformation process of the character becomes more streamlined. For all fonts, we can operate in this way. More importantly, the selection of these three parameters can be realized through mouse clicks and keyboard input, greatly simplifying the operation steps when deforming the character, reducing the deformation time of the character significantly, and generally a certain character can be deformed in a few seconds.

[0016] In the vector character data, generally the key point data of the character is saved. The character forms a contour by the connection lines between these key points. The connection lines are generally line segments or Bezier curves. The font is generally in the ttf format. We can first convert it into the svg format, and then convert the svg format into the json format of a single character, and then directly read the position information of the key points from the json format of the single character.

[0017] The following is a typical svg format data. <glyph glyph-name="uni4EBA" unicode="人" d="M171 48Q191 18 198 9Q205 1 240-4L240-9Q211-9 196-13L120 119Q90 2324-22L21-17Q53 5 78 46Q103 88 113 139Q120 173 120 190Q120 197 119 199L122203L137 181Q132 179 130 167Q126 149 122 129Q157 70 171 48Z" horiz-adv-x="256"vert-adv-y="256" / > ,This data is obtained through processing by a third-party library. Different algorithms process different data for the same word.

[0018] In this data segment, we can read the following information from the content after "d=": The data after "M" constitutes a group. Generally, we use English part to describe "group". Some characters have only one part, and some characters have multiple parts. "L" represents a straight line, and the data before and after it represent the coordinates of the starting point and the end point of the straight line respectively; "Q" represents a Bezier curve. When converting from svg format to json format, these coordinates are converted into corresponding position information.

[0019] for example Figure 3 The character "如" shown in the figure has 4 parts. The outer contour of the "女" character corresponds to part0, the inner contour of the "女" character corresponds to part3, the outer contour of the "口" character corresponds to part1, and the inner contour of the "口" character corresponds to part2. When deforming, we want to move the horizontal line next to the "女" character upward, so we need to select two groups, part0 and part3, and then select the upper middle area of the two groups as the modification area, and finally move all the key points in the area upward. We select the group mainly to avoid interference from key points of other groups and simplify the selection process of the modification area.

[0020] Furthermore, it includes a preset scheme. The preset scheme stores numbers and the modification areas corresponding to the numbers. In step S300, the selection of the modification area is achieved by selecting the number of the preset scheme. Among the three parameters that need to be selected, the modification area takes the most time. Here, by setting the preset scheme, numbers are assigned in advance to some common modification areas. Then, when deforming the characters, only the number corresponding to the modification area needs to be input to quickly select the modification area, so that the deformation of the characters can be realized more conveniently and quickly. For characters with the same radical, the same modification area can be selected. The numbers of the preset scheme can be named with easily understandable names, so that the preset scheme can be quickly selected according to the name in the later stage. By using the preset scheme, the speed of character deformation is further increased. And for most characters, for various different fonts, such as regular script, Song typeface, Microsoft YaHei, etc., the same modification area can be selected.

[0021] Furthermore, in steps S200 and S500, the first character contour map and the second character contour map include key points and contour lines. The key points are indicated by circles, triangles, stars, etc., and the contour lines are line segments between the key points or the outer contour lines of the character bitmaps generated according to the key points. In actual use, different groups of key points can be distinguished by different shapes or colors. The contour lines are preferably indicated by line segments between the key points, which can reduce the computational amount.

[0022] There are many ways to determine the modification area. In order to enable users to more conveniently select the modification area, preferably in the present invention, in step S300, the modification area can be one of the following three shapes: Shape 1, an area enclosed by straight lines; Shape 2, an area enclosed by a straight line and a curve; Shape 3, an area enclosed by curves. Shape 1 corresponds to various polygons, Shape 2 corresponds to some irregular shapes, and Shape 3 includes circles, ellipses, and other shapes enclosed by curves. Using a straight line and a curve to enclose the modification area can facilitate expressing the modification area in the form of a function. In this way, it is also convenient to save the parameters of the modification area.

[0023] Although we have preset some modification regions, it is actually impossible to exhaust all possible modification regions. Therefore, the present invention also provides a solution that can quickly edit the modification regions at any time. Specifically, for the above-mentioned Shape 1, it can be automatically generated by inserting points in the contour diagram through the following steps: S210. The user inserts the first point, denoted as the starting point. Since a single point cannot generate a modification region, after inserting the first point, the system will continue to wait for the user to insert the next point. And if the user stops inserting the next point, the first point will be cancelled and a prompt will be given indicating that the generation of the modification region has failed; S220. The user inserts the second point. If the user finishes inserting points, a rectangle is drawn with the first point and the second point to form the modification region. The first point and the second point are the two diagonal points of the rectangle, and one of the sides of the rectangle is horizontally arranged. Through this step, the user can obtain the modification region by inserting two points, which is very convenient to use. If the user continues to insert points, the next step is executed, S230. The user continues to insert points, and the polygon generated from these three or more points forms the modification region. For example, if the user inserts three points at this time, the triangle generated by these three points constitutes the modification region. If the user inserts four points (the fourth point is not within the triangle formed by the previous three points), the quadrilateral generated by these four points constitutes the modification region, and so on; S240. The modification regions are numbered and stored as preset schemes. By selecting the modification regions in a point-selection manner, the user operation is very convenient and fast.

[0024] There are many choices for the modification method, and the key point of the present invention lies in visualization. Therefore, preferably, the modification method is composed of a modification direction and an offset. Generally, the modification directions include four directions: up, down, left, and right. The offset is a constant in pixels. For example, in a specific embodiment of the present invention, the default value is 7, that is, all key points to be offset are offset according to this offset; of course, the offset can also be a gradient value. After setting the maximum offset as d, the offset of the key points to be offset changes in the trend of 0→d→0. The specific offset value needs to be set according to the size of the first character contour diagram, generally 1% - 10% of the size of the first character contour diagram, which can be adjusted at any time or preset in advance. For example, when the size of the first character contour diagram is 256*256, d can take values from 3 to 25, and the optimal value is 10. By means of the two parameters of the modification direction and the offset, the offset of the key points can be conveniently realized.

[0025] Refer to Figure 2, the present invention also discloses a visual character deformation system, including a character key point reading module for obtaining the grouping information and position information of the character key points from the data of standard vector characters; a first display module for displaying a first character outline diagram; a character parameter selection module for selecting the modification area, group and modification method of the key points; a character deformation module for deforming the character according to the selected parameters; a second display module for displaying a second character outline diagram; and a character generation module for generating a deformed character according to the grouping and position information of the deformed key points. By setting the above modules, the deformation of standard vector characters can be conveniently realized.

[0026] Furthermore, the character key point reading module includes a format conversion unit for converting the font file into json format data of a single character; a character selection unit for selecting the standard vector character to be deformed; and a character reading unit for reading the corresponding json format data of the selected standard vector character to obtain the grouping information and position information of the key points and outputting them to the first display module. The character parameter selection module includes a modification area selection unit for selecting the corresponding modification area according to the number of the preset scheme; a group selection unit for selecting the group of key points; an offset direction selection unit for selecting the offset direction of the key points; and an offset amount selection unit for selecting the offset amount of the key points. By setting these units, each function can be realized more conveniently.

[0027] Figure 3This is the interface diagram of the visual character deformation system. We will use this interface as an example to explain the character deformation process in detail. (1) Click the "Format Conversion" button to execute the function of the format conversion unit. It will pop up a window for the user to select a font file in ttf or other formats, and after the user has made the selection, the font file will be converted into json format data of a single character; (2) Enter the character you want to deform in the text box below the "Format Conversion" button, such as the character "如". This text box is equivalent to the character selection unit; (3) Click the "Reset" button to find the corresponding json format data based on the Chinese character "如", and read the grouping information and position information of the key points from it, and then output it to the first display module, that is, the display box on the left side of the "Reset" button. When displayed here, different groups of key points or contour lines can be distinguished by different shapes or colors; (4) When deforming the character "如", it belongs to the common female radical, and generally has a preset scheme. The preset scheme is numbered NZP-1, and the corresponding modification area includes the horizontal line part of the female radical of the character "如". Enter "NZP-1" in the text box after the variant number. That’s it; if there is no preset plan, we can click the "Edit Modification Area" button and generate the modification area according to steps S210-240. This part is equivalent to the modification area selection unit; (5) Determine the group according to the color, and then enter the corresponding serial number in the group input text box. The serial numbers of multiple groups are separated by commas. This part is equivalent to the group selection unit; (6) Select the offset direction of the key point through the drop-down menu, and enter the offset pixel value in the offset text box. This part is equivalent to the offset direction selection unit and the offset selection unit; (7) After completing the modification parameter selection, we click the "Deform" button, and the system will deform the word "如" according to the set parameters, and display the deformed second character outline in the display box on the left of the "Deform" button; (8) At this time, you can judge whether to save the deformed character based on the deformation effect. If you need to save it, enter the location you want to save in the text box on the left of the "Save Character" button, and then click "Save Character" to save the key point information of the deformed character to the font file. At this point, if we want to deform characters such as "奴", "姐", "妹", "妈", etc., we only need to enter the corresponding Chinese characters in the text box below "Format Conversion", then click the "Reset" button, click the "Deform" button, enter the save location, and then click the "Save Character" button. It is very convenient. If you are not satisfied with the deformation effect, you can click the "Remove" button to delete the second character outline. Then return to step (4) and reselect the modified parameters.

[0028] If there is no preset solution in step (4), we can click the "Edit Modification Area" button and select the modification area by means of the insertion point in the pop-up interface according to steps S210 - S240. To simplify the operation steps and improve the visualization effect, we can cancel the "Reset" button. After the user enters the character "ru", the corresponding first character contour diagram can be automatically generated; after the user enters the group number, the key points of the selected group can be highlighted in the first character contour diagram; and other similar modifications, as long as the specific functions can be realized.

[0029] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the foregoing visual character deformation method is implemented. At the same time, an electronic device is also disclosed, including a memory, a processor, and a computer program stored on the memory. When the processor executes the computer program, the foregoing visual character deformation method is implemented.

Claims

1. A visual character deformation method, characterized in that: It includes the following steps: S100. Obtain the grouping information and position information of the key points of the character according to the data of the standard vector character; S200. Generate a first character contour map based on the position information of all key points and display it; S300. Select the modification area, group, and modification method of the key points. The selection of the three parameters of the modification area, group, and modification method can all be achieved through mouse clicks and keyboard input; S400. Determine the key points to be offset according to the selected modification area and group, and deform the key points to be offset according to the set modification method. The set modification method includes a preset scheme, and the preset scheme stores numbers and the modification areas corresponding to the numbers. In step S300, the selection of the modification area is achieved by selecting the number of the preset scheme; S500. Generate a second character contour map based on the position information of all key points after deformation and display it, where the second character contour map is superimposed and displayed on the first character contour map; S600. When the user confirms the modification, save the grouping and position information of all key points after deformation as a deformed character.

2. The visualized character deformation method according to claim 1, wherein: In steps S200 and S500, the first character contour map and the second character contour map include key points and contour lines. The key points are indicated by circles or triangles or stars, and the contour lines are line segments between key points or the outer contour lines of character bitmaps generated according to key points.

3. The visualized character deformation method according to claim 1, wherein: In step S300, the modification area can be one of the following three shapes: Shape 1, an area enclosed by straight lines; Shape 2, an area enclosed by a straight line and a curve; Shape 3, an area enclosed by curves.

4. The visualized character deformation method according to claim 1, wherein: The modification method is composed of a modification direction and an offset amount. The modification direction includes four directions: up, down, left, and right.

5. The visualized character deformation method according to claim 1, wherein: In step S300, the modification area is enclosed by straight lines and is automatically generated by inserting points in the first character contour map through the following steps: S210. The user inserts the first point, denoted as the starting point; S220. The user inserts the second point. If the user ends inserting points, draw a rectangle with the first point and the second point to form the modification area. The first point and the second point are two diagonal points of the rectangle, and one side of the rectangle is horizontally arranged. If the user continues to insert points, proceed to the next step; S230. The user continues to insert points, and the polygon generated according to these three or more points forms the modification area; S240. Number the modification area and store it as a preset scheme.

6. A visual character deformation system, characterized in that: It includes a character key point reading module for obtaining the grouping information and position information of the key points of the character from the data of the standard vector character. The character key point reading module includes: a format conversion unit for converting the font file into json data of a single character; a character selection unit for selecting the standard vector character to be deformed; a character reading unit for reading the corresponding json data of the selected standard vector character to obtain the grouping information and position information of the key points and outputting them to the first display module; a first display module for displaying the first character contour map; A character parameter selection module for selecting the modification area, group, and modification method of key points, where the character parameter selection module includes: A modification area selection unit for selecting the corresponding modification area according to the number of a preset scheme; A grouping selection unit for selecting the group of key points; An offset direction selection unit for selecting the offset direction of key points; An offset amount selection unit for selecting the offset amount of key points; Among them, the selection of the three parameters of the modification area, group, and modification method can all be achieved through mouse clicks and keyboard inputs; A character deformation module for deforming characters according to the selected parameters; A second display module for displaying a second character contour diagram, where the second character contour diagram is superimposed and displayed on the first character contour diagram; A character generation module for generating deformed characters according to the grouping and position information of key points after deformation.

7. A computer-readable storage medium, characterized in that: It stores a computer program, and when the computer program is executed by a processor, it implements the visual character deformation method described in any one of claims 1-5.

8. An electronic device, characterized in that: It includes a memory, a processor, and a computer program stored on the memory. When the processor executes the computer program, it implements the visual character deformation method described in any one of claims 1-5.

Citation Information

Patent Citations

  • Implementation method for personalized Chinese character word library

    CN104063359A

  • Chinese character pattern and layout design method and system for dynamically adjusting parameters

    CN112232022A