CN110322538B - Text display method, text display device, storage medium and processor - Google Patents

Text display method, text display device, storage medium and processor Download PDF

Info

Publication number
CN110322538B
CN110322538B CN201910563653.3A CN201910563653A CN110322538B CN 110322538 B CN110322538 B CN 110322538B CN 201910563653 A CN201910563653 A CN 201910563653A CN 110322538 B CN110322538 B CN 110322538B
Authority
CN
China
Prior art keywords
display
point
path
stroke
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910563653.3A
Other languages
Chinese (zh)
Other versions
CN110322538A (en
Inventor
余冬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Original Assignee
Guangzhou Shiyuan Electronics Thecnology Co Ltd
Guangzhou Shirui Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shiyuan Electronics Thecnology Co Ltd, Guangzhou Shirui Electronics Co Ltd filed Critical Guangzhou Shiyuan Electronics Thecnology Co Ltd
Priority to CN201910563653.3A priority Critical patent/CN110322538B/en
Publication of CN110322538A publication Critical patent/CN110322538A/en
Application granted granted Critical
Publication of CN110322538B publication Critical patent/CN110322538B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The invention discloses a text display method, a text display device, a storage medium and a processor. Wherein the method comprises the following steps: acquiring font data of characters to be displayed; determining the display outline of strokes of the characters according to the font data; determining a stroke display mode of the strokes according to the display outline; dynamically displaying strokes according to a stroke display mode; and dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until the strokes of the characters are all displayed. The invention solves the technical problems of low efficiency and low accuracy of the mode of manually setting the text display path points in the related technology.

Description

Text display method, text display device, storage medium and processor
Technical Field
The present invention relates to the field of data processing, and in particular, to a text display method, a text display device, a storage medium, and a processor.
Background
In electronic whiteboards, fonts can be dynamically displayed to update the displayed fonts of the avatar. However, in the related art, only one ttf font type can be displayed, and when the ttf font type of the type is displayed, it is necessary to manually draw a path point, and then fill the outline of the font with a preset shape at a certain speed according to the path formed by the path point, so as to achieve the purpose of dynamically displaying the font. However, the manual drawing of the path points is not only low in efficiency and large in error, but also high in labor cost.
In view of the above problems, no effective solution has been proposed at present.
Disclosure of Invention
The embodiment of the invention provides a text display method, a text display device, a storage medium and a processor, which at least solve the technical problems of low efficiency and low accuracy in a mode of manually setting text display path points in the related technology.
According to an aspect of an embodiment of the present invention, there is provided a text display method including: acquiring font data of characters to be displayed; determining the display outline of the strokes of the characters according to the font data; determining a stroke display mode of the strokes according to the display outline; dynamically displaying the strokes according to the stroke display mode; and dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until all the strokes of the characters are displayed.
Optionally, determining the display outline of the strokes of the text according to the font data includes: determining a path point list of the display outline through a system class for determining the display outline according to the font data; and generating a display outline of the closed-loop strokes according to the path point list.
Optionally, determining the stroke display mode of the stroke according to the display outline includes: determining a starting point and an ending point of a stroke display path according to the data in the path point list; dividing the path point list into a first sub-list and a second sub-list according to the starting point and the ending point; determining a first sub-path according to the first sub-list, and determining a second sub-path according to the second sub-list; determining the stroke display path according to the first sub-path and the second sub-path; and the display mode of the preset shape moving according to the stroke display path is the stroke display mode.
Optionally, determining the termination point of the stroke display path according to the data in the path point list includes: taking the starting point of the display outline in the path point list as the ending point of the stroke display path; the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring a first datum point with the minimum value of an X axis and a second datum point with the minimum value of a Y axis in the path point list; the starting point is determined from the first reference point and the second reference point.
Optionally, determining the start point according to the first reference point and the second reference point includes: in the case where the first reference point and the second reference point are the same point, the first reference point or the second reference point is the start point; and determining a point farthest from the termination point in the path point list as the starting point when the first reference point and the second reference point are not the same point.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring the starting point and the stopping point of the display outline in the path point list; determining the middle point of the display outline on the display outline from the starting point to the stopping point; and taking the midpoint as a starting point of the stroke display path.
Optionally, determining the stroke display path according to the first sub-path and the second sub-path includes: inverting and sequencing the path points in a second sub-list of the second sub-path to determine a third sub-path; according to a plurality of first path points in the first sub-path, respectively determining second path points with minimum distance from the first path points from the third sub-path; determining a stroke path point according to the first path point and the corresponding second path point; and determining the stroke display path according to the stroke path point.
Optionally, determining the stroke path point according to the first path point and the corresponding second path point includes: and taking the midpoint between the first path point and the corresponding second path point as the stroke path point.
Optionally, dynamically displaying the strokes according to the stroke display path includes: and filling the display outline of the stroke according to the stroke display path by the preset basic shape according to the preset moving speed so as to dynamically display the stroke.
Optionally, determining the stroke display mode of the stroke according to the display outline includes: determining the middle point of the stroke according to the display outline through a coordinate table with a preset size; and determining the display mode of amplifying the preset shape by taking the middle point as a reference as the stroke display mode.
Optionally, determining the intermediate point of the stroke according to the display outline through a coordinate table with a preset size includes: acquiring the display outline in the coordinate table; determining a plurality of pre-selected points within the display outline according to a certain density; the intermediate point is determined from a plurality of the preselected points.
Optionally, determining the intermediate point from the plurality of pre-selected points includes: according to the preselected points, generating a plurality of concentric circles taking the preselected points as circle centers according to the preset diameter difference of two adjacent concentric circles by each preselected point; determining an intermediate circle from a plurality of said concentric circles of a plurality of said preselected points; the corresponding preselected point of the intermediate circle is the intermediate point.
Optionally, determining an intermediate circle from a plurality of said concentric circles of a plurality of said preselected points comprises: determining the middle circle according to the number and the distance of the intersection points of the concentric circle and the display outline; determining the middle circle by judging whether the number and the distance of the intersection points of the concentric circle and the display outline meet the following conditions; determining the concentric circle as the intermediate circle in a case where the concentric circle satisfies at least one of the following conditions; the number of the intersection points of the concentric circles and the display outline is two, and the two intersection points are the positive intersection points of the concentric circles and the display outline; the number of the intersection points of the concentric circles and the display outline is three, one intersection point of the three intersection points is a positive intersection point of the concentric circles and the display outline, and the distance between the other two intersection points of the three intersection points is smaller than the preset error precision; the number of the intersection points of the concentric circles and the display outline is four, and the four intersection points are two pairs of intersection points with the distance smaller than the preset error precision.
Optionally, dynamically displaying the strokes of the text according to the stroke display mode includes: and amplifying the outline of the stroke according to a preset amplifying speed from the middle point of the displayed outline of the stroke in a preset shape, and filling the outline of the stroke to dynamically display the stroke.
Optionally, determining the stroke display mode of the stroke according to the display outline includes: prototype compression is carried out on the display outline, and handwriting lines of the display outline are determined; and determining the stroke display mode according to the handwriting line.
According to another aspect of the embodiment of the present invention, there is also provided a text display device, including: the acquisition module is used for acquiring font data of characters to be displayed; a first determining module, configured to determine a display outline of a stroke of the text according to the font data; the second determining module is used for determining a stroke display mode of the strokes according to the display outline; the first display module is used for dynamically displaying the strokes according to the stroke display mode; and the second display module is used for dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until all the strokes of the characters are displayed.
According to another aspect of the embodiments of the present invention, there is further provided a storage medium including a stored program, where the program, when executed, controls a device in which the storage medium is located to perform any one of the methods described above.
According to another aspect of the embodiment of the present invention, there is also provided a processor, where the processor is configured to execute a program, where the program executes any one of the methods described above.
In the embodiment of the invention, font data of characters to be displayed are acquired; determining the display outline of strokes of the characters according to the font data; determining a stroke display mode of the strokes according to the display outline; dynamically displaying strokes according to a stroke display mode; according to the stroke sequence of the characters, the strokes of the characters are dynamically displayed one by one until the strokes of the characters are completely displayed, and the strokes are dynamically displayed according to the display path by automatically determining the stroke display path of the characters according to the displayed outline, so that the characters are dynamically displayed, the purposes of low efficiency and low accuracy caused by manually setting the display path point are achieved, the technical effects of high efficiency and high accuracy of automatically generating the display path are achieved, and the technical problems of low efficiency and low accuracy caused by manually setting the display path point of the characters in the related art are solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute a limitation on the application. In the drawings:
FIG. 1 is a schematic diagram of a ttf font according to the related art;
FIG. 2 is a schematic diagram of a ttf font filling according to the related art;
FIG. 3 is a flow chart of a text display method according to embodiment 1 of the present application;
FIG. 4 is a flowchart of a text display method according to embodiment 2 of the present application;
FIG. 5 is a flowchart of a text display method according to embodiment 3 of the present application;
FIG. 6 is a flowchart of a text display method according to embodiment 4 of the present application;
FIG. 7 is a flowchart of a text display method according to embodiment 5 of the present application;
FIG. 8 is a flowchart of a text display method according to embodiment 6 of the present application;
FIG. 9 is a flowchart of a text display method according to embodiment 7 of the present application;
FIG. 10 is a diagram of a list of outline path points for one font in accordance with embodiment 8 of the present application;
FIG. 11 is a schematic diagram of a stroke shape of a font in accordance with embodiment 8 of the present application;
FIG. 12 is a schematic diagram of two path points of a font according to embodiment 8 of the present invention;
FIG. 13 is a schematic diagram of intermediate path points for one font in accordance with embodiment 8 of the present invention;
FIG. 14 is a schematic diagram of a fill trend of a font according to embodiment 8 of the present invention;
FIG. 15 is a schematic diagram of intermediate points of a font according to embodiment 8 of the present invention;
FIG. 16 is a schematic diagram of a display path of a font according to embodiment 8 of the present invention;
FIG. 17 is a schematic diagram of a real path of another font according to embodiment 8 of the present invention;
fig. 18 is a schematic diagram of a font display device according to embodiment 9 of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the related art, when a ttf font of a certain type is displayed, an electronic whiteboard performs the following steps:
step 1, fig. 1 is a schematic diagram of ttf fonts according to the related art, and as shown in the figure, a ttf font library file of chinese characters is obtained and corresponding chinese characters are displayed.
And 2, setting a plurality of points, such as points A (30 and 50) and points B (40 and 60), in each stroke of the Chinese character by manpower so as to record the path drawn by the stroke. And saving the path point data to the configuration file.
And step 3, obtaining path point data of the Chinese characters.
And 4, filling the inner area of the stroke at a certain rate by a solid circle with a radius of 40 pixels on a path formed by a plurality of points. Fig. 2 is a schematic diagram of filling of ttf font according to the related art, and a schematic diagram of filling of "one" of chinese characters is shown in fig. 2.
The electronic whiteboard may include a touch device, in the embodiment of the present disclosure, may be an intelligent interaction tablet, also referred to as an interaction intelligent tablet, or may be an integrated device that performs manipulation and man-machine interaction operation on content displayed on a display tablet through a touch technology, where one or more functions of a projector, an electronic whiteboard, a curtain, a sound device, a television, a video conference terminal, and the like are integrated.
The intelligent interactive panel comprises a display screen, wherein the display screen in the embodiment of the specification refers to a touch screen, a touch screen and a touch panel, and is an induction type liquid crystal display device, when a graphic button on the screen is touched, a touch feedback system on the screen can drive various connecting devices according to a preprogrammed program, and can be used for replacing a mechanical button panel and producing vivid video and audio effects by virtue of a liquid crystal display picture. Touch screens can be distinguished from technical principles and can be divided into five basic categories: vector pressure sensing technology touch screens, resistive technology touch screens, capacitive technology touch screens, infrared technology touch screens, and surface acoustic wave technology touch screens. Touch screens can be divided into four categories according to the operating principle of the touch screen and the medium for transmitting information: resistive, capacitive, infrared, and surface acoustic wave.
The stylus is a small pen-shaped tool used for inputting instructions to electronic devices with touch screens, such as a computer display screen, a mobile device, a drawing board and the like, and a user can select files or draw according to the touch operation of the stylus on the touch screen.
The display screens mentioned in the application all refer to touch screens with touch control functions of touch control equipment; the intelligent interaction panel displaying a certain interface means that a display screen of the intelligent interaction panel displays the interface.
Example 1
According to an embodiment of the present application, there is provided a method embodiment of a text display method, it should be noted that the steps shown in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that although a logical order is shown in the flowchart, in some cases the steps shown or described may be performed in an order different from that herein.
Fig. 3 is a flowchart of a text display method according to an embodiment of the present application, as shown in fig. 3, the method includes the steps of:
step S302, acquiring font data of characters to be displayed;
step S304, determining the display outline of the strokes of the characters according to the font data;
Step S306, determining a stroke display mode of the strokes according to the display outline;
step S308, dynamically displaying strokes according to a stroke display mode;
step S310, dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until all the strokes of the characters are displayed.
Through the steps, acquiring font data of characters to be displayed; determining the display outline of strokes of the characters according to the font data; determining a stroke display mode of the strokes according to the display outline; dynamically displaying strokes according to a stroke display mode; according to the stroke sequence of the characters, the strokes of the characters are dynamically displayed one by one until the strokes of the characters are completely displayed, and the strokes are dynamically displayed according to the display path by automatically determining the stroke display path of the characters according to the displayed outline, so that the characters are dynamically displayed, the purposes of low efficiency and low accuracy caused by manually setting the display path point are achieved, the technical effects of high efficiency and high accuracy of automatically generating the display path are achieved, and the technical problems of low efficiency and low accuracy caused by manually setting the display path point of the characters in the related art are solved.
The text to be displayed can be any type of font, a ttf font or other fonts, the font data can include all strokes of the text, shape outline data of each stroke, and stroke sequence of all strokes of the text, that is, the stroke writing sequence of the font, which can be obtained from a network, executed according to certain font writing standards, and preset by a user, so as to meet the use requirements of different users.
The above-mentioned display outline of the strokes of the characters can be determined according to the above-mentioned font data, and can be the outline of the characters and their strokes can be produced by means of related character display module, and also can be the outline image of the characters and their strokes can be produced by means of image production module, and also can be the outline of the strokes of the characters and their strokes can be produced by means of related system class, etc..
The method for displaying the strokes according to the display outlines determines the stroke display modes of the strokes, the strokes are dynamically displayed according to the stroke display modes, the stroke display modes can be stroke display paths, the strokes can be enlarged according to certain points to fill the display outlines of the strokes, the enlarged according to certain points to fill the display outlines of the strokes can be handwriting lines generated in the process of writing the strokes according to the stroke display outlines, the pen traces can act similarly to the stroke display paths, and the pen traces can be considered to be the stroke display paths.
And the stroke display mode of the strokes is automatically determined according to the display outline, and the strokes are automatically and dynamically displayed according to the stroke display mode, so that compared with the mode of manually drawing the real path points of the strokes in the related technology, the efficiency is higher, the speed is higher, and the accuracy is higher.
The dynamic display of the stroke may be considered as being completed, and in the case that the stroke is the text, that is, the text is a stroke, the stroke is the text. The completion of the dynamic display of the strokes represents the completion of the dynamic display of the characters, but most characters are not limited to one stroke, and under the condition that the number of the strokes of the characters is multiple, the multiple strokes are respectively and dynamically displayed according to the stroke sequence until the completion of the dynamic display of the last stroke of the characters, and the dynamic display of the characters is completed.
In the dynamic display process of the plurality of characters, the dynamic display of each stroke can be started at the same time when the dynamic display of one stroke is completed, and the mode can simulate the dynamic forming process of the character strokes; or after the last stroke starts to display, the display is started at the moment when the display is not completed, so that the dynamic display speed of the characters can be effectively improved, and the display efficiency is improved; the method can also wait for a preset moment to be displayed after finishing the time limit of the last stroke, and can simulate the dynamic forming process of the character strokes in the most realistic way.
Example 2
According to embodiment 2 of the present invention, another font display method is provided, fig. 4 is a flowchart of a text display method according to embodiment 2 of the present invention, and as shown in fig. 4, it should be noted that, in this embodiment, detailed details are provided on the basis of embodiment 1, and determining a display outline of a stroke of a text according to font data includes:
step S402, determining a path point list of the display outline through a system class for determining the display outline according to the font data;
step S404, generating a display outline of the closed-loop strokes according to the path point list.
The system class may be a GraphicsPath system class, which may obtain a list of the minimum number of waypoints that may be required to be displayed for rendering. The path point list includes coordinates of points on a display outline of the plurality of strokes, and the display outline of the strokes needs to be based on a system coordinate system, which may be a plane coordinate system, a polar coordinate system or other coordinate systems, in which the plurality of points of the display outline are marked according to the path points of the display outline, and then the plurality of path points are smoothly connected according to a certain algorithm. So as to realize the purpose of displaying the display outline of the strokes.
The display outline of the stroke is closed loop, that is, the starting point and stopping point of the display outline are coincident. The display outline is a stroke, and the display wheel library can be completely filled in the process of dynamically displaying the stroke so as to realize the dynamic display of the stroke, and under the condition that the display outline is open-loop, the display outline of the stroke can not be filled and rendered, so that the dynamic display of the stroke is failed.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: determining a starting point and an ending point of a stroke display path according to data in the path point list; dividing the path point list into a first sub-list and a second sub-list according to a starting point and a terminating point; determining a first sub-path according to the first sub-list, and determining a second sub-path according to the second sub-list; determining a stroke display path according to the first sub-path and the second sub-path; the display mode of the preset shape moving according to the stroke display path is a stroke display mode.
The data in the path point list are all points on the display outline, and the stroke display path is used for filling the display outline by moving a certain basic shape according to the stroke display path in the process of dynamically displaying the strokes, so that the effect of dynamically displaying the strokes is formed.
The stroke display path may be a center line of a display outline of the stroke, but in many fonts, the display outline of the stroke is not a regular shape, and the number of strokes of a symmetrical shape is smaller, so that the center line of the display outline is used as the stroke display path, and there is a great limitation in the implementation process.
The embodiment provides a method for generating a stroke display path, which generates the stroke display path according to a path point list on the display outline. First, the start point and the stop point of the stroke display path need to be determined, and it should be noted that the start point and the stop point of the stroke display path are different from the start point and the stop point of the display contour. The start point of the stroke display path may be defined according to writing habits, and the definition may be changed by a user setting.
After the start point and the end point of the stroke are determined, the path point list is divided into two sub-lists according to the start point and the end point, for example, taking a horizontal display outline as an example, the start point and the end point may divide the horizontal display outline into two parts, the path point included in the upper part of the display outline is the first sub-list, the path point included in the lower part of the display outline is the second sub-list, the start point may correspond to the first sub-list or the second sub-list, but if the path point of the display outline is required to be arranged according to a certain rule, for example, the start point corresponds to the first sub-list, the end point corresponds to the second sub-list, and the start point corresponds to the second sub-list, the end point corresponds to the first sub-list.
Optionally, determining the termination point of the stroke display path according to the data in the path point list includes: taking the starting point of the display outline in the path point list as the ending point of the stroke display path; the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour. That is, the stopping point of the display outline is used as the stopping point of the stroke display path.
Example 3
According to embodiment 3 of the present invention, another font display method is provided, fig. 5 is a flowchart of a text display method according to embodiment 3 of the present invention, and as shown in fig. 5, it should be noted that, in this embodiment, detailed details are provided on the basis of embodiment 2, and determining, according to data in a path point list, a start point of a stroke display path includes:
step S502, a first datum point with the minimum value of X coordinate axis and a second datum point with the minimum value of Y coordinate axis in a path point list are obtained;
step S504, determining a starting point according to the first reference point and the second reference point.
When the strokes are different, the ways of determining the starting points are different, the starting end of the stroke is determined according to the writing habit of the stroke, then the writing direction of the starting end is determined, two path points closest to the writing end in the writing direction are determined according to the writing direction, the starting points are determined according to the two path points, for example, when the strokes are vertical, the starting point of the vertical stroke is left-upper and right-lower according to the writing habit of the handwriting when the type of the font is a regular script, and therefore, for the vertical stroke, two path points with the smallest X axis (leftmost) and the largest Y axis (uppermost) in the path point list of the stroke are determined, and the starting point is determined according to the two path points. The start point of the vertical stroke may be the X-axis maximum (rightmost), the Y-axis maximum (uppermost), that is, the two route points at the upper right of the vertical stroke, the two route points at the Y-axis maximum (uppermost), or other route points.
In this embodiment, in the case where the stroke is horizontal, a first reference point of the minimum value of the X axis and a second reference point of the minimum value of the Y axis in the path point list are acquired, and a start point is determined from the first reference point and the second reference point.
Optionally, determining the start point from the first reference point and the second reference point includes: in the case where the first reference point and the second reference point are the same point, the first reference point or the second reference point is a start point; if the first reference point and the second reference point are not the same point, a point farthest from the termination point in the path point list is determined as a start point.
The determination of the start point based on the first reference point and the second reference point may be performed such that the first reference point or the second reference point is the start point or both the first reference point and the second reference point are the start points when the first reference point and the second reference point are the same point. If the first reference point and the second reference point are not the same point, a point farthest from the termination point in the path point list is determined as a start point.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring a starting point of a display contour in a path point list, wherein the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour; determining the middle point of the display contour on the display contour from the starting point to the ending point; the midpoint is taken as the starting point of the stroke display path.
The display outline of the stroke may be displayed according to a closed loop path in a certain order, for example, the display outline may be gradually displayed along the display outline in a certain direction, for example, in a clockwise direction or a counterclockwise direction, at a start point of the display outline. The midpoint of the display outline is obtained through half of the drawing progress of the closed loop path and used as a starting point of the stroke display path, and the corresponding point can be obtained through a specific drawing progress by specifically opening a source function and any line/shape. By the mode, the stroke display path is determined more simply, conveniently and quickly.
Under a contour path of a complete closed loop of one stroke, a midpoint is obtained at a 50% progress position of the drawing of the path line. The midpoint is taken as the starting point of the stroke display path. It should be noted that, there is some error in the above manner, for example, since there may be uneven lines such as curves on both sides of the stroke, the midpoint is not a real starting point, but when the drawing stroke is displayed, such error may be reduced by enlarging the diameter of the drawing pen.
Example 4
According to embodiment 4 of the present invention, another font display method is provided, fig. 6 is a flowchart of a text display method according to embodiment 4 of the present invention, and as shown in fig. 6, it should be noted that, in this embodiment, detailed details are provided on the basis of embodiment 2, and determining a stroke display path according to a first sub-path and a second sub-path includes:
step S602, the path points in the second sub-list of the second sub-path are ordered inversely to determine a third sub-path;
step S604, respectively determining second path points with minimum distances from the first path points from the third sub-path according to the plurality of first path points in the first sub-path;
step S606, determining a stroke path point according to the first path point and the corresponding second path point;
step S608, determining a stroke display path according to the stroke path point.
The first sub-path and the second sub-path are identical in closed loop direction of the display outline, but for the stroke display path, the directions of the first sub-path and the second sub-path are opposite, so that the path points in the second sub-list of the second sub-path are ordered inversely so that the directions of the first sub-path and the second sub-path are identical for the stroke display path.
The determining the plurality of stroke path points of the stroke display path according to the plurality of first path points of the first sub-path and the plurality of second path points of the second sub-path may be performed in various manners, in this embodiment, by pairing the first path points of the first sub-path and the second path points of the second sub-path, that is, determining the second path point with the smallest distance between the first path points from the third sub-path according to the plurality of first path points in the first sub-path.
The midpoint between the first path point and the corresponding second path point is then taken as the stroke path point. Optionally, determining the stroke path point according to the first path point and the corresponding second path point includes: and taking the midpoint between the first path point and the corresponding second path point as a stroke path point.
And smoothly connecting according to a certain algorithm or function according to the stroke path points to generate the stroke display path.
Optionally, dynamically displaying the strokes according to the stroke display path includes: filling the display outline of the stroke according to the stroke display path by the preset basic shape according to the preset moving speed so as to dynamically display the stroke.
The basic shape may be a regular geometric shape such as a circle, a square, etc., or may be a shape preset by a user, for example, a heart shape, a flower shape, a star shape, etc., or other irregular shape.
Example 5
According to embodiment 5 of the present invention, another font display method is provided, fig. 7 is a flowchart of a text display method according to embodiment 5 of the present invention, and as shown in fig. 7, it should be noted that, in this embodiment, specific refinement is performed on the basis of embodiment 1, and determining a stroke display mode of a stroke according to a display outline includes:
step S702, determining the middle point of the stroke according to the display outline through a coordinate table with a preset size;
in step S704, it is determined that the display mode of enlarging the preset shape with the intermediate point as a reference is a stroke display mode.
The stroke display mode can also be to enlarge a preset shape by taking the middle point as a reference to fill the display outline of the stroke, and dynamically display the stroke as the stroke display mode.
The most important of the stroke display modes is to determine the middle point of the stroke display outline according to the display outline of the stroke. It should be noted that the display outline of the stroke is largely not symmetrical or regular geometric, and thus, for determining the middle point of the display outline, other means may be used.
In this embodiment, optionally, determining the intermediate point of the stroke according to the display outline through a coordinate table of a preset size includes: acquiring a display contour in the coordinate table; determining a plurality of pre-selected points within the display outline according to a certain density; an intermediate point is determined from the plurality of preselected points.
The coordinate table may be a coordinate system of the interface on which the outline is displayed, or may be a coordinate system established for determining the intermediate point. The densities may be distributed in a regular manner, for example, in rows and columns, with a preselected point per unit area, or may be randomly distributed to accommodate more.
Optionally, determining the intermediate point from the plurality of pre-selected points includes: according to the preset diameter difference of two adjacent concentric circles, each preselected point generates a plurality of concentric circles taking the preselected point as the center of a circle; determining an intermediate circle from a plurality of concentric circles of the plurality of preselected points; the corresponding preselected point of the intermediate circle is the intermediate point.
The intermediate points include geometric center positions and basic geometric shapes, the intermediate points are intermediate points having areas, shapes and positions, and the geometric shapes may be circles, squares, regular triangles, etc., and in this embodiment, circles are selected for convenience. The intermediate point includes a center location and a substantially circular diameter.
The intermediate circle may be determined by determining an overlapping area with the stroke display outline or determining an intersection point of the concentric circle outline and the display outline.
Example 6
According to embodiment 6 of the present invention, another font display method is provided, and fig. 8 is a flowchart of a text display method according to embodiment 6 of the present invention, as shown in fig. 8, it should be noted that, in this embodiment, specific refinement is based on embodiment 5, and determining an intermediate circle from a plurality of concentric circles of a plurality of pre-selected points includes:
step S802, determining an intermediate circle according to the number and the distance of the intersection points of the concentric circle and the display outline; determining an intermediate circle by judging whether the number and the distance of the intersection points of the concentric circle and the display outline meet the following conditions; determining the concentric circle as an intermediate circle in the case where the concentric circle satisfies at least one of the following conditions;
step S8021, the number of intersection points of the concentric circle and the display outline is two, and the two intersection points are positive intersection points of the concentric circle and the display outline;
step S8023, the number of the intersection points of the concentric circles and the display outline is three, one intersection point of the three intersection points is the positive intersection point of the concentric circles and the display outline, and the distance between the other two intersection points of the three intersection points is smaller than the preset error precision;
in step S8025, the number of intersection points of the concentric circles and the display contour is four, and the four intersection points are two pairs of intersection points with a distance smaller than the preset error precision.
In this embodiment, whether the concentric circles satisfy the condition of the intermediate circle is determined by determining the number of intersections between the concentric circles and the display outline and the distance between the intersections, and it is to be noted that, when the number of intermediate points is determined in accordance with the above-described manner, the intermediate points may be determined by secondary selection, for example, the overlapping area of the concentric circles and the display outline, and the concentric circle having the largest area is selected as the intermediate circle; and determining the distance between the center of the concentric circle and the geometric center of the font display area, and determining the middle circle by selecting the concentric circle closest to the center as the middle circle.
The preset error accuracy may be 2 to 5 units of length in the coordinate axis of the display outline. For example, 2 unit lengths, 3 unit lengths, 4 unit lengths, 5 unit lengths, etc. So as to ensure that the contact ratio of the intersection point of the intermediate circle and the display outline is within a certain error range, thereby ensuring the accuracy of the intermediate circle.
Optionally, dynamically displaying the strokes of the text according to the stroke display mode includes: and amplifying the stroke from the middle point of the displayed outline of the stroke according to a preset amplifying speed in a preset shape, and filling the outline of the stroke to dynamically display the stroke.
The preset shape may be a regular geometric shape such as a circle, a square, etc., or may be a shape preset by a user, for example, a heart shape, a flower shape, a star shape, etc., or other irregular shape.
Example 7
According to embodiment 7 of the present invention, another font display method is provided, and fig. 9 is a flowchart of a text display method according to embodiment 7 of the present invention, as shown in fig. 9, it should be noted that, in this embodiment, specific refinement is performed on the basis of embodiment 1, and determining a stroke display mode of a stroke according to a display outline includes:
step S902, performing prototype compression on the display outline, and determining a pen trace of the display outline;
step S904, determining a stroke display mode according to the handwriting line.
The prototype compression of the display outline can be realized in a certain mathematical manner, the display outline is compressed into a handwriting line, and according to the handwriting line, a preset image can be moved by the handwriting line to fill the line outline, or the handwriting line is gradually compressed in a mode of being widened and gradually filled with the display outline.
The preset image can be in a regular geometric shape such as a circle, a square and the like; but also in a shape preset by the user, such as heart, flower, star, etc., and other irregular shapes; it may also be a preset text image, for example, the same font as the font or a different font from the font.
Example 8
According to embodiment 8 of the present invention, there is provided a method by which a user can freely select a font style of a chinese character stroke animation, as an alternative implementation of this embodiment, which will be described in detail below.
The method comprises the following steps:
1. acquiring Chinese character related data:
1.1 according to the font type selected by the user, a ttf font file (the font of the system is such as microsoft black or a software-defined font style) is obtained.
1.2, acquiring stroke sequences of Chinese characters, such as: "things" 7 1 3 5 6 0 2 4.
1.3, acquiring stroke Code of Chinese characters, such as: "things" 12515112 (1 for horizontal, 2 for vertical, 3 for left-falling, 4 for right-falling/dot, 5 for fold).
2. Calculating an animation path point list;
2.1 loading ttf fonts to obtain font data of Chinese characters.
2.2 loading Chinese characters (e.g. "one" or "stroke" horizontal ") and obtaining a list of the minimum number of points required to render a display stroke through the system class graphics path. FIG. 10 is a diagram of a list of outline waypoints for a font according to an embodiment of the present invention, and outline waypoints for "one" of Chinese characters are shown in FIG. 10.
And 2.3, calculating a stroke shape path and a closed loop path through a system class graphics path. FIG. 11 is a schematic illustration of a stroke shape of a font according to an embodiment of the present invention, the stroke shape of the font "one" being as shown in FIG. 11.
2.4 calculate a list of approximate intermediate points in the stroke shape.
2.4.1 The end point of the animation of the strokes of the Chinese characters is obtained, namely the end point E in the outer frame path point list of the Chinese characters. Starting point in the outline path points of Chinese characters (272.724609375,133.007812)
2.4.2 A Chinese character stroke animation starting point S is obtained.
And acquiring a point A with the minimum value of the X-axis coordinate and a point B with the minimum value of the Y-axis coordinate in the path point list.
If A and B are the same point, then it is the animation start point. If not the same point, the meter
And calculating the ordering position of the point in the path point list, and taking the point closest to the middle position as the starting point of the animation.
2.4.3 According to the starting point S and the ending point E, dividing the path point list into two sub-lists L1 and L2, and carrying out inverted sequencing on the first sub-list L1. FIG. 12 is a schematic diagram of two waypoints of a font according to an embodiment of the present invention, and a list of two waypoints of "one" of the Chinese character is shown in FIG. 12:
2.4.4 A list of L1 path points, each point finding a point in the L2 list that is at a minimum distance from each other. Outputting the intermediate waypoint list, fig. 13 is a schematic diagram of intermediate waypoints of a font according to an embodiment of the present invention, and the intermediate waypoints of kanji "one" are shown in fig. 13.
3. And then demonstrating the stroke animation according to the intermediate path point list obtained in the step.
A solid circle of radius 40 pixels fills the stroke interior area at a rate along the path formed by the plurality of points. Fig. 14 is a schematic diagram of a filling trend of a font according to an embodiment of the present invention, and as shown in fig. 14, the filling trend is as follows, and a specific effect is consistent with an effect graph in the related art.
The difference between the embodiment and the prior art is that the embodiment realizes the automation of the stroke animation, and generates an animation path through an algorithm; whereas the animation path of the original scheme in the related art is manually semi-automatically configured. The method and the device have the advantages that the problems of certain probability of errors and repeated huge workload in the prior art are solved.
There is an alternative to the above embodiment, specifically as follows:
(1) Acquiring stroke shapes, wherein in a square grid with the width of 300 and the height of 300, the maximum value and the minimum value of the X axis and the Y axis of coordinates are in a threshold area, such as X is 10-100 and Y is 40-60; and obtaining the minimum value of the X-axis minimum value and the Y-axis minimum value, and naming the minimum value as MinRect.
(2) In the X, Y axis region, one dot is defined every 5 pixels. Starting from radius 5 pixels, 2 pixels are spaced each time, centered on this point, until MinRect is greater than or equal to. During this time, if the drawn circle intersects the shape shown in step 2.3:
And if the number of the intersection points is equal to 2, judging whether all the 2 intersection points are the right intersection points of the circle and the line.
And 3, judging whether an intersection point exists or not, and determining the intersection point as the positive intersection point of the circle and the line. At the same time two other
The distance between the intersecting points is smaller than the error accuracy value 10 (the algorithm may be optimized later, the error accuracy value may be
Can be adjusted slightly).
Equal to 4, then 4 intersection points are calculated, and if there are two pairs of points less than 10 pixels apart.
If any of the above conditions is met, this point is recorded. Fig. 15 is a schematic diagram of intermediate points of a font according to an embodiment of the present invention, and as shown in fig. 15, point B meets the intermediate point condition and point a does not meet.
Meanwhile, if an intermediate point has been determined, other points within the surrounding radius 20 are skipped directly.
(3) The obtained intermediate point list is ordered by stroke Code type (horizontal and vertical left-falling, right-falling, etc.).
There is another alternative to the above embodiment, specifically as follows:
1. prototype compression is performed on the stroke shape of the Chinese character to obtain a line similar to the original stroke shape, and as a display path of the stroke, fig. 16 is a schematic diagram of a display path of a font according to an embodiment of the present invention, and as shown in fig. 16, the display path of "a" Chinese character is shown as a graph. Fig. 17 is a schematic diagram of a real path of another font, and a display path of kanji "b" is shown in the figure, according to an embodiment of the present invention.
2. And acquiring a minimum rendering point list through a system function graphicsPath.
The method and the device solve the problems that in the related technology, path points are drawn manually, the workload is large, operators unfamiliar with the business draw a certain error rate, the related technology is only limited to a ttf font type, chinese characters cannot be selected freely, and stroke animation is displayed.
Example 9
According to embodiment 9 of the present invention, there is provided an embodiment of a font display device for implementing the device of embodiment 1 described above, fig. 18 is a schematic diagram of a font display device according to embodiment 9 of the present invention; as shown in fig. 18, embodiment 9 of the present invention provides a font display device, comprising: the acquisition module 1802, the first determination module 1804, the second determination module 1806, the first display module 1808, and the second display module 1810 are described in detail below.
An obtaining module 1802, configured to obtain font data of a text to be displayed; a first determining module 1804, coupled to the obtaining module 1802, for determining a display outline of a stroke of the text according to the font data; a second determining module 1806, coupled to the first determining module 1804, for determining a stroke display mode of the strokes according to the display profile; the first display module 1808 is connected to the second determination module 1806, and is configured to dynamically display strokes according to a stroke display manner; the second display module 1810 is connected to the first display module 1808, and is configured to dynamically display the strokes of the text one by one according to the sequence of the strokes of the text until all the strokes of the text are displayed.
By the device, an acquisition module 1802 is adopted to acquire font data of characters to be displayed; the first determination module 1804 determines a display outline of a stroke of a text from font data; the second determining module 1806 determines, according to the display profile, a stroke display manner of the stroke; the first display module 1808 dynamically displays strokes according to a stroke display manner; the second display module 1810 dynamically displays the strokes of the characters one by one according to the stroke sequence of the characters until the strokes of the characters are completely displayed, and dynamically displays the characters according to the display path by automatically determining the stroke display path of the characters according to the displayed outline, so that the purposes of low efficiency and low accuracy caused by manually setting the display path point are achieved, the technical effects of high efficiency and high accuracy of automatically generating the display path are achieved, and the technical problems of low efficiency and low accuracy caused by manually setting the display path point of the characters in the related art are solved.
Optionally, the first determining module includes: a first determining unit configured to determine a list of path points for displaying the outline through a system class for determining the outline according to the font data; and the generating unit is used for generating the display outline of the closed-loop strokes according to the path point list.
Optionally, the second determining module includes: a second determining unit for determining a start point and an end point of the stroke display path according to the data in the path point list; a dividing unit for dividing the path point list into a first sub-list and a second sub-list according to the start point and the end point; a third determining unit, configured to determine a first sub-path according to the first sub-list, and determine a second sub-path according to the second sub-list; a fourth determining unit for determining a stroke display path according to the first sub-path and the second sub-path; the display mode of the preset shape moving according to the stroke display path is a stroke display mode.
Optionally, the second determining unit includes: a first determining level subunit, configured to use a starting point of a display contour in the path point list as an ending point of a stroke display path; the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour.
Optionally, the second determining unit further includes: the first acquisition stage subunit is used for acquiring a first reference point with the minimum value of the X coordinate axis and a second reference point with the minimum value of the Y coordinate axis in the path point list; and the second determining stage subunit is used for determining a starting point according to the first datum point and the second datum point.
Optionally, the second determining primary subunit includes: a first determining secondary subunit, configured to, when the first reference point and the second reference point are the same point, use the first reference point or the second reference point as a starting point; and the second determining secondary subunit is used for determining the point farthest from the termination point in the path point list as the starting point when the first reference point and the second reference point are not the same point.
Optionally, the second determining unit includes: the second acquisition first-level subunit is used for acquiring a starting point and a stopping point of the display outline in the path point list; a third determining first-level subunit, configured to determine a midpoint of a display contour on the display contour from the start point to the stop point; the midpoint is taken as the starting point of the stroke display path.
Optionally, the fourth determining unit includes: a fourth determining level subunit, configured to sort the path points in the second sub-list of the second sub-path in an inverted manner, and determine a third sub-path; a fifth determining level subunit, configured to determine, according to the plurality of first path points in the first sub-path, second path points with the minimum distances between the first path points from the third sub-path; a sixth determining level subunit, configured to determine a stroke path point according to the first path point and the corresponding second path point; a seventh determining level subunit for determining a stroke display path based on the stroke path points.
Optionally, the sixth determining primary subunit includes: and a third determining secondary subunit, configured to take a midpoint between the first path point and the corresponding second path point as a stroke path point.
Optionally, the first display module includes: and the first display unit is used for filling the display outline of the stroke according to the stroke display path and the preset basic shape according to the preset moving speed so as to dynamically display the stroke.
Optionally, the second determining module includes: a fifth determining unit, configured to determine, according to the display outline, a middle point of the stroke through a coordinate table of a preset size; and a sixth determining unit for determining that the display mode of the enlarged preset shape with the middle point as a reference is a stroke display mode.
Optionally, the fifth determining unit includes: a third acquisition first-level subunit, configured to acquire a display contour in the coordinate table; eighth determining a first level subunit, configured to determine a plurality of pre-selection points in the display outline according to a certain density; a ninth determining level subunit is configured to determine the intermediate point based on the plurality of preselected points.
Optionally, the ninth determining the first level subunit includes: generating a second-level subunit, configured to generate, according to a plurality of pre-selected points, a plurality of concentric circles with the pre-selected points as circle centers according to a preset diameter difference between two adjacent concentric circles; a fourth determining secondary subunit configured to determine an intermediate circle from a plurality of concentric circles of the plurality of pre-selected points; and fifthly, determining a secondary subunit, wherein the corresponding preselected point for the intermediate circle is the intermediate point.
Optionally, the fourth determining second level subunit includes: determining three-level subunits, which are used for determining an intermediate circle according to the number and the distance of the intersection points of the concentric circle and the display outline; determining an intermediate circle by judging whether the number and the distance of the intersection points of the concentric circle and the display outline meet the following conditions; determining the concentric circle as an intermediate circle in the case where the concentric circle satisfies at least one of the following conditions; the number of the intersection points of the concentric circles and the display outline is two, and the two intersection points are the positive intersection points of the concentric circles and the display outline; the number of the intersection points of the concentric circles and the display outline is three, one intersection point of the three intersection points is the positive intersection point of the concentric circles and the display outline, and the distance between the other two intersection points of the three intersection points is smaller than the preset error precision; the number of the intersection points of the concentric circles and the display outline is four, and the four intersection points are two pairs of intersection points with the distance smaller than the preset error precision.
Optionally, the first display module includes: and the second display unit is used for amplifying the stroke from the middle point of the display outline of the stroke according to a preset amplifying speed in a preset shape, and filling the outline of the stroke to dynamically display the stroke.
Optionally, the second determining module includes: a seventh determining unit, configured to perform prototype compression on the display outline, and determine a pen trace of the display outline; and an eighth determining unit for determining a stroke display mode according to the handwriting line.
Example 10
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein the program, when executed, controls a device in which the storage medium is located to perform the font display method of any one of the above, including:
acquiring font data of characters to be displayed; determining the display outline of strokes of the characters according to the font data; determining a stroke display mode of the strokes according to the display outline; dynamically displaying strokes according to a stroke display mode; and dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until the strokes of the characters are all displayed.
Optionally, determining the display outline of the strokes of the text according to the font data includes: determining a path point list of the display outline through a system class for determining the display outline according to the font data; a display outline of the closed-loop stroke is generated from the path point list.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: determining a starting point and an ending point of a stroke display path according to data in the path point list; dividing the path point list into a first sub-list and a second sub-list according to a starting point and a terminating point; determining a first sub-path according to the first sub-list, and determining a second sub-path according to the second sub-list; determining a stroke display path according to the first sub-path and the second sub-path; the display mode of the preset shape moving according to the stroke display path is a stroke display mode.
Optionally, determining the termination point of the stroke display path according to the data in the path point list includes: taking the starting point of the display outline in the path point list as the ending point of the stroke display path; the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring a first reference point with the minimum value of an X coordinate axis and a second reference point with the minimum value of a Y coordinate axis in a path point list; a starting point is determined based on the first reference point and the second reference point.
Optionally, determining the start point from the first reference point and the second reference point includes: in the case where the first reference point and the second reference point are the same point, the first reference point or the second reference point is a start point; if the first reference point and the second reference point are not the same point, a point farthest from the termination point in the path point list is determined as a start point.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring a starting point and a stopping point of a display contour in a path point list; determining the middle point of the display outline on the display outline from the starting point to the stopping point; the midpoint is taken as the starting point of the stroke display path.
Optionally, determining the stroke display path according to the first sub-path and the second sub-path includes: ordering the path points in the second sub-list of the second sub-path in an inverted manner, and determining a third sub-path; according to a plurality of first path points in the first sub-path, respectively determining second path points with minimum first path point distances from a third sub-path; determining a stroke path point according to the first path point and the corresponding second path point; a stroke display path is determined from the stroke path points.
Optionally, determining the stroke path point according to the first path point and the corresponding second path point includes: and taking the midpoint between the first path point and the corresponding second path point as a stroke path point.
Optionally, dynamically displaying the strokes according to the stroke display path includes: filling the display outline of the stroke according to the stroke display path by the preset basic shape according to the preset moving speed so as to dynamically display the stroke.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: determining a middle point of the stroke according to the display outline through a coordinate table with a preset size; and determining a display mode of amplifying the preset shape by taking the middle point as a reference as a stroke display mode.
Optionally, determining the intermediate point of the stroke according to the display outline through a coordinate table of a preset size includes: acquiring a display contour in a coordinate table; determining a plurality of pre-selected points within the display outline according to a certain density; an intermediate point is determined from the plurality of preselected points.
Optionally, determining the intermediate point from the plurality of pre-selected points includes: according to the preset diameter difference of two adjacent concentric circles, each preselected point generates a plurality of concentric circles taking the preselected point as the center of a circle; determining an intermediate circle from a plurality of concentric circles of the plurality of preselected points; the corresponding preselected point of the intermediate circle is the intermediate point.
Optionally, determining the intermediate circle from a plurality of concentric circles of the plurality of pre-selected points includes: determining an intermediate circle according to the number and the distance of the intersection points of the concentric circles and the display outline; determining an intermediate circle by judging whether the number and the distance of the intersection points of the concentric circle and the display outline meet the following conditions; determining the concentric circle as an intermediate circle in the case where the concentric circle satisfies at least one of the following conditions; the number of the intersection points of the concentric circles and the display outline is two, and the two intersection points are the positive intersection points of the concentric circles and the display outline; the number of the intersection points of the concentric circles and the display outline is three, one intersection point of the three intersection points is the positive intersection point of the concentric circles and the display outline, and the distance between the other two intersection points of the three intersection points is smaller than the preset error precision; the number of the intersection points of the concentric circles and the display outline is four, and the four intersection points are two pairs of intersection points with the distance smaller than the preset error precision.
Optionally, dynamically displaying the strokes of the text according to the stroke display mode includes: and amplifying the stroke from the middle point of the displayed outline of the stroke according to a preset amplifying speed in a preset shape, and filling the outline of the stroke to dynamically display the stroke.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: prototype compression is carried out on the display outline, and a pen trace of the display outline is determined; and determining a stroke display mode according to the handwriting line.
Example 11
According to another aspect of the embodiment of the present invention, there is also provided a processor, configured to execute a program, where the program executes any one of the font display methods described above, and the method includes:
acquiring font data of characters to be displayed; determining the display outline of strokes of the characters according to the font data; determining a stroke display mode of the strokes according to the display outline; dynamically displaying strokes according to a stroke display mode; and dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until the strokes of the characters are all displayed.
Optionally, determining the display outline of the strokes of the text according to the font data includes: determining a path point list of the display outline through a system class for determining the display outline according to the font data; a display outline of the closed-loop stroke is generated from the path point list.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: determining a starting point and an ending point of a stroke display path according to data in the path point list; dividing the path point list into a first sub-list and a second sub-list according to a starting point and a terminating point; determining a first sub-path according to the first sub-list, and determining a second sub-path according to the second sub-list; determining a stroke display path according to the first sub-path and the second sub-path; the display mode of the preset shape moving according to the stroke display path is a stroke display mode.
Optionally, determining the termination point of the stroke display path according to the data in the path point list includes: taking the starting point of the display outline in the path point list as the ending point of the stroke display path; the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring a first reference point with the minimum value of an X coordinate axis and a second reference point with the minimum value of a Y coordinate axis in a path point list; a starting point is determined based on the first reference point and the second reference point.
Optionally, determining the start point from the first reference point and the second reference point includes: in the case where the first reference point and the second reference point are the same point, the first reference point or the second reference point is a start point; and when the first reference point and the second reference point are not the same points, determining the point farthest from the ending point in the path point list as the starting point.
Optionally, determining the start point of the stroke display path according to the data in the path point list includes: acquiring the starting point and the stopping point of the display outline in the path point list; determining the middle point of the display outline on the display outline from the starting point to the stopping point; and taking the midpoint as a starting point of the stroke display path.
Optionally, determining the stroke display path according to the first sub-path and the second sub-path includes: ordering the path points in the second sub-list of the second sub-path in an inverted manner, and determining a third sub-path; according to a plurality of first path points in the first sub-path, respectively determining second path points with minimum first path point distances from a third sub-path; determining a stroke path point according to the first path point and the corresponding second path point; a stroke display path is determined from the stroke path points.
Optionally, determining the stroke path point according to the first path point and the corresponding second path point includes: and taking the midpoint between the first path point and the corresponding second path point as a stroke path point.
Optionally, dynamically displaying the strokes according to the stroke display path includes: filling the display outline of the stroke according to the stroke display path by the preset basic shape according to the preset moving speed so as to dynamically display the stroke.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: determining a middle point of the stroke according to the display outline through a coordinate table with a preset size; and determining a display mode of amplifying the preset shape by taking the middle point as a reference as a stroke display mode.
Optionally, determining the intermediate point of the stroke according to the display outline through a coordinate table of a preset size includes: acquiring a display contour in a coordinate table; determining a plurality of pre-selected points within the display outline according to a certain density; an intermediate point is determined from the plurality of preselected points.
Optionally, determining the intermediate point from the plurality of pre-selected points includes: according to the preset diameter difference of two adjacent concentric circles, each preselected point generates a plurality of concentric circles taking the preselected point as the center of a circle; determining an intermediate circle from a plurality of concentric circles of the plurality of preselected points; the corresponding preselected point of the intermediate circle is the intermediate point.
Optionally, determining the intermediate circle from a plurality of concentric circles of the plurality of pre-selected points includes: determining an intermediate circle according to the number and the distance of the intersection points of the concentric circles and the display outline; determining an intermediate circle by judging whether the number and the distance of the intersection points of the concentric circle and the display outline meet the following conditions; determining the concentric circle as an intermediate circle in the case where the concentric circle satisfies at least one of the following conditions; the number of the intersection points of the concentric circles and the display outline is two, and the two intersection points are the positive intersection points of the concentric circles and the display outline; the number of the intersection points of the concentric circles and the display outline is three, one intersection point of the three intersection points is the positive intersection point of the concentric circles and the display outline, and the distance between the other two intersection points of the three intersection points is smaller than the preset error precision; the number of the intersection points of the concentric circles and the display outline is four, and the four intersection points are two pairs of intersection points with the distance smaller than the preset error precision.
Optionally, dynamically displaying the strokes of the text according to the stroke display mode includes: and amplifying the stroke from the middle point of the displayed outline of the stroke according to a preset amplifying speed in a preset shape, and filling the outline of the stroke to dynamically display the stroke.
Optionally, determining a stroke display mode of the stroke according to the display outline includes: prototype compression is carried out on the display outline, and a pen trace of the display outline is determined; and determining a stroke display mode according to the handwriting line.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed technology may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, for example, may be a logic function division, and may be implemented in another manner, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a preferred embodiment of the present invention and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present invention, which are intended to be comprehended within the scope of the present invention.

Claims (18)

1. A text display method, comprising:
acquiring font data of characters to be displayed;
determining the display outline of the strokes of the characters according to the font data;
determining a stroke display mode of the strokes according to the display outline;
dynamically displaying the strokes according to the stroke display mode;
dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until the strokes of the characters are all displayed,
determining a display outline of a stroke of the text according to the font data comprises:
determining a path point list of the display outline according to the font data through a system class for determining the display outline, wherein the system class is used for acquiring the minimum number of path point lists required by rendering strokes needing to be displayed, and the path point list comprises coordinates of points on a plurality of display outlines;
The display outline of the closed-loop stroke is generated by algorithmically smoothing a plurality of the coordinates in the list of path points.
2. The method of claim 1, wherein determining a stroke display manner of the stroke from the display outline comprises:
determining a starting point and an ending point of a stroke display path according to the data in the path point list;
dividing the path point list into a first sub-list and a second sub-list according to the starting point and the ending point;
determining a first sub-path according to the first sub-list, and determining a second sub-path according to the second sub-list;
determining the stroke display path according to the first sub-path and the second sub-path; and the display mode of the preset shape moving according to the stroke display path is the stroke display mode.
3. The method of claim 2, wherein determining an ending point of the stroke display path based on data in the list of path points comprises:
taking the starting point of the display outline in the path point list as the ending point of the stroke display path;
the display contour is a complete closed-loop contour, and the starting point is a stopping point of the display contour.
4. A method according to claim 3, wherein determining a start point of the stroke display path from data in the list of path points comprises:
acquiring a first datum point with the minimum value of an X axis and a second datum point with the minimum value of a Y axis in the path point list;
the starting point is determined from the first reference point and the second reference point.
5. The method of claim 4, wherein determining the starting point from the first reference point and the second reference point comprises:
in the case where the first reference point and the second reference point are the same point, the first reference point or the second reference point is the start point;
and determining a point farthest from the termination point in the path point list as the starting point when the first reference point and the second reference point are not the same point.
6. A method according to claim 3, wherein determining a start point of the stroke display path from data in the list of path points comprises:
acquiring the starting point and the stopping point of the display outline in the path point list;
Determining the middle point of the display outline on the display outline from the starting point to the stopping point;
and taking the midpoint as a starting point of the stroke display path.
7. The method of claim 2, wherein determining the stroke display path from the first sub-path and the second sub-path comprises:
inverting and sequencing the path points in a second sub-list of the second sub-path to determine a third sub-path;
according to a plurality of first path points in the first sub-path, respectively determining second path points with minimum distance from the first path points from the third sub-path;
determining a stroke path point according to the first path point and the corresponding second path point;
and determining the stroke display path according to the stroke path point.
8. The method of claim 7, wherein determining a stroke path point from the first path point and the corresponding second path point comprises:
and taking the midpoint between the first path point and the corresponding second path point as the stroke path point.
9. The method of claim 7, wherein dynamically displaying the stroke according to the stroke display path comprises:
And filling the display outline of the stroke according to the stroke display path by the preset basic shape according to the preset moving speed so as to dynamically display the stroke.
10. The method of claim 1, wherein determining a stroke display manner of the stroke from the display outline comprises:
determining the middle point of the stroke according to the display outline through a coordinate table with a preset size;
and determining the display mode of amplifying the preset shape by taking the middle point as a reference as the stroke display mode.
11. The method of claim 10, wherein determining the intermediate point of the stroke from the display outline by a coordinate table of a preset size comprises:
acquiring the display outline in the coordinate table;
determining a plurality of pre-selected points within the display outline according to a certain density;
the intermediate point is determined from a plurality of the preselected points.
12. The method of claim 11, wherein determining the intermediate point from the plurality of preselected points comprises:
according to the preselected points, generating a plurality of concentric circles taking the preselected points as circle centers according to the preset diameter difference of two adjacent concentric circles by each preselected point;
Determining an intermediate circle from a plurality of said concentric circles of a plurality of said preselected points;
the corresponding preselected point of the intermediate circle is the intermediate point.
13. The method of claim 12, wherein determining an intermediate circle from a plurality of the concentric circles of the plurality of the preselected points comprises:
determining the middle circle according to the number and the distance of the intersection points of the concentric circle and the display outline;
determining the middle circle by judging whether the number and the distance of the intersection points of the concentric circle and the display outline meet the following conditions; determining the concentric circle as the intermediate circle in a case where the concentric circle satisfies at least one of the following conditions;
the number of the intersection points of the concentric circles and the display outline is two, and the two intersection points are the positive intersection points of the concentric circles and the display outline;
the number of the intersection points of the concentric circles and the display outline is three, one intersection point of the three intersection points is a positive intersection point of the concentric circles and the display outline, and the distance between the other two intersection points of the three intersection points is smaller than the preset error precision;
the number of the intersection points of the concentric circles and the display outline is four, and the four intersection points are two pairs of intersection points with the distance smaller than the preset error precision.
14. The method of claim 13, wherein dynamically displaying strokes of the text according to the stroke display style comprises:
and amplifying the outline of the stroke according to a preset amplifying speed from the middle point of the displayed outline of the stroke in a preset shape, and filling the outline of the stroke to dynamically display the stroke.
15. The method of claim 1, wherein determining a stroke display manner of the stroke from the display outline comprises:
prototype compression is carried out on the display outline, and handwriting lines of the display outline are determined;
and determining the stroke display mode according to the handwriting line.
16. A character display device, comprising:
the acquisition module is used for acquiring font data of characters to be displayed;
a first determining module, configured to determine a display outline of a stroke of the text according to the font data;
the second determining module is used for determining a stroke display mode of the strokes according to the display outline;
the first display module is used for dynamically displaying the strokes according to the stroke display mode;
a second display module for dynamically displaying the strokes of the characters one by one according to the stroke sequence of the characters until the strokes of the characters are all displayed,
The first determining module includes:
a first determining unit configured to determine, according to the font data, a route point list of the display outline by a system class for determining the display outline, the system class being configured to acquire a minimum number of the route point lists required for rendering strokes to be displayed, the route point list including coordinates of points on a plurality of the display outlines;
and the generation unit is used for smoothly connecting a plurality of coordinates in the path point list through an algorithm and generating the display outline of the closed-loop stroke.
17. A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the method of any one of claims 1 to 15.
18. A processor for running a program, wherein the program when run performs the method of any one of claims 1 to 15.
CN201910563653.3A 2019-06-26 2019-06-26 Text display method, text display device, storage medium and processor Active CN110322538B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910563653.3A CN110322538B (en) 2019-06-26 2019-06-26 Text display method, text display device, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910563653.3A CN110322538B (en) 2019-06-26 2019-06-26 Text display method, text display device, storage medium and processor

Publications (2)

Publication Number Publication Date
CN110322538A CN110322538A (en) 2019-10-11
CN110322538B true CN110322538B (en) 2023-09-05

Family

ID=68120336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910563653.3A Active CN110322538B (en) 2019-06-26 2019-06-26 Text display method, text display device, storage medium and processor

Country Status (1)

Country Link
CN (1) CN110322538B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110794849B (en) * 2019-11-28 2023-07-25 广州视源电子科技股份有限公司 Path processing method, path processing device, robot, computer device and storage medium
CN111324405A (en) * 2020-01-20 2020-06-23 北京无限光场科技有限公司 Character display method and device and electronic equipment
CN113763514B (en) * 2021-07-15 2024-04-02 北京字节跳动网络技术有限公司 Method, device and system for generating stroke order animation and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588350A (en) * 2004-09-17 2005-03-02 华南理工大学 Treating method and its use for dynamic Chinese character word library containing writing time sequence information
CN101630311A (en) * 2008-07-18 2010-01-20 常州华文印刷新技术有限公司 Method and device for displaying characters
JP2011003040A (en) * 2009-06-19 2011-01-06 Kinichi Inagaki General-purpose two-dimensional shape or three-dimensional shape automatic designing and manufacturing system for processing two-dimensional shape or three-dimensional shape for processing graphic and shape, including uncertain graphic sentence program
CN106384094A (en) * 2016-09-18 2017-02-08 北京大学 Chinese word stock automatic generation method based on writing style modeling
CN106981086A (en) * 2016-01-18 2017-07-25 北大方正集团有限公司 Information broadcasting method and information play apparatus
CN107665186A (en) * 2017-09-29 2018-02-06 深圳市前海手绘科技文化有限公司 A kind of peculiar font generation method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588350A (en) * 2004-09-17 2005-03-02 华南理工大学 Treating method and its use for dynamic Chinese character word library containing writing time sequence information
CN101630311A (en) * 2008-07-18 2010-01-20 常州华文印刷新技术有限公司 Method and device for displaying characters
JP2011003040A (en) * 2009-06-19 2011-01-06 Kinichi Inagaki General-purpose two-dimensional shape or three-dimensional shape automatic designing and manufacturing system for processing two-dimensional shape or three-dimensional shape for processing graphic and shape, including uncertain graphic sentence program
CN106981086A (en) * 2016-01-18 2017-07-25 北大方正集团有限公司 Information broadcasting method and information play apparatus
CN106384094A (en) * 2016-09-18 2017-02-08 北京大学 Chinese word stock automatic generation method based on writing style modeling
CN107665186A (en) * 2017-09-29 2018-02-06 深圳市前海手绘科技文化有限公司 A kind of peculiar font generation method

Also Published As

Publication number Publication date
CN110322538A (en) 2019-10-11

Similar Documents

Publication Publication Date Title
CN110322538B (en) Text display method, text display device, storage medium and processor
US20160110052A1 (en) Apparatus and method of drawing and solving figure content
Yue et al. WireDraw: 3D Wire Sculpturing Guided with Mixed Reality.
US10318102B2 (en) 3D model generation from 2D images
KR20160033547A (en) Apparatus and method for styling a content
US20130215045A1 (en) Stroke display method of handwriting input and electronic device
CN114648615B (en) Method, device and equipment for controlling interactive reproduction of target object and storage medium
Jönsson et al. Intuitive exploration of volumetric data using dynamic galleries
Peng et al. Sketch2domino: Interactive chain reaction design and guidance
EP3217360B1 (en) Display device and method of controlling display device
CN107957847A (en) Touch track display method, device, equipment and storage medium
US11100722B2 (en) Method, apparatus, electronic device, and storage medium for displaying 3D shape in expanded manner
CN111739134B (en) Model processing method and device for virtual character and readable storage medium
CN104346046A (en) Three-dimensional simulation page turning method and system
JP6273978B2 (en) Display control program, display control apparatus, and display control method
JP2017016439A (en) Program, information processor, depth definition method and recording medium
US20180204388A1 (en) Figure drawing apparatus, control method of figure drawing apparatus, and recording medium
EP4325344A1 (en) Multi-terminal collaborative display update method and apparatus
CN114797109A (en) Object editing method and device, electronic equipment and storage medium
JP5667334B2 (en) Graphic evaluation program and graphic evaluation apparatus
KR101116733B1 (en) Apparatus and Method for Finding Wrong Image In Three Dimensional Space and a recording medium thereof
CN112346633B (en) Input processing method, input processing device, electronic device, and storage medium
CN113450429B (en) Track drawing method and device
JP7475625B2 (en) Method and program for receiving and displaying input in three-dimensional space, and device for receiving and displaying input in three-dimensional space
CN105824796A (en) Method and apparatus for displaying data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant