Background
The word stock is an indispensable part in modern operating systems, and assists various devices in displaying fonts and the like. And a set of word stock needs to go through a complicated flow before being put into use, except that a font designer designs a word draft and accurately draws each font at the earlier stage, a tool is also needed to further process and check the word stock, so that the word stock can be well displayed in the system. The process of further processing the font library includes adding some instructions to the font, such as controlling the thickness of the horizontal and vertical strokes to be consistent, adjusting the rendering effect under each font size, adjusting the font strokes under each font size to achieve a better display effect, and the like.
The control of the consistency of the thickness of the horizontal strokes and the vertical strokes means that certain rules are added to the horizontal strokes and the vertical strokes to control the consistency of the width of the strokes so that the strokes can display correct effects in the system. Since the rule is mainly used for controlling the consistency of the thickness and the width of the stroke, the rule is in a form of a pair, and relates to line segments on two sides of the stroke, and each side at least comprises one line segment. The method for adding rules to horizontal and vertical strokes is mainly used for some competitive word stocks, such as blackbodies, songhs and the like, which are common, for example, the radical of ' grass ' + ', as shown in fig. 1, the upper and lower horizontal line segments in the circle 1 and the upper and lower four horizontal line segments in the circle 2 should belong to a group of rules, that is, the upper horizontal line segments in the two circles are both the upper sides of the rules, and the lower horizontal line segments are both the lower sides of the rules, so that the heights of the upper or lower horizontal line segments in the two circles can be synchronously controlled, and the strokes are uniform in thickness. However, if the strokes in the two circles do not belong to a group of controls (i.e., the upper and lower horizontal line segments in circle 1 form a group of rules, and the upper and lower horizontal line segments in circle 2 form a group of rules), the situation that the widths of the strokes of the upper (or lower) horizontal strokes in circle 1 and circle 2 are inconsistent in some display environments may occur, thereby affecting the display effect. And the character quantity of a set of Chinese character library is the least simple character library, and more than 6000 Chinese characters exist, so that for the problems, manual adjustment consumes time and labor, and tools are required for processing, adjusting and judging.
The effect of the existing common tool on most of font plus horizontal and vertical stroke rules is good, but some problems still exist, such as rule plus bold or rule plus not, and the like, so that the stroke width is not easy to control, wherein the rule plus not plus condition is mainly adopted, if the rule plus not plus condition is adopted, the display effect of a word stock in a system is poor, meanwhile, the time cost of manual verification is increased, and the working efficiency is reduced.
Disclosure of Invention
The present invention is directed to solving at least one of the problems of the prior art or the related art.
To this end, a first aspect of the present invention is directed to a method for controlling strokes of a glyph.
A second aspect of the present invention is directed to a control system for stroke of a glyph.
A third aspect of the invention is directed to a computer device.
A fourth aspect of the present invention is directed to a computer-readable storage medium.
In view of the above, according to an aspect of the present invention, a method for controlling strokes of a glyph is provided, including: acquiring an inner contour and an outer contour of the font; acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; adding preset rules to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and all the vertical ruled lines; and controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The invention provides a control method of font strokes, firstly obtaining the inner and outer outlines of the font, taking the current outer outline and the inner outline contained by the current outer outline as processing objects, obtaining horizontal outline line segments and vertical outline line segments, and grouping the horizontal outline line segments and the vertical outline line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, adding preset rules to any two groups of horizontal outline line segments or vertical outline line segments meeting a second preset condition, wherein, whether any two groups of horizontal outline line segments meet the adding preset rules can be judged firstly, then whether any two groups of vertical outline line segments meet the adding preset rules can be judged, after finishing whether all outline line segments meet the adding preset rules and adding the outline line segments meeting the adding rules of the preset rules, the rule line segments of the adding rules are controlled so that the thickness and width of the controlled strokes are consistent, the problem of same horizontal stroke or vertical stroke unevenness inhomogeneous when the font shows is solved, make the word stock better at system display effect, reduced the time cost of artifical check, improved work efficiency.
The control method of the font stroke according to the invention can also have the following technical characteristics:
in the above technical solution, preferably, before controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule, the method further includes: judging whether a horizontal ruled line and/or a vertical ruled line meeting a third preset rule exist or not; and if so, deleting the horizontal ruled line and/or the vertical ruled line meeting the third preset rule.
In the technical scheme, before the horizontal ruled lines and/or the vertical ruled lines are controlled according to the preset rules, a group of line segments possibly exist in two or more pairs of ruled lines respectively, and the situation that the analysis of the ruled lines is ambiguous can be caused, so that the situation that whether the horizontal ruled lines and the vertical ruled lines meeting the third preset rules exist or not is judged, and when the horizontal ruled lines and the vertical ruled lines exist, the horizontal ruled lines and the vertical ruled lines are deleted, the problem of font display caused by the non-specification of the ruled lines is avoided, and the reasonability of the ruled lines is.
In any of the above technical solutions, preferably, the step of determining whether there is a horizontal ruled line and/or a vertical ruled line that satisfies a third preset rule specifically includes: respectively judging whether the length of the overlapped part of any pair of horizontal ruled lines or any pair of vertical ruled lines is the longest overlapped part; if the judgment result is negative, deleting any pair of horizontal ruled lines or any pair of vertical ruled lines; judging whether the same line segment simultaneously exists in N pairs of deleted horizontal ruled lines or deleted vertical ruled lines; if so, deleting the N-1 pairs of deleted horizontal ruled lines or deleted vertical ruled lines; wherein N is an integer greater than 1.
In the technical scheme, the process of judging whether a horizontal ruled line and/or a vertical ruled line meeting a third preset rule exists or not is carried out, whether the length of the overlapped part of any pair of the horizontal ruled lines or any pair of the vertical ruled lines is the longest overlapped part or not is judged respectively, one ruled line is judged firstly, then the other ruled line is judged, if the horizontal ruled line is judged firstly, after all the horizontal ruled lines are judged, the vertical ruled line is judged, and when the overlapped part is not the longest, the pair of ruled lines is deleted, namely the pair of the longest overlapped part in all the candidate ruled lines is reserved. And then judging whether the same rule line exists in more than one pair of rule lines, if so, reserving one pair of rule lines and deleting the rest, thereby avoiding ambiguity in rule line analysis.
In any of the above technical solutions, preferably, the step of obtaining the inner contour and the outer contour of the glyph specifically includes: acquiring a font outline according to a font loop of the font; the inner contour and the outer contour are determined according to the contour direction of the glyph contour.
In the technical scheme, in the process of acquiring the inner contour and the outer contour of the font, the font contour is acquired according to the font loop of the font, and the inner contour and the outer contour are distinguished through the contour direction, so that the inner contour and the outer contour of the font are acquired, and a foundation is provided for subsequent font processing.
In any of the above technical solutions, preferably, the step of obtaining a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained therein, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule specifically includes: judging whether any outer contour comprises any inner contour; if the judgment result is yes, setting any outer contour and all inner contours contained in the outer contour as a processing object; if the judgment result is negative, setting any outer contour as a processing object; traversing all processing objects, and screening out a horizontal contour line segment and a vertical contour line segment; dividing a horizontal contour line segment on the same straight line and a vertical contour line segment on the same straight line into a horizontal contour line segment with the same composition and a vertical contour line segment with the same composition respectively; and sequencing the horizontal contour line segments of all the components in the sequence from top to bottom, and sequencing the vertical contour line segments of all the components in the sequence from left to right.
In the technical scheme, a horizontal contour line segment and a vertical contour line segment are obtained, and the contour line segments are divided into components, wherein firstly, the inner contour and the outer contour are matched, and when the outer contour comprises the inner contour, the outer contour and the inner contour comprising the outer contour are regarded as a whole and set as a processing object by judging whether any outer contour comprises any inner contour; when the outer contour does not contain the inner contour, the outer contour is regarded as a whole and is set as a processing object, all contour lines in each outer contour and the inner contour contained in the outer contour are traversed, the horizontal contour line segments and the vertical contour line segments in the outer contour are judged and screened, the horizontal contour line segments can be traversed firstly, then the vertical contour line segments are traversed and stored separately, the horizontal contour line segments on the same horizontal line are divided into the same group of horizontal contour line segments, the vertical contour line segments on the same horizontal line are divided into the same group of vertical contour line segments, each group of horizontal line segments are sequenced according to the sequence from top to bottom, and each group of vertical line segments are sequenced according to the sequence from left to right, so that the regular lines can be judged subsequently according.
In any of the above technical solutions, preferably, if the contour line segment is a horizontal contour line segment, the second preset rule is: the distance between the two groups of horizontal contour line segments is within a first preset range, the two groups of horizontal contour line segments are overlapped in the vertical direction, and the middle area formed by the two groups of horizontal contour line segments is in the font filling area; if the contour line segment is a vertical contour line segment, the second preset rule is as follows: the distance between the two groups of vertical outline line segments is within a first preset range, the two groups of vertical outline line segments are overlapped in the horizontal direction, and the middle area formed by the two groups of vertical outline line segments is in the font filling area.
In the technical scheme, whether two groups of horizontal contour line segments meet a second preset rule is judged to judge whether the two groups of horizontal contour line segments add the preset rule, and specifically, whether the two groups of horizontal contour line segments meet three conditions is judged: the first one is: the distance between the two groups of horizontal contour line segments is within a first preset range, and a first threshold value can be set as a stroke width threshold value; secondly, the following steps: if no coincidence exists, the current group and other groups are continuously judged, otherwise, a single line segment which is not coincident with the opposite side in the two groups of line segments is further deleted, and the number of the line segments of one group is 0 after deletion, and the current group and other groups are continuously judged; thirdly, the method comprises the following steps: the middle area formed by two groups of horizontal contour line segments is in the character pattern filling area, if three conditions are met, rules are added to the pair of contour line segments, if the three conditions are not met, the current group and other groups of line segments are continuously judged, the judgment of whether the middle area formed by two groups of horizontal line segments is in the character pattern filling part is judged, the area is mainly converted into a line, the line is further dispersed into points, and the judgment of whether the points are both in the outer contour and the outer contour is substantially carried out. Whether the two groups of vertical contour line segments meet the second preset rule or not is judged, whether the two groups of horizontal contour line segments meet the second preset rule or not is judged, and therefore the preset rule is added to any two groups of contour line segments meeting the second preset rule, the condition that the preset rule cannot be added is avoided, and the control on the stroke width is guaranteed.
According to a second aspect of the present invention, there is provided a control system for font stroke, comprising: an acquisition unit for acquiring an inner contour and an outer contour of the font; the dividing unit is used for acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; the adding unit is used for adding the preset rules to any two components of horizontal contour line segments and vertical contour line segments meeting the second preset rule so as to obtain all horizontal ruled lines and vertical ruled lines; and the control unit is used for controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The invention provides a control system of font strokes, which comprises an acquisition unit, a dividing unit, an adding unit and a control unit, wherein the acquisition unit acquires the inner contour and the outer contour of a font, the dividing unit takes the current outer contour and the inner contour contained in the current outer contour as processing objects, acquires horizontal contour line segments and vertical contour line segments, and groups the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, the adding unit adds preset rules to any two groups of horizontal contour line segments or vertical contour line segments meeting a second preset condition, wherein the adding unit can firstly judge whether any two groups of horizontal contour line segments meet the adding preset rules, then judges whether any two groups of vertical contour line segments meet the adding preset rules, and after finishing whether all contour line segments meet the adding preset rules and adding the contour line segments meeting the preset rules, the control unit controls the rule line segments of the adding, the stroke thickness width of the controlled stroke is consistent, the problem that the same horizontal stroke or vertical stroke is uneven and uneven during font display is solved, the display effect of the word stock in a system is better, the time cost of manual verification is reduced, and the working efficiency is improved.
The control system for the font stroke according to the invention can also have the following technical characteristics:
in the above technical solution, preferably, the method further includes: the first judgment unit is used for judging whether a horizontal ruled line and/or a vertical ruled line meeting a third preset rule exist or not; and the deleting unit is used for deleting the horizontal ruled line and/or the vertical ruled line meeting the third preset rule if the judgment result is yes.
In the technical scheme, before the horizontal ruled lines and/or the vertical ruled lines are controlled according to the preset rules, a group of line segments possibly exist in two or more pairs of ruled lines respectively, and the analysis of the ruled lines is ambiguous, so that the first judgment unit judges whether the horizontal ruled lines and the vertical ruled lines meeting the third preset rules exist or not, and when the horizontal ruled lines and the vertical ruled lines exist, the deletion unit deletes the horizontal ruled lines and the vertical ruled lines, thereby avoiding the problem of font display caused by the non-specification of the ruled lines and ensuring the reasonability of the ruled lines.
In any one of the above technical solutions, preferably, the first determining unit specifically includes: the first judging subunit is used for respectively judging whether the length of the overlapped part of any pair of horizontal ruled lines or any pair of vertical ruled lines is the longest overlapped part; the deleting unit is specifically used for deleting any pair of horizontal ruled lines or any pair of vertical ruled lines if the judgment result is negative; the second judgment subunit is used for judging whether the same line segment simultaneously exists in the N pairs of deleted horizontal ruled lines or deleted vertical ruled lines; the deleting unit is specifically used for deleting the N-1 pairs of deleted horizontal ruled lines or deleted vertical ruled lines if the judgment result is yes; wherein N is an integer greater than 1.
In the technical scheme, the first judging unit judges whether a process of a horizontal ruled line and/or a vertical ruled line meeting a third preset rule exists, the first judging subunit judges whether the length of the overlapped part of any pair of the horizontal ruled lines or any pair of the vertical ruled lines is the longest overlapped part, the judgment of one kind of ruled line can be carried out firstly, then the judgment of the other kind of ruled line can be carried out, if the judgment of the horizontal ruled line is carried out firstly, after the judgment of all the horizontal ruled lines is finished, the judgment of the vertical ruled line is carried out, and when the overlapped part is not the longest, the deleting unit deletes the pair of ruled lines, namely, the pair of ruled lines with the longest overlapped part in all the candidate ruled lines is reserved. And then the second judgment subunit judges whether the same ruled line exists in more than one pair of ruled lines, if so, one pair of ruled lines is reserved, and the deletion unit deletes the rest ruled lines, so that ambiguity existing in ruled line analysis is avoided.
In any of the above technical solutions, preferably, the obtaining unit specifically includes: the first acquisition subunit is used for acquiring the outline of the font according to the font loop of the font; and the second acquisition subunit is used for determining the inner contour and the outer contour according to the contour direction of the font contour.
In the technical scheme, in the process of acquiring the inner contour and the outer contour of the font by the acquiring unit, the first acquiring subunit acquires the font contour according to the font loop of the font, and the second acquiring subunit distinguishes the inner contour and the outer contour through the contour direction, so that the inner contour and the outer contour of the font are acquired, and a basis is provided for subsequent font processing.
In any of the above technical solutions, preferably, the dividing unit specifically includes: the second judging unit is used for judging whether any outer contour comprises any inner contour; the first setting unit is used for setting any outer contour and all inner contours contained in the outer contour as a processing object if the judgment result is yes; the second setting unit is used for setting any outer contour as a processing object if the judgment result is negative; the screening unit is used for traversing all processing objects and screening out horizontal contour line segments and vertical contour line segments; the merging unit is used for dividing the horizontal contour line segment on the same straight line and the vertical contour line segment on the same straight line into a horizontal contour line segment with the same component and a vertical contour line segment with the same component respectively; and the sequencing unit is used for sequencing the horizontal contour line segments of all the components in sequence from top to bottom and sequencing the vertical contour line segments of all the components in sequence from left to right.
In the technical scheme, a dividing unit acquires a horizontal contour line segment and a vertical contour line segment and divides the contour line segment into components, firstly, inner and outer contours are matched, a second judging unit judges whether any outer contour comprises any inner contour, and when the outer contour comprises the inner contour, a first setting unit takes the outer contour and the inner contour comprising the outer contour as a whole and sets the outer contour and the inner contour as a processing object; when the outer contour does not contain the inner contour, the second setting unit regards the outer contour as a whole and sets the inner contour as a processing object, the screening unit traverses all contour lines in each outer contour and the inner contour contained in the outer contour, judges and screens horizontal contour line segments and vertical contour line segments, the horizontal contour line segments can be traversed firstly, then the vertical contour line segments are traversed and stored separately, the merging unit divides the horizontal contour line segments on the same horizontal line into the same group of horizontal contour line segments, the vertical contour line segments on the same horizontal line into the same group of vertical contour line segments, the sorting unit sorts the horizontal line segments of each group according to the sequence from top to bottom, and the vertical line segments of each group are sorted according to the sequence from left to right, so that the regular lines can be judged subsequently according to the sequence.
In any of the above technical solutions, preferably, if the contour line segment is a horizontal contour line segment, the second preset rule is: the distance between the two groups of horizontal contour line segments is within a first preset range, the two groups of horizontal contour line segments are overlapped in the vertical direction, and the middle area formed by the two groups of horizontal contour line segments is in the font filling area; if the contour line segment is a vertical contour line segment, the second preset rule is as follows: the distance between the two groups of vertical outline line segments is within a first preset range, the two groups of vertical outline line segments are overlapped in the horizontal direction, and the middle area formed by the two groups of vertical outline line segments is in the font filling area.
In the technical scheme, whether two groups of horizontal contour line segments meet a second preset rule is judged to judge whether the two groups of horizontal contour line segments add the preset rule, and specifically, whether the two groups of horizontal contour line segments meet three conditions is judged: the first one is: the distance between the two sets of horizontal contour line segments is less than a first threshold, which may be set as a stroke width threshold; secondly, the following steps: if no coincidence exists, the current group and other groups are continuously judged, otherwise, a single line segment which is not coincident with the opposite side in the two groups of line segments is further deleted, and the number of the line segments of one group is 0 after deletion, and the current group and other groups are continuously judged; thirdly, the method comprises the following steps: the middle area formed by two groups of horizontal contour line segments is in the character pattern filling area, if three conditions are met, rules are added to the pair of contour line segments, if the three conditions are not met, the current group and other groups of line segments are continuously judged, the judgment of whether the middle area formed by two groups of horizontal line segments is in the character pattern filling part is judged, the area is mainly converted into a line, the line is further dispersed into points, and the judgment of whether the points are both in the outer contour and the outer contour is substantially carried out. Whether the two groups of vertical contour line segments meet the second preset rule or not is judged, whether the two groups of horizontal contour line segments meet the second preset rule or not is judged, and therefore the preset rule is added to any two groups of contour line segments meeting the second preset rule, the condition that the preset rule cannot be added is avoided, and the control on the stroke width is guaranteed.
According to a third aspect of the present invention, there is provided a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: acquiring an inner contour and an outer contour of the font; acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; adding preset rules to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and all the vertical ruled lines; and controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The invention provides a computer device, which realizes that when a processor executes a computer program: firstly, acquiring the inner contour and the outer contour of a character form, taking the current outer contour and the inner contour contained in the current outer contour as processing objects, acquiring horizontal contour line segments and vertical contour line segments, grouping the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, and adding preset rules to any two groups of horizontal contour line segments or vertical contour line segments which meet a second preset condition, wherein whether any two groups of horizontal contour line segments meet the addition preset rules can be judged firstly, then whether any two groups of vertical contour line segments meet the addition preset rules is judged, after whether all contour line segments meet the addition preset rules and the contour line segments meeting the addition preset rules are completed, the rule line segments of the addition rules are controlled so that the widths of controlled thick and thin strokes are consistent, and the problem that the same horizontal stroke or vertical stroke is uneven when the character form is displayed is solved, the word stock has better display effect in the system, reduces the time cost of manual verification and improves the working efficiency.
According to a fourth aspect of the invention, there is provided a computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of: acquiring an inner contour and an outer contour of the font; acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; adding preset rules to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and all the vertical ruled lines; and controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements: firstly, acquiring the inner contour and the outer contour of a character form, taking the current outer contour and the inner contour contained in the current outer contour as processing objects, acquiring horizontal contour line segments and vertical contour line segments, grouping the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, and adding preset rules to any two groups of horizontal contour line segments or vertical contour line segments which meet a second preset condition, wherein whether any two groups of horizontal contour line segments meet the addition preset rules can be judged firstly, then whether any two groups of vertical contour line segments meet the addition preset rules is judged, after whether all contour line segments meet the addition preset rules and the contour line segments meeting the addition preset rules are completed, the rule line segments of the addition rules are controlled so that the widths of controlled thick and thin strokes are consistent, and the problem that the same horizontal stroke or vertical stroke is uneven when the character form is displayed is solved, the word stock has better display effect in the system, reduces the time cost of manual verification and improves the working efficiency.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Detailed Description
So that the manner in which the above recited aspects, features and advantages of the present invention can be understood in detail, a more particular description of the invention, briefly summarized above, may be had by reference to the embodiments thereof which are illustrated in the appended drawings. It should be noted that the embodiments and features of the embodiments of the present application may be combined with each other without conflict.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those specifically described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
An embodiment of the first aspect of the present invention provides a control method of font strokes, and fig. 2 shows a flow chart of the control method of the font strokes according to an embodiment of the present invention:
step 202, acquiring the inner contour and the outer contour of the font;
step 204, acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule;
step 206, adding a preset rule to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and the vertical ruled lines;
and 208, controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The invention provides a control method of font strokes, firstly obtaining the inner and outer outlines of the font, taking the current outer outline and the inner outline contained by the current outer outline as processing objects, obtaining horizontal outline line segments and vertical outline line segments, and grouping the horizontal outline line segments and the vertical outline line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, adding preset rules to any two groups of horizontal outline line segments or vertical outline line segments meeting a second preset condition, wherein, whether any two groups of horizontal outline line segments meet the adding preset rules can be judged firstly, then whether any two groups of vertical outline line segments meet the adding preset rules can be judged, after finishing whether all outline line segments meet the adding preset rules and adding the outline line segments meeting the adding rules of the preset rules, the rule line segments of the adding rules are controlled so that the thickness and width of the controlled strokes are consistent, the problem of same horizontal stroke or vertical stroke unevenness inhomogeneous when the font shows is solved, make the word stock better at system display effect, reduced the time cost of artifical check, improved work efficiency.
Fig. 3 shows a flow diagram of a control method of glyph strokes according to another embodiment of the invention. Wherein, the method comprises the following steps:
step 302, obtaining a font outline according to a font loop of the font;
step 304, determining an inner contour and an outer contour according to the contour direction of the font contour;
step 306, acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule;
308, adding a preset rule to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and all the vertical ruled lines;
step 310, judging whether a horizontal ruled line and/or a vertical ruled line meeting a third preset rule exist, if so, entering step 312, and if not, entering step 314;
step 312, deleting the horizontal ruled lines and/or the vertical ruled lines meeting the third preset rule;
and step 314, controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
In the above embodiment, before the controlling the horizontal ruled line and/or the vertical ruled line according to the preset rule, the method further includes: judging whether a horizontal ruled line and/or a vertical ruled line meeting a third preset rule exist or not; and if so, deleting the horizontal ruled line and/or the vertical ruled line meeting the third preset rule.
In this embodiment, before the horizontal ruled line and/or the vertical ruled line are controlled according to the preset rule, there may be a case where a group of line segments exist in two or more pairs of ruled lines, respectively, which may cause ambiguity in ruled line analysis, and therefore, it is determined whether there exists a horizontal ruled line and a vertical ruled line that satisfy the third preset rule, and when there exists a horizontal ruled line and a vertical ruled line, they are deleted, thereby avoiding a problem in font display caused by non-specification of the ruled line, and ensuring the reasonability of the ruled line.
In the above embodiment, preferably, the step of obtaining the inner contour and the outer contour of the glyph specifically includes: acquiring a font outline according to a font loop of the font; the inner contour and the outer contour are determined according to the contour direction of the glyph contour.
In the embodiment, in the process of acquiring the inner contour and the outer contour of the font, the font contour is acquired according to the font loop of the font, and the inner contour and the outer contour are distinguished through the contour direction, so that the inner contour and the outer contour of the font are acquired, and a basis is provided for subsequent font processing.
In any of the above embodiments, the step of determining whether there is a horizontal ruled line and/or a vertical ruled line that satisfies a third preset rule specifically includes: respectively judging whether the length of the overlapped part of any pair of horizontal ruled lines or any pair of vertical ruled lines is the longest overlapped part; if the judgment result is negative, deleting any pair of horizontal ruled lines or any pair of vertical ruled lines; judging whether the same line segment simultaneously exists in N pairs of deleted horizontal ruled lines or deleted vertical ruled lines; if so, deleting the N-1 pairs of deleted horizontal ruled lines or deleted vertical ruled lines; wherein N is an integer greater than 1.
In this embodiment, the process of determining whether there is a horizontal ruled line and/or a vertical ruled line that satisfies a third preset rule, and determining whether the length of the overlapped portion of any pair of horizontal ruled lines or any pair of vertical ruled lines is the longest overlapped portion, may be performed first by determining one kind of ruled line and then by determining the other kind of ruled line, for example, first by determining the horizontal ruled line, and after all the horizontal ruled lines are determined, by determining the vertical ruled line, and when the overlapped portion is not the longest, the pair of ruled lines is deleted, that is, the pair of ruled lines with the longest overlapped portion among all the candidate ruled lines is retained. And then judging whether the same rule line exists in more than one pair of rule lines, if so, reserving one pair of rule lines and deleting the rest, thereby avoiding ambiguity in rule line analysis.
In any of the above embodiments, preferably, the step of obtaining a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained therein, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule specifically includes: judging whether any outer contour comprises any inner contour; if the judgment result is yes, setting any outer contour and all inner contours contained in the outer contour as a processing object; if the judgment result is negative, setting any outer contour as a processing object; traversing all processing objects, and screening out a horizontal contour line segment and a vertical contour line segment; dividing a horizontal contour line segment on the same straight line and a vertical contour line segment on the same straight line into a horizontal contour line segment with the same composition and a vertical contour line segment with the same composition respectively; and sequencing the horizontal contour line segments of all the components in the sequence from top to bottom, and sequencing the vertical contour line segments of all the components in the sequence from left to right.
In the embodiment, a horizontal contour line segment and a vertical contour line segment are obtained, and the contour line segments are divided into components, wherein firstly, the inner contour and the outer contour are matched, and when the outer contour comprises the inner contour, the outer contour and the inner contour comprising the outer contour are regarded as a whole and set as a processing object by judging whether any outer contour comprises any inner contour; when the outer contour does not contain the inner contour, the outer contour is regarded as a whole and is set as a processing object, all contour lines in each outer contour and the inner contour contained in the outer contour are traversed, the horizontal contour line segments and the vertical contour line segments in the outer contour are judged and screened, the horizontal contour line segments can be traversed firstly, then the vertical contour line segments are traversed and stored separately, the horizontal contour line segments on the same horizontal line are divided into the same group of horizontal contour line segments, the vertical contour line segments on the same horizontal line are divided into the same group of vertical contour line segments, each group of horizontal line segments are sequenced according to the sequence from top to bottom, and each group of vertical line segments are sequenced according to the sequence from left to right, so that the regular lines can be judged subsequently according.
In any of the above embodiments, preferably, if the contour line segment is a horizontal contour line segment, the second preset rule is: the distance between the two groups of horizontal contour line segments is smaller than a first threshold value, the two groups of horizontal contour line segments are overlapped in the vertical direction, and the middle area formed by the two groups of horizontal contour line segments is in the font filling area; if the contour line segment is a vertical contour line segment, the second preset rule is as follows: the distance between the two groups of vertical contour line segments is smaller than a first threshold value, the two groups of vertical contour line segments are overlapped in the horizontal direction, and the middle area formed by the two groups of vertical contour line segments is in the font filling area.
In this embodiment, when determining whether two groups of horizontal contour line segments satisfy the second predetermined rule to determine whether the two groups of horizontal contour line segments add the predetermined rule, it is specifically determined whether the two groups of horizontal contour line segments satisfy three conditions: the first one is: the distance between the two groups of horizontal contour line segments is within a first preset range, and a first threshold value can be set as a stroke width threshold value; secondly, the following steps: if no coincidence exists, the current group and other groups are continuously judged, otherwise, a single line segment which is not coincident with the opposite side in the two groups of line segments is further deleted, and the number of the line segments of one group is 0 after deletion, and the current group and other groups are continuously judged; thirdly, the method comprises the following steps: the middle area formed by two groups of horizontal contour line segments is in the character pattern filling area, if three conditions are met, rules are added to the pair of contour line segments, if the three conditions are not met, the current group and other groups of line segments are continuously judged, the judgment of whether the middle area formed by two groups of horizontal line segments is in the character pattern filling part is judged, the area is mainly converted into a line, the line is further dispersed into points, and the judgment of whether the points are both in the outer contour and the outer contour is substantially carried out. Whether the two groups of vertical contour line segments meet the second preset rule or not is judged, whether the two groups of horizontal contour line segments meet the second preset rule or not is judged, and therefore the preset rule is added to any two groups of contour line segments meeting the second preset rule, the condition that the preset rule cannot be added is avoided, and the control on the stroke width is guaranteed.
An embodiment of the present invention is described below with reference to fig. 4, 5 and 6.
As shown in fig. 4, the steps of this embodiment include:
step 402, obtaining a font profile file;
step 404, obtaining a font outline, matching the font inner outline and the font outer outline: determining inner and outer contours according to the contour direction of the font, judging the inclusion relationship between each inner contour and each outer contour, matching each outer contour with all the inner contours contained in the outer contour, taking the outer contour as a whole, and performing next-step processing, wherein if the outer contour does not contain any inner contour, the outer contour is taken as a processing object;
step 406, acquiring horizontal and vertical line segments in each outer contour and the inner contour contained in each outer contour, and sequencing: screening all horizontal line segments and vertical line segments in the current outer contour and the inner contour line segments contained in the current outer contour according to the identification of each contour line, then sequencing the horizontal line segments from top to bottom, sequencing the vertical line segments from left to right, finally grouping the line segments on the same straight line, keeping the original sequencing mode among each group, and respectively storing the horizontal line segments and the vertical line segments according to the groups;
step 408, preliminarily adding rules to the horizontal line segment: for any two sets of horizontal line segments, if the distance between the two is within the stroke width threshold, there is coincidence in the vertical direction, and the formed middle area is in the filling part of the glyph, the two can be preliminarily determined as a pair of upper and lower regular lines. Assuming that each set of horizontal line segments is represented by R in the order from top to bottomi(i ═ 0,1, 2.. No.), the horizontal line segment is subjected to the following operations:
(1) if N is equal to 0, the horizontal line segment is judged to be finished, and the step 410 is switched to, otherwise, i is equal to 0, and the step (2) is switched to;
(2) if j is equal to i +1, if j is equal to N, the operation goes to (6), otherwise, the operation goes to (3);
(3)Riand RjIf the distance between the two points is smaller than the stroke width minimum value, returning to the step (2), if the distance between the two points is larger than the stroke width maximum value, switching to the step (6), and otherwise, switching to the step (4);
(4) if R isiAnd RjReturning to step (2) if no coincidence exists in the vertical direction, otherwise, judging RiAnd RjWhether each line segment is overlapped with all line segments on the opposite side or not is judged, if no, the line segment is deleted, and if the number of a group of line segments after deletion is 0, the step (2) is returned, otherwise, the step (5) is switched in;
(5) if R isiAnd RjForming a middle region in the font filling part, and forming RiAnd RjAdding a ruled line candidate array, turning to (6), and otherwise, returning to (2);
(6) determine each pair of ruled lines, i.e. R, in the candidate arrayiAnd Rk(i<k<N), selecting and storing the pair of rule lines with the longest overlapped part, and turning to (7);
(7) if i is equal to i +1, if i is equal to N-1, the preliminary judgment of the horizontal line segment is finished, the step 410 is carried out, otherwise, the step (2) is returned;
step 410, judging the rationality of the horizontal rule line: the relationship between the two sets of line segments in each pair of ruled lines is rationalized, but the relationship between the ruled lines needs to be further judged whether the relationship is rational or not. Assuming A, B and C represent each set of horizontal line segments, the preliminary ruled line processed at step 408 may have the following two cases: a and C, B and C form two pairs of ruled lines respectively; and the A and the B as well as the B and the C form two pairs of rule lines respectively. For the condition that one group of line segments respectively exist in two pairs of ruled lines, deleting one pair of ruled lines to ensure the reasonability of the ruled lines;
step 412, initially adding rules to the vertical line segments: similar to step 408;
step 414, judging the rationality of the vertical rule line: similar to step 410;
step 416, the glyph plus rule result.
The implementation process in the above specific embodiment includes the main steps of: firstly, obtaining the inner contour and the outer contour of a font, matching the outer contour with the inner contour, then obtaining each outer contour and all horizontal contour line segments and vertical contour line segments in the inner contour contained in each outer contour, then respectively judging whether rule lines should be added between two groups of horizontal line segments according to the sequence from top to bottom, further normalizing, and finally similarly processing the rule lines in the vertical direction according to the sequence from left to right. Fig. 5 shows a schematic diagram of the result of the current tool applying a rule to the word "", as shown in fig. 5, with no rule applied between the four vertical segments in circle 3 and the two horizontal segments in circle 4. Instead, the left and right vertical segments of the circle 3 form a set of rules (i.e., the left two vertical segments are the left side of the rule, and the right two vertical segments are the right side of the rule), and the upper and lower horizontal segments of the circle 4 form a set of rules (i.e., the upper horizontal segment is the upper side of the rule, and the lower horizontal segment is the lower side of the rule). Fig. 6 shows a schematic diagram of a result of applying a rule to the word "" in this embodiment, and as shown in fig. 6, four vertical lines on the left and right in the circle 5 form a set of rules, and two horizontal lines on the upper and lower in the circle 6 form a set of rules.
An embodiment of a second aspect of the present invention provides a control system 700 for glyph strokes, and fig. 7 shows a block schematic diagram of the control system 700 for glyph strokes according to an embodiment of the present invention. As shown in fig. 7, a control system 700 for glyph strokes includes: an acquisition unit 72, a dividing unit 74, an adding unit 76, and a control unit 78. The acquiring unit 72 is used for acquiring the inner contour and the outer contour of the font; the dividing unit 74 is used for acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; an adding unit 76, configured to add a preset rule to any two components of horizontal contour line segments and vertical contour line segments that satisfy a second preset rule, so as to obtain all horizontal ruled lines and vertical ruled lines; a control unit 78 for controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The control system 700 of the font stroke provided by the invention comprises an acquisition unit 72 for acquiring the inner and outer outlines of the font, a dividing unit 74 for acquiring horizontal contour line segments and vertical contour line segments by taking the current outer outline and the inner outline contained in the current outer outline as processing objects, and grouping the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, an adding unit 76 for adding preset rules into any two groups of horizontal contour line segments or vertical contour line segments meeting a second preset condition, wherein the adding unit can firstly judge whether any two groups of horizontal contour line segments meet the adding preset rules, then judge whether any two groups of vertical contour line segments meet the adding preset rules, and after finishing whether all contour line segments meet the adding preset rules and adding the contour line segments meeting the preset rules, the control unit 78 controls the rule line segments of the adding rules, the stroke thickness width of the controlled stroke is consistent, the problem that the same horizontal stroke or vertical stroke is uneven and uneven during font display is solved, the display effect of the word stock in a system is better, the time cost of manual verification is reduced, and the working efficiency is improved.
Fig. 8 shows a schematic block diagram of a control system 800 for glyph strokes of another embodiment of the invention. The control system 800 for glyph strokes includes: an acquisition unit 82, a division unit 84, an addition unit 86, a control unit 88, a first judgment unit 90, and a deletion unit 92. The first determining unit 90 specifically includes: a first judging subunit 902 and a second judging subunit 904. The obtaining unit 82 specifically includes: a first acquisition subunit 822, a second acquisition subunit 824. The dividing unit 84 specifically includes: a second judgment unit 842, a first setting unit 844, a second setting unit 846, a filtering unit 848, a merging unit 850, and a sorting unit 852.
The control system 800 for font stroke provided by the invention comprises an obtaining unit 82 for obtaining the inner and outer outlines of the font, a dividing unit 84 for obtaining horizontal contour line segments and vertical contour line segments by taking the current outer outline and the inner outline contained in the current outer outline as processing objects, and grouping the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, an adding unit 86 for adding preset rules to any two groups of horizontal contour line segments or vertical contour line segments meeting a second preset condition, wherein the adding unit can firstly judge whether any two groups of horizontal contour line segments meet the adding preset rules, then judge whether any two groups of vertical contour line segments meet the adding preset rules, and after finishing whether all contour line segments meet the adding preset rules and adding the contour line segments meeting the preset rules, the control unit 88 for controlling the rule line segments of the adding rules, the stroke thickness width of the controlled stroke is consistent, the problem that the same horizontal stroke or vertical stroke is uneven and uneven during font display is solved, the display effect of the word stock in a system is better, the time cost of manual verification is reduced, and the working efficiency is improved.
In the above embodiment, preferably, the method further includes: a first judging unit 90 configured to judge whether there is a horizontal ruled line and/or a vertical ruled line that satisfies a third preset rule; and the deleting unit 92 is used for deleting the horizontal ruled line and/or the vertical ruled line meeting the third preset rule if the judgment result is yes.
In this embodiment, before the horizontal ruled line and/or the vertical ruled line are controlled according to the preset rule, there may be a case where a group of line segments exist in two or more pairs of ruled lines, respectively, which may cause ambiguity in ruled line analysis, and therefore, the first determining unit 90 determines whether there exists a horizontal ruled line and a vertical ruled line that satisfy the third preset rule, and when there exists a horizontal ruled line and a vertical ruled line, the deleting unit 92 deletes the horizontal ruled line and the vertical ruled line, thereby avoiding a problem in font display caused by an irregular ruled line, and ensuring the reasonability of the ruled line.
In any of the above embodiments, preferably, the first determining unit 90 specifically includes: a first judging subunit 902, configured to respectively judge whether a length of an overlapped portion of any pair of horizontal ruled lines or any pair of vertical ruled lines is a longest overlapped portion; a deleting unit 92, configured to delete any pair of horizontal ruled lines or any pair of vertical ruled lines if the determination result is negative; a second judging subunit 904, configured to judge whether the same line segment exists in N pairs of deleted horizontal ruled lines or deleted vertical ruled lines at the same time; the deleting unit 92 is further specifically configured to delete the N-1 pairs of deleted horizontal ruled lines or deleted vertical ruled lines if the determination result is yes; wherein N is an integer greater than 1.
In this embodiment, the first determining unit 90 determines whether there is a process of a horizontal ruled line and/or a vertical ruled line meeting a third preset rule, the first determining subunit 902 determines whether the length of the overlapped portion of any pair of horizontal ruled lines or any pair of vertical ruled lines is the longest overlapped portion, and may first perform a determination on one kind of ruled line and then perform a determination on the other kind of ruled line, for example, first perform a determination on the horizontal ruled line, and after the determination on all the horizontal ruled lines is completed, perform a determination on the vertical ruled line, and when the overlapped portion is not the longest, the deleting unit 92 deletes the pair of ruled lines, that is, the pair of ruled lines with the longest overlapped portion among all the candidate ruled lines is retained. Then, the second determining subunit 904 determines whether there is a rule line that is in more than one pair of rule lines, if so, one pair of rule lines is retained, and the deleting unit 92 deletes the remaining rule lines, thereby avoiding ambiguity in rule line parsing.
In any of the above embodiments, preferably, the obtaining unit 82 specifically includes: a first obtaining subunit 822, configured to obtain a glyph outline according to a glyph loop of the glyph; a second obtaining subunit 824, configured to determine the inner contour and the outer contour according to the contour direction of the glyph contour.
In this embodiment, in the process of acquiring the inner contour and the outer contour of the glyph by the acquiring unit 82, the first acquiring subunit 822 acquires the outline of the glyph according to the loop of the glyph, and the second acquiring subunit 824 distinguishes the inner contour and the outer contour by the contour direction, so that the inner contour and the outer contour of the glyph are acquired, and a basis is provided for subsequent glyph processing.
In any of the above embodiments, preferably, the dividing unit 84 specifically includes: a second judging unit 842 for judging whether any outer contour includes any inner contour; a first setting unit 844, configured to set any one outer contour and all inner contours included therein as one processing object if the determination result is yes; a second setting unit 846, configured to set any outer contour as a processing object if the determination result is negative; a screening unit 848 configured to screen out horizontal contour segments and vertical contour segments by traversing all the processing objects; a merging unit 850 for dividing the horizontal contour line segment on the same straight line and the vertical contour line segment on the same straight line into a horizontal contour line segment of the same composition and a vertical contour line segment of the same composition, respectively; the sorting unit 852 is configured to sort the horizontal contour line segments of all the components in an order from top to bottom, and sort the vertical contour line segments of all the components in an order from left to right.
In this embodiment, the dividing unit 84 obtains a horizontal contour line segment and a vertical contour line segment, and performs a component dividing process on the contour line segments, first, matches the inner contour and the outer contour, the second judging unit 842 judges whether any outer contour includes any inner contour, and when the outer contour includes an inner contour, the first setting unit 844 sets the outer contour and the inner contour included therein as a whole as a processing object; when the outer contour does not include an inner contour, the second setting unit 846 regards itself as a whole and sets the whole as a processing object, the screening unit 848 traverses each outer contour and all contour lines in the inner contour included therein, judges and screens horizontal contour line segments and vertical contour line segments therein, the horizontal contour line segments can be traversed first, then the vertical contour line segments are traversed and stored separately, the merging unit 850 divides the horizontal contour line segments on the same horizontal line into the same group of horizontal contour line segments, the vertical contour line segments on the same horizontal line into the same group of vertical contour line segments, the sorting unit 852 sorts the horizontal line segments of each group in the order from top to bottom, and the vertical line segments of each group in the order from left to right, thereby facilitating the subsequent judgment of the rule lines in the order.
In any of the above embodiments, preferably, if the contour line segment is a horizontal contour line segment, the second preset rule is: the distance between the two groups of horizontal contour line segments is within a first preset range, the two groups of horizontal contour line segments are overlapped in the vertical direction, and the middle area formed by the two groups of horizontal contour line segments is in the font filling area; if the contour line segment is a vertical contour line segment, the second preset rule is as follows: the distance between the two groups of vertical outline line segments is within a first preset range, the two groups of vertical outline line segments are overlapped in the horizontal direction, and the middle area formed by the two groups of vertical outline line segments is in the font filling area.
In this embodiment, when determining whether two groups of horizontal contour line segments satisfy the second predetermined rule to determine whether the two groups of horizontal contour line segments add the predetermined rule, it is specifically determined whether the two groups of horizontal contour line segments satisfy three conditions: the first one is: the distance between the two sets of horizontal contour line segments is less than a first threshold, which may be set as a stroke width threshold; secondly, the following steps: if no coincidence exists, the current group and other groups are continuously judged, otherwise, a single line segment which is not coincident with the opposite side in the two groups of line segments is further deleted, and the number of the line segments of one group is 0 after deletion, and the current group and other groups are continuously judged; thirdly, the method comprises the following steps: the middle area formed by two groups of horizontal contour line segments is in the character pattern filling area, if three conditions are met, rules are added to the pair of contour line segments, if the three conditions are not met, the current group and other groups of line segments are continuously judged, the judgment of whether the middle area formed by two groups of horizontal line segments is in the character pattern filling part is judged, the area is mainly converted into a line, the line is further dispersed into points, and the judgment of whether the points are both in the outer contour and the outer contour is substantially carried out. Whether the two groups of vertical contour line segments meet the second preset rule or not is judged, whether the two groups of horizontal contour line segments meet the second preset rule or not is judged, and therefore the preset rule is added to any two groups of contour line segments meeting the second preset rule, the condition that the preset rule cannot be added is avoided, and the control on the stroke width is guaranteed.
In a third aspect of the present invention, a computer device is provided, and fig. 9 shows a schematic block diagram of a computer device 100 according to an embodiment of the present invention. Wherein the computer device 100 comprises:
a memory 102, a processor 104, and a computer program stored on the memory 102 and executable on the processor 104, the processor 104 when executing the computer program implementing the steps of: acquiring an inner contour and an outer contour of the font; acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; adding preset rules to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and all the vertical ruled lines; and controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
In the computer device 100 provided by the present invention, the processor 104 implements, when executing the computer program: firstly, acquiring the inner contour and the outer contour of a character form, taking the current outer contour and the inner contour contained in the current outer contour as processing objects, acquiring horizontal contour line segments and vertical contour line segments, grouping the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, and adding preset rules to any two groups of horizontal contour line segments or vertical contour line segments which meet a second preset condition, wherein whether any two groups of horizontal contour line segments meet the addition preset rules can be judged firstly, then whether any two groups of vertical contour line segments meet the addition preset rules is judged, after whether all contour line segments meet the addition preset rules and the contour line segments meeting the addition preset rules are completed, the rule line segments of the addition rules are controlled so that the widths of controlled thick and thin strokes are consistent, and the problem that the same horizontal stroke or vertical stroke is uneven when the character form is displayed is solved, the word stock has better display effect in the system, reduces the time cost of manual verification and improves the working efficiency.
An embodiment of the fourth aspect of the present invention provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of: acquiring an inner contour and an outer contour of the font; acquiring a horizontal contour line segment and a vertical contour line segment according to the outer contour and the inner contour contained in the outer contour, and dividing the horizontal contour line segment and the vertical contour line segment into components according to a first preset rule; adding preset rules to the horizontal contour line segments and the vertical contour line segments of any two components meeting the second preset rule to obtain all the horizontal ruled lines and all the vertical ruled lines; and controlling the horizontal ruled line and/or the vertical ruled line according to a preset rule.
The present invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements: firstly, acquiring the inner contour and the outer contour of a character form, taking the current outer contour and the inner contour contained in the current outer contour as processing objects, acquiring horizontal contour line segments and vertical contour line segments, grouping the horizontal contour line segments and the vertical contour line segments according to a first preset rule so as to be convenient for subsequent judgment and determination of rule lines, and adding preset rules to any two groups of horizontal contour line segments or vertical contour line segments which meet a second preset condition, wherein whether any two groups of horizontal contour line segments meet the addition preset rules can be judged firstly, then whether any two groups of vertical contour line segments meet the addition preset rules is judged, after whether all contour line segments meet the addition preset rules and the contour line segments meeting the addition preset rules are completed, the rule line segments of the addition rules are controlled so that the widths of controlled thick and thin strokes are consistent, and the problem that the same horizontal stroke or vertical stroke is uneven when the character form is displayed is solved, the word stock has better display effect in the system, reduces the time cost of manual verification and improves the working efficiency.
In the description herein, the description of the terms "one embodiment," "some embodiments," "specific embodiments," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.