A handwriting font rendering method and device based on physical guide clues
By acquiring writing parameters to form strokes and lines, the problem of not being able to record the details of the handwriting process in existing technologies has been solved, enabling dynamic display and guidance of the handwriting process and improving the effectiveness of calligraphy learning.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUAZHONG NORMAL UNIV
- Filing Date
- 2026-06-24
- Publication Date
- 2026-07-31
AI Technical Summary
Existing character rendering technologies cannot effectively record and reproduce the details of the handwriting process, such as stroke order, pen pressure, and ink overlay, making it difficult to meet the needs of education and art display.
By acquiring writing parameters during the writing process, the shape and position of the brushstroke at each moment are determined to form a stroke. Preset connection points are set in the stroke shape to form a string, which extends along the direction of the stroke. Combined with pixel accumulation and process processing, the details of the writing process are displayed.
It enables dynamic display of the handwriting process, guides practitioners in learning calligraphy, and improves the effectiveness of handwriting training and calligraphy learning.
Smart Images

Figure CN122488992A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of text information processing technology, and in particular to a method and apparatus for presenting handwritten fonts based on physical guidance cues. Background Technology
[0002] Currently, character display methods mainly fall into two categories: two-dimensional display and three-dimensional display. Two-dimensional displays are commonly found in books, calligraphy copybooks, rubbings of stone tablets, couplets, etc., and are primarily achieved through printing, hand-drawing, and writing. These methods only present the final result of writing or printing, showing the final shape and outline of the character, with uniform color distribution, and cannot reflect the character's creation process. Three-dimensional displays are found in stone carvings, engravings, seals, plaques, etc., using carving, molding, and other methods to give the character a certain depth or height, creating a three-dimensional effect. However, these three-dimensional characters also only show the final outline and shape, and their depth or height distribution is usually uniform, aiming to enhance the visual effect rather than record the writing process.
[0003] In conclusion, both two-dimensional and three-dimensional methods of presenting characters statically and uniformly display their final form, failing to preserve dynamic information from the writing process, such as stroke order, pressure, speed variations, and ink layering. Therefore, these methods offer very limited guidance for handwriting training and calligraphy learning.
[0004] To address these shortcomings, digital and video recording techniques have emerged in recent years to showcase the writing process. For example, in calligraphy instruction, the writing process with a brush or pen is recorded using video equipment, allowing learners to watch videos to understand the principles and steps of writing. In the field of art exhibitions, calligraphy works are sometimes created as 3D or 4D dynamic videos to simulate the writing process. However, these methods still have significant drawbacks: video-based methods are limited by shooting angle, resolution, and lighting, making it difficult to fully capture the changes in pressure during the writing process, and ordinary observers often struggle to discern subtle details such as brushstroke transitions and ink layering in the video. Furthermore, dynamic works generated through 3D / 4D design techniques mostly emphasize the three-dimensional beauty and visual impact of the characters, failing to truly reflect the basic principles and process information of character writing, thus offering limited guidance value for actual writing training.
[0005] It is evident that existing character presentation technologies generally aim to display the final shape and outline, lacking the recording and reproduction of details of the writing process, and thus failing to meet the urgent need for descriptions of the handwriting process in education, teaching, and art exhibitions. Therefore, this invention proposes a character presentation method and experience tool that can embody information about the writing process and provide physical and visual guidance for handwriting training and calligraphy learning. Summary of the Invention
[0006] This invention provides a method and apparatus for presenting handwritten fonts based on physical guidance cues, which solves the technical problem that the prior art fails to fully display the details of character formation.
[0007] According to one aspect of the present invention, a method for presenting handwritten fonts based on physical guidance cues is provided, comprising: Obtain writing parameters during the writing process; The location of the pen stroke shape at each moment is determined based on the writing parameters; Strokes are formed based on the shape of the brushstroke at each moment; Based on the preset connection points in the stroke shape at each moment, a brushstroke is formed, such that the brushstroke extends along the stroke direction.
[0008] Optionally, the writing parameters include at least time, coordinates of the pen stroke center point, and a preset pen stroke shape; determining the position of the pen stroke shape at each moment based on the writing parameters includes: The position of the pen stroke shape on the paper is determined based on the coordinates of the pen stroke center point and the preset pen stroke shape; the coordinates of the pen stroke center point change with time, and the time difference between adjacent pen stroke shapes is a preset time interval.
[0009] Optionally, forming strokes based on the stroke shape at each moment includes: The pixels on the brushstroke shape at each moment are accumulated in chronological order to form a stroke.
[0010] Optionally, before forming the brushstroke at the preset connection points in the brushstroke shape at each moment, the following steps are included: Multiple preset connection points are set in the brush stroke shape, and the spacing between the preset connection points is positively correlated with the size of the brush stroke shape.
[0011] Optionally, the formation of the brushstroke based on the preset connection points in the brushstroke shape at each moment includes: Connect the preset connection points at the same position in the stroke shape at each moment to form multiple lines, so that the multiple lines extend from the starting point of the stroke to the ending point of the stroke.
[0012] Optionally, when there are overlapping parts in the strokes, the stroke formation based on the stroke shape at each moment includes: The later-appearing stroke shape in the overlapping part covers the earlier-appearing stroke shape, and starting from the covered part, the pixels on the stroke shape at each moment are accumulated in chronological order to form the subsequent stroke. The formation of wire drawing based on preset connection points in the stroke shape at each moment includes: Starting from the covered area, the preset connection points at corresponding positions in the brushstroke shape at each moment are connected to form a string.
[0013] Optionally, it also includes: When there are overlapping parts between strokes, the stroke shape of the overlapping part of the later stroke is overlaid on the stroke shape of the overlapping part of the earlier stroke, and the pixels on the stroke shape of the later stroke at each moment are accumulated in time sequence to form the stroke; the edge of the overlapping part is displayed as the edge of the later stroke.
[0014] According to another aspect of the present invention, a handwritten font presentation device based on physical guidance cues is provided, comprising: The parameter acquisition unit is used to acquire writing parameters during the writing process; A position determination unit is used to determine the position of the pen stroke shape at each moment based on the writing parameters; A stroke forming unit is used to form a stroke based on the stroke shape at each moment; A wire drawing unit is used to form wires based on preset connection points in the stroke shape at each moment, such that the wires extend along the stroke direction.
[0015] Optional, also includes: The first font generation module is used to generate a font on a calligraphy template, and to apply a softening process and a hardening process to the corresponding area of the font based on the numerical changes of the pixel depth value and / or stroke width value; the degree of application of the softening process is positively correlated with the numerical values of the pixel depth value and / or stroke width value, and the degree of application of the hardening process is negatively correlated with the numerical values of the pixel depth value and / or stroke width value; the pixel depth value and / or stroke width value are continuously distributed in different areas of the font.
[0016] Optional, also includes: The second font generation module is used to generate a font on a calligraphy template and apply a roughening or smoothing process to the corresponding area of the font based on the changes in pixel depth values and / or stroke width values. The degree of roughening is positively correlated with the values of pixel depth values and / or stroke width values, and the degree of smoothing is negatively correlated with the values of pixel depth values and / or stroke width values. The pixel depth values and / or stroke width values are continuously distributed in different areas of the font.
[0017] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the handwritten font presentation method based on physical guidance cues according to any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the handwritten font presentation method based on physical guidance cues as described in any embodiment of the present invention.
[0019] The technical solution of this invention involves acquiring writing parameters during the writing process; determining the position of the brushstroke shape at each moment based on the writing parameters; forming a stroke based on the brushstroke shape at each moment; and forming a string based on the preset connection point in the brushstroke shape at each moment, so that the string extends along the direction of the stroke, allowing the learner to identify the direction of the stroke based on the string, thereby guiding the learner to learn calligraphy.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a handwritten font presentation method based on physical guidance cues provided in Embodiment 1 of the present invention; Figure 2 This is a flowchart of a handwritten font presentation method based on physical guidance cues according to Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the pen stroke shape corresponding to the writing parameters collected in one embodiment of the present invention; Figure 4 This is a schematic diagram of a font formed by accumulating the pixels of the brush stroke graphic at each moment in one embodiment of the present invention. Figure 5 This is a schematic diagram showing the connection of preset connection points corresponding to multiple consecutive brush stroke shapes in one embodiment of the present invention; Figure 6This is a schematic diagram illustrating the formation of a font with brushed stripes and a font without brushed stripes in one embodiment of the present invention; Figure 7 This is a schematic diagram of fonts with and without occlusion effects in one embodiment of the present invention; Figure 8 This is a schematic diagram of a font with and without the softening and hardening process applied, according to an embodiment of the present invention. Figure 9 This is a schematic diagram of a font with roughening and smoothing processes applied and without softening and hardening processes applied, according to an embodiment of the present invention; Figure 10 This is an architectural diagram of a handwritten font presentation device based on physical guidance cues according to Embodiment 3 of the present invention; Figure 11 This is a schematic diagram of the structure of an electronic device that implements the handwritten font presentation method based on physical guidance cues according to embodiments of the present invention. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0025] Example 1 Figure 1 The flowchart illustrates a method for presenting handwritten fonts based on physical guidance cues, as provided in Embodiment 1 of the present invention. Figure 1 As shown, the method includes: S101. Obtain writing parameters during the writing process.
[0026] The writing parameters can include the writing time, stroke shape, center coordinates of each stroke shape, and writing pressure. The time interval between adjacent stroke shapes can be calculated based on the sampling frequency; the stroke shape can be preset, for example, set to an ellipse, strip, wedge, circle, or teardrop shape; the center coordinates are the coordinates of the center point of the stroke shape; and the writing pressure is proportional to the size of the stroke shape.
[0027] It should be noted that multiple consecutive stroke shapes can be captured during the writing process, and each stroke shape will appear in different positions on the paper or drawing board depending on the extension of the stroke.
[0028] S102. Determine the position of the pen stroke shape at each moment based on the writing parameters.
[0029] Specifically, the location of the stroke shape can be determined based on the center coordinates of the stroke shape at each moment in the writing parameters and the pre-set stroke shape. For example, for the center coordinates a(x) of the stroke shape at a certain moment... t y t Based on the pre-set elliptical stroke shape, the stroke shape s(x,y,x) at time t can be generated. t ,y t The ink strokes are represented by x and y, where x and y represent the coordinates of points within the stroke shape centered at ellipse a, and (x, y) are points within the following ellipse:
[0030] c is the length of the semi-major axis, and d is the length of the semi-minor axis.
[0031] S103. Strokes are formed based on the shape of the brushstroke at each moment.
[0032] The shapes of each stroke can be arranged on the paper at once to form the strokes of a font. More strokes can be added gradually using the above method to form a font.
[0033] In this embodiment, the stroke shapes at each moment can be superimposed to form a stroke, or the pixel values of each point can be accumulated to form a stroke. It should be noted that the sampling frequency in this embodiment cannot be too low to avoid a certain distance between adjacent stroke shapes. The sampling frequency can be set to 25Hz or 30Hz, or it can be set as needed.
[0034] S104. Based on the preset connection points in the stroke shape at each moment, a wire is formed, such that the wire extends along the stroke direction.
[0035] At least one preset connection point can be set in the brushstroke shape at each moment. It should be noted that the positions of the preset connection points in each brushstroke shape should be corresponding, that is, they should all be in the same position in their respective brushstroke shapes. Connecting the preset connection points in the brushstroke shape at each moment with a line will produce the brushstroke, thus allowing the copyist to clearly see the direction of the brushstroke.
[0036] In this embodiment, multiple preset connection points can be set in the brush stroke shape at each moment, so that multiple brush strokes can be obtained by connecting the preset connection points at the same position in the brush stroke shape at each moment.
[0037] The technical solution of this invention involves acquiring writing parameters during the writing process; determining the position of the brushstroke shape at each moment based on the writing parameters; forming a stroke based on the brushstroke shape at each moment; and forming a string based on the preset connection point in the brushstroke shape at each moment, so that the string extends along the direction of the stroke, allowing the learner to identify the direction of the stroke based on the string, thereby guiding the learner to learn calligraphy.
[0038] Example 2 Figure 2 This is a flowchart illustrating a method for presenting handwritten fonts based on physical guidance cues, as provided in Embodiment 2 of the present invention. Figure 2 As shown, the method includes: S201. Obtain writing parameters during the writing process.
[0039] The writing parameters can include the writing time, stroke shape, center coordinates of each stroke shape, and writing pressure. The time interval between adjacent stroke shapes can be calculated based on the sampling frequency; the stroke shape can be preset, for example, set to an ellipse, strip, wedge, circle, or teardrop shape; the center coordinates are the coordinates of the center point of the stroke shape; and the writing pressure is proportional to the size of the stroke shape.
[0040] It should be noted that the character images are designed using design software. The stroke shapes can be customized; for example, pen strokes are slanted elongated strips, while brush strokes are slanted ellipses. The handwriting trajectory is defined, and the stroke image is swept along this trajectory to obtain the designed stroke image. Furthermore, since the stroke thickness varies at different positions within the designed stroke, stroke shapes of corresponding lengths can be selected for areas of different thicknesses. Specifically, the stroke shapes at each moment during the writing process can be referenced. Figure 3 , Figure 3 It includes the brushstroke shapes at three times: t, t+1, and t+2.
[0041] S202. Determine the position of the pen stroke shape on the paper based on the coordinates of the pen stroke center point and the preset pen stroke shape; the coordinates of the pen stroke center point change with time, and the time difference between adjacent pen stroke shapes is a preset time interval.
[0042] The location of the stroke shape can be determined based on the center coordinates of the stroke shape at each moment in the writing parameters and the pre-set stroke shape. For example, for the center coordinates a(x) of the stroke shape at a certain moment... t y t Based on a pre-defined elliptical stroke shape, the stroke shape s(x,y,x) at time t can be generated. t ,y t The ink strokes are represented by x and y, where x and y represent the coordinates of points within the stroke shape centered at ellipse a, and (x, y) are points within the following ellipse:
[0043] c is the length of the semi-major axis, and d is the length of the semi-minor axis.
[0044] The time difference between adjacent stroke shapes is a preset time interval. For example, the preset time interval is 40ms when the sampling frequency is 25Hz and 20ms when the sampling frequency is 50Hz.
[0045] S203. The pixels on the stroke shape at each moment are accumulated in chronological order to form a stroke.
[0046] A complete stroke can be obtained by accumulating the strokes from the start time 0 to the completion time tend: f(t) = (T=0, 1, 2,…tend) In this embodiment, the depth (ink amount) of each pixel on each stroke shape can be set to 0.1. When there are n stroke shapes at the same position, the pixel value depth of that point is 0.1n. The depth (ink amount) of the pixel can be set to be less than or equal to 1.
[0047] Because the writing speed varies across different parts of a stroke, when writing is slower, the distance between the center coordinates of adjacent stroke shapes is closer, resulting in more stroke shapes on the same pixel and thus a deeper depth, forming a darker ink mark. Conversely, when writing is faster, the distance between the center coordinates of adjacent stroke shapes is farther, resulting in fewer stroke shapes on the same pixel and thus a lower accumulated depth value, forming a lighter ink mark. Therefore, by accumulating the pixels on the stroke shapes at each moment in chronological order, the resulting ink accumulation density design of the font is as follows: Figure 4 As shown, Figure 4In areas where the stroke speed is fast, the color depth is lighter, while in areas where the stroke speed is slow, the color depth is darker.
[0048] S204. A plurality of preset connection points are set in the brush stroke shape, and the spacing between the preset connection points is positively correlated with the size of the brush stroke shape.
[0049] In this embodiment, multiple preset connection points can be set in the stroke shape, and the positions of the preset connection points in each stroke shape are set accordingly, that is, the positions of the preset connection points in each stroke shape are the same. For example, multiple preset connection points can be set side by side at equal intervals along the semi-major axis of the ellipse, and the spacing between adjacent preset connection points varies with the length of the semi-major axis.
[0050] S205. Connect the preset connection points at the same position in the stroke shape at each moment to form multiple lines, so that the multiple lines extend from the starting point of the stroke to the ending point of the stroke.
[0051] By connecting the pre-defined connection points at the same location within the brushstroke shape at each moment, multiple fine lines can be created, allowing the copyist to clearly see the direction of the brushstroke. For a specific example, refer to [reference needed]. Figure 5 , Figure 5 Each stroke shape contains 8 preset connection points, each set at a fixed position within the stroke shape. The spacing between adjacent preset connection points within the same stroke shape is positively correlated with the size of the stroke shape. For example, when the semi-major axis of an elliptical stroke shape doubles, the spacing between adjacent preset connection points also doubles; similarly, when the semi-major axis of an elliptical stroke shape halves, the spacing between adjacent preset connection points also halves.
[0052] Once the font with brushed stripes is formed, its schematic diagram is as follows: Figure 6 As shown, Figure 6 The text on the left side of the middle section is a brushed striped font. Figure 6 The font on the right is without brushed lines. From the perspective of human vision, brushed lines in a font are parallel textured lines or distorted parallel textured lines.
[0053] In the actual process of forming brush strokes, when multiple consecutive brush strokes are relatively large (with a larger semi-major axis), the intervals between the brush strokes are also relatively large; conversely, when multiple consecutive brush strokes are relatively small (with a smaller semi-major axis), the intervals between the brush strokes are also relatively small. It should be noted that the pressure applied to a stroke is reflected in the thickness of the stroke and the intervals between the brush strokes. As the pressure increases, the area of the brush stroke increases, and the corresponding intervals between the brush strokes increase.
[0054] S206. When there is an overlapping part between strokes, the stroke shape of the overlapping part of the later stroke is covered on the stroke shape of the overlapping part of the earlier stroke, and the pixels on the stroke shape of the later stroke at each moment are accumulated in time order to form a stroke; the edge of the overlapping part is displayed as the edge of the later stroke.
[0055] In this case, the time point at which the later stroke appears is greater than the time point at which the earlier stroke appears.
[0056] It should be noted that when there are overlapping parts between strokes, the stroke shape of the later stroke in the overlapping part can be overlaid on the stroke shape of the earlier stroke in the overlapping part. That is, the pixel depth of the earlier stroke's overlapping part on the paper is set to 0, and the pixel depth of the later stroke's overlapping part is summed to obtain the pixel depth of the overlapping area. To show that the overlapping part is caused by the later stroke occluding the earlier stroke, i.e., the later stroke appears after the earlier stroke, the edge of the overlapping area needs to be set to the edge of the later stroke. For example... Figure 7 As shown, Figure 7 The font on the left side of the middle section does not show the overlapping stroke relationships. Figure 7 The text on the right side shows the overlapping strokes, with the depth of the overlapping part being the depth of the next stroke and the edge of the overlapping part being the edge of the next stroke.
[0057] In a specific embodiment, when there is an overlapping part in the stroke, the stroke shape that appears later in the overlapping part covers the stroke shape that appears earlier, and starting from the covered part, the pixels on the stroke shape at each moment are accumulated in chronological order to form the subsequent stroke; starting from the covered part, the preset connection points at the corresponding positions in the stroke shape at each moment are connected to form a string.
[0058] For overlapping portions within a stroke, the point where the overlap first appears can be used as the dividing point. The stroke shape after the dividing point is overlaid on the stroke shape before the dividing point. That is, the pixel depth of the stroke shape belonging to the overlapping portion after the dividing point is set to 0, and the pixel depths of these stroke shapes are accumulated to obtain the pixel depth of the overlapping area. To show that the overlapping portion is a stroke after the dividing point occluding a stroke before the dividing point (i.e., a stroke after the dividing point appears after a stroke before the dividing point), the edge of the overlapping area needs to be set to the edge of the stroke after the dividing point.
[0059] This invention accumulates pixels on the stroke shape at each moment in chronological order to form strokes, resulting in lighter color depth in areas of faster writing speed and darker color depth in areas of slower writing speed, thus guiding calligraphy learners to master the speed of strokes. By setting multiple preset connection points in the stroke shape, connecting the preset connection points at the same position in the stroke shape at each moment, multiple lines are formed, extending from the starting point to the ending point of the stroke. The greater the writing force, the larger the stroke area, and the larger the corresponding spacing of the lines. This allows learners to identify the direction and depth of the strokes based on the lines, guiding them to learn the direction and force of calligraphy strokes. By showing the occlusion relationship between strokes, learners can learn the order of calligraphy strokes. Finally, by applying softening, hardening, roughening, and smoothing processes to the font, learners can better master the writing force when copying.
[0060] Example 3 Figure 8 This is a schematic diagram of a handwritten font presentation device based on physical guidance cues provided in Embodiment 3 of the present invention. Figure 8 As shown, the device includes: The parameter acquisition unit 801 is used to acquire writing parameters during the writing process; The position determination unit 802 is used to determine the position of the pen stroke shape at each moment based on the writing parameters; Stroke forming unit 803 is used to form strokes based on the stroke shape at each moment; The drawing unit 804 is used to form a drawing based on a preset connection point in the stroke shape at each moment, such that the drawing extends along the stroke direction.
[0061] In one specific embodiment, it may further include a first font generation module, used to generate a font on a calligraphy template, and apply a softening process and a hardening process to the corresponding area of the font based on the numerical changes of the pixel depth value and / or stroke width value; the degree of application of the softening process is positively correlated with the numerical values of the pixel depth value and / or stroke width value, and the degree of application of the hardening process is negatively correlated with the numerical values of the pixel depth value and / or stroke width value; the pixel depth value and / or stroke width value are continuously distributed in different areas of the font.
[0062] In this embodiment, the first font generation module can be used to form fonts on a calligraphy template. For the generated fonts, the depth of the strokes in the template can be correlated with the height of the strokes displayed after digital overlay, allowing the copyist to not only feel the writing trajectory but also the force and depth of the writing. By applying softening and hardening processes to the surface of the font strokes in the template—for example, applying a softening process to deeper strokes and a hardening process to shallower strokes—the writer needs to exert force to reach the bottom of deeper strokes, while the writer can write more easily in shallower strokes. In this embodiment, stroke feature parameters of the font on the calligraphy template can be obtained. These stroke feature parameters include pixel depth values and / or stroke width values, and the stroke feature parameters exhibit a continuous variation distribution in different areas of the font. Based on the changes in the values of the stroke feature parameters, a continuous mapping strategy is used to apply softening and hardening processes to the corresponding areas of the font. The continuous mapping strategy is as follows: the degree of softening is positively correlated with the value of the drawn feature parameter, that is, the deeper the pixel depth and / or the larger the stroke width, the greater the degree of softening. The degree of hardening is negatively correlated with the value of the stroke feature parameter, that is, the shallower the pixel depth and / or the narrower the stroke width, the greater the degree of hardening. As the stroke width increases or the stroke depth increases, when applying the process to the font strokes, a larger degree of hardening is applied first, gradually decreasing to a smaller degree of hardening, then a smaller degree of softening, and finally a larger degree of softening.
[0063] like Figure 9 As shown, Figure 9 The font on the left is the unprocessed font. Figure 9 The right side shows the font with any softening and hardening processes applied. The areas of the calligraphy model with high ink concentration in the strokes are processed to allow for deeper pressure, providing a greater pressure experience for writing; while the areas with low ink concentration in the strokes are processed to allow for shallower pressure, providing a less pressure experience for writing.
[0064] In one specific embodiment, a second font generation module may be included, used to generate a font on a calligraphy template, and apply a roughening or smoothing process to the corresponding area of the font based on the numerical changes of pixel depth values and / or stroke width values; the degree of application of the roughening process is positively correlated with the numerical values of the pixel depth values and / or stroke width values, and the degree of application of the smoothing process is negatively correlated with the numerical values of the pixel depth values and / or stroke width values; the pixel depth values and / or stroke width values are continuously distributed in different areas of the font.
[0065] By applying roughening and smoothing processes to the surface of the calligraphy strokes, such as applying a roughening process to the deeper parts of the strokes (areas with pixel depth values greater than a preset third depth threshold) and a smoothing process to the shallower parts of the strokes (areas with pixel depth values less than a preset third depth threshold), the writer needs to exert force to reach the bottom of the deeper parts of the strokes; and applying a hardening process to the shallower parts of the strokes, the writer can write more easily in the shallower parts of the strokes. In this embodiment, stroke feature parameters of the font on the calligraphy template can be obtained. These stroke feature parameters include pixel depth values and / or stroke width values, and the stroke feature parameters exhibit a continuous variation distribution in different areas of the font. Based on the numerical changes of the stroke feature parameters, a continuous mapping strategy is used to apply roughening and smoothing processes to the corresponding areas of the font. The continuous mapping strategy is as follows: the degree of roughening is positively correlated with the value of the drawn feature parameters, that is, the deeper the pixel depth value and / or the larger the stroke width value, the greater the degree of roughening is applied; the degree of smoothing is negatively correlated with the value of the stroke feature parameters, that is, the shallower the pixel depth value and / or the narrower the stroke width value, the greater the degree of smoothing is applied. As the stroke width increases or the stroke depth increases, when applying processes to the font strokes, a larger degree of smoothing is applied first, gradually decreasing to a smaller degree of smoothing, then a smaller degree of roughing, and finally a larger degree of roughing.
[0066] like Figure 10 On the right side of the font, the areas with deeper ink density in the strokes are processed to provide greater writing resistance, while the areas with lighter ink density are processed to provide less writing resistance.
[0067] The handwritten font presentation device based on physical guidance cues provided in the embodiments of the present invention can execute the handwritten font presentation method based on physical guidance cues provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the method execution.
[0068] Example 4 Figure 11 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0069] like Figure 11 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0070] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0071] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as a method for rendering handwritten fonts based on physical guidance cues.
[0072] In some embodiments, a physical guide cues-based handwritten font rendering method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the physical guide cues-based handwritten font rendering method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute a physical guide cues-based handwritten font rendering method by any other suitable means (e.g., by means of firmware).
[0073] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0074] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0075] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0076] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0077] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0078] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0079] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0080] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A handwriting font rendering method based on physical guidance cues, characterized by, include: Obtain writing parameters during the writing process; The location of the pen stroke shape at each moment is determined based on the writing parameters; Strokes are formed based on the shape of the brushstroke at each moment; Based on the preset connection points in the stroke shape at each moment, a brushstroke is formed, such that the brushstroke extends along the stroke direction.
2. The physical guidance cue based handwriting font rendering method of claim 1, wherein, The writing parameters include at least time, coordinates of the pen stroke center point, and preset pen stroke shape; Determining the position of the pen stroke shape at each moment based on the writing parameters includes: The position of the stroke shape on the paper is determined based on the coordinates of the stroke center point and the preset stroke shape. The coordinates of the center point of the brushstroke change over time, and the time difference between adjacent brushstroke shapes is a preset time interval.
3. The physical guidance cue based handwriting font rendering method of claim 1, wherein, The formation of strokes based on the shape of the brushstroke at each moment includes: The pixels on the brushstroke shape at each moment are accumulated in chronological order to form a stroke.
4. The physical guidance cue based handwriting font rendering method of claim 1, wherein, Before forming the brushstroke at the preset connection points in the brushstroke shape at each moment, the process includes: Multiple preset connection points are set in the brush stroke shape, and the spacing between the preset connection points is positively correlated with the size of the brush stroke shape.
5. The physical guidance cue based handwriting font rendering method of claim 4, wherein, The formation of wire drawing based on preset connection points in the stroke shape at each moment includes: Connect the preset connection points at the same position in the stroke shape at each moment to form multiple lines, so that the multiple lines extend from the starting point of the stroke to the ending point of the stroke.
6. The physical guidance cue based handwriting font rendering method of claim 3, wherein, When there are overlapping parts in the strokes, the stroke formation based on the stroke shape at each moment includes: The later-appearing stroke shape in the overlapping part covers the earlier-appearing stroke shape, and starting from the covered part, the pixels on the stroke shape at each moment are accumulated in chronological order to form the subsequent stroke. The formation of wire drawing based on preset connection points in the stroke shape at each moment includes: Starting from the covered area, the preset connection points at corresponding positions in the brushstroke shape at each moment are connected to form a string.
7. The physical guidance cue based handwriting font rendering method of claim 1, wherein, Also includes: When there are overlapping parts between strokes, the stroke shape of the overlapping part of the later stroke is overlaid on the stroke shape of the overlapping part of the earlier stroke, and the pixels on the stroke shape of the later stroke at each moment are accumulated in time sequence to form the stroke; the edge of the overlapping part is displayed as the edge of the later stroke.
8. A handwriting font rendering apparatus based on physical guidance cues, characterized by, include: The parameter acquisition unit is used to acquire writing parameters during the writing process; A position determination unit is used to determine the position of the pen stroke shape at each moment based on the writing parameters; A stroke forming unit is used to form a stroke based on the stroke shape at each moment; A wire drawing unit is used to form wires based on preset connection points in the stroke shape at each moment, such that the wires extend along the stroke direction.
9. The handwritten font presentation device based on physical guidance cues according to claim 8, characterized in that, Also includes: The first font generation module is used to generate a font on a calligraphy template, and to apply a softening process and a hardening process to the corresponding area of the font based on the numerical changes of the pixel depth value and / or stroke width value; the degree of application of the softening process is positively correlated with the numerical values of the pixel depth value and / or stroke width value, and the degree of application of the hardening process is negatively correlated with the numerical values of the pixel depth value and / or stroke width value; the pixel depth value and / or stroke width value are continuously distributed in different areas of the font.
10. The handwritten font presentation device based on physical guidance cues according to claim 9, characterized in that, Also includes: The second font generation module is used to generate a font on a calligraphy template and apply a roughening or smoothing process to the corresponding area of the font based on the changes in pixel depth values and / or stroke width values. The degree of roughening is positively correlated with the values of pixel depth values and / or stroke width values, and the degree of smoothing is negatively correlated with the values of pixel depth values and / or stroke width values. The pixel depth values and / or stroke width values are continuously distributed in different areas of the font.