CN110147528B - A kind of control method, control system, computer equipment and computer-readable storage medium of glyph strokes - Google Patents
A kind of control method, control system, computer equipment and computer-readable storage medium of glyph strokes Download PDFInfo
- Publication number
- CN110147528B CN110147528B CN201810149564.XA CN201810149564A CN110147528B CN 110147528 B CN110147528 B CN 110147528B CN 201810149564 A CN201810149564 A CN 201810149564A CN 110147528 B CN110147528 B CN 110147528B
- Authority
- CN
- China
- Prior art keywords
- horizontal
- vertical
- contour
- contour line
- line segment
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 41
- 238000012545 processing Methods 0.000 claims description 41
- 238000004590 computer program Methods 0.000 claims description 17
- 238000012216 screening Methods 0.000 claims description 8
- 238000012163 sequencing technique Methods 0.000 claims 5
- 238000012795 verification Methods 0.000 abstract description 12
- 238000012217 deletion Methods 0.000 description 17
- 230000037430 deletion Effects 0.000 description 17
- 230000000694 effects Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 11
- 244000025254 Cannabis sativa Species 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000000717 retained effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Controls And Circuits For Display Device (AREA)
Abstract
本发明提出了一种字形笔画的控制方法、控制系统、计算机设备和计算机可读存储介质。其中,字形笔画的控制方法包括:获取字形的内轮廓和外轮廓;根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;删除满足第三预设规则的水平规则线和/或竖直规则线;将删除后的水平规则线和/或竖直规则线按照预设规则进行控制。本发明解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。
The present invention provides a control method, control system, computer equipment and computer-readable storage medium for the strokes of a glyph. Wherein, the control method for the strokes of the glyph includes: obtaining the inner contour and the outer contour of the glyph; obtaining the horizontal contour line segment and the vertical contour line segment according to the outer contour and the inner contour contained therein, and performing the control on the horizontal contour line segment and the vertical contour line segment according to the first preset rule. The vertical contour line segment is divided into components; the preset rules are added to any two components of the horizontal contour line segment and the vertical contour line segment that satisfy the second preset rule, so as to obtain all the horizontal and vertical rule lines; The horizontal rule line and/or the vertical rule line of the preset rule; the deleted horizontal rule line and/or the vertical rule line are controlled according to the preset rule. The invention solves the problem of unevenness and unevenness of the same horizontal stroke or vertical stroke when the font is displayed, makes the character library display better in the system, reduces the time cost of manual verification, and improves the work efficiency.
Description
技术领域technical field
本发明涉及文字图形处理技术领域,具体而言,涉及一种字形笔画的控制方法、字形笔画的控制系统、计算机设备、计算机可读存储介质。The present invention relates to the technical field of text and graphics processing, and in particular, to a method for controlling glyph strokes, a control system for glyph strokes, computer equipment, and a computer-readable storage medium.
背景技术Background technique
字库是现代操作系统中必不可少的一部分,辅助各种设备显示字体等等。而一套字库在投入使用前需要经过繁琐的流程,除了前期字体设计师设计字稿和精确绘制每个字形外,还需要使用工具对字库进一步加工和核验,使其在系统中可以很好地显示出来。其中对字库进一步加工的过程,就包含对字体加一些指令,例如控制横竖笔画的粗细一致,调整各个字号下的渲染效果,以及在各个字号下调整字体笔画以达到更好的显示效果等等。Font library is an indispensable part of modern operating systems, assisting various devices to display fonts and so on. Before a font library is put into use, it needs to go through a tedious process. In addition to the font designer designing the font and accurately drawing each glyph in the early stage, it is also necessary to use tools to further process and verify the font library, so that it can be well used in the system. display. 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, and adjusting the font strokes under each font size to achieve a better display effect, etc.
控制横竖笔画粗细一致,是指对横竖笔画添加一定的规则,控制其笔画宽度一致性,使其在系统中显示正确效果。由于该规则主要用于控制笔画粗细宽度一致,因此规则是以成对的形式出现,涉及到该笔画的两侧线段,且每侧至少包含一条线段。对横竖笔画加规则的方法主要用于一些精品字库,常见的如黑体、宋体等等,例如“草”的部首“艹”,如图1所示,圈1中的上下两条横线段与圈2中的上下四条横线段应该属于一组规则,即两个圈中上侧横线段均是该规则的上侧,下侧横线段均是该规则的下侧,从而可以同步控制两个圈中上侧或者下侧横线段的高度,使笔画粗细一致。但是如果两个圈中笔画不属于一组控制(即圈1中上下两条横线段组成一组规则,圈2中上下四条横线段组成一组规则),可能出现圈1与圈2中上侧(或下侧)横笔画在某些显示环境下笔画宽度不一致的情况,从而影响显示效果。而一套中文字库字符量最少的是简体字库,也有6000 多汉字,对于这类问题,人工调整耗时耗力,需要使用工具进行处理和调整判断。Controlling the consistency of the thickness of horizontal and vertical strokes means adding certain rules to the horizontal and vertical strokes to control the consistency of their stroke widths so that they can display the correct effect in the system. Since this rule is mainly used to control the consistency of the thickness and width of the stroke, the rule appears in pairs, involving line segments on both sides of the stroke, and each side contains at least one line segment. The method of adding rules to horizontal and vertical strokes is mainly used in some fine character libraries, such as Hei, Song, etc., for example, the radical "Fuck" of "Grass", as shown in Figure 1, the upper and lower horizontal line segments in circle 1 are the same as The four upper and lower horizontal line segments in circle 2 should belong to a set of rules, that is, the upper horizontal line segment in the two circles is the upper side of the rule, and the lower horizontal line segment is the lower side of the rule, so that the two circles can be controlled synchronously. The height of the horizontal line segment on the upper or lower side, so that the thickness of the strokes is the same. However, if the strokes in the two circles do not belong to a group of controls (that is, two upper and lower horizontal line segments in circle 1 form a set of rules, and four upper and lower horizontal line segments in circle 2 form a group of rules), the upper and lower sides of circle 1 and circle 2 may appear. The width of the horizontal stroke (or the lower side) is inconsistent in some display environments, which affects the display effect. A set of Chinese fonts has the least amount of characters, and there are more than 6,000 Chinese characters. For such problems, manual adjustment is time-consuming and labor-intensive, and tools need to be used for processing and adjustment judgments.
目前常用的工具对大部分字形加横竖笔画规则的效果较好,但是还是存在一些问题,例如规则加粗或者规则加不上等等,使得不好控制其笔画宽度,其中主要是规则加不上的情况,若果规则加不上,就会导致字库在系统显示效果较差,同时也增加了人工核验的时间成本,降低了工作效率。At present, the commonly used tools have a good effect on adding horizontal and vertical stroke rules to most glyphs, but there are still some problems, such as the rules are bolded or the rules cannot be added, etc., which makes it difficult to control the stroke width, mainly because the rules cannot be added. If the rules cannot be added, it will lead to poor display effect of the font library in the system, and it will also increase the time cost of manual verification and reduce work efficiency.
发明内容SUMMARY OF THE INVENTION
本发明旨在至少解决现有技术或相关技术中存在的技术问题之一。The present invention aims to solve at least one of the technical problems existing in the prior art or related technologies.
为此,本发明第一个方面在于提出一种字形笔画的控制方法。To this end, the first aspect of the present invention is to provide a method for controlling the strokes of a glyph.
本发明的第二个方面在于提出一种字形笔画的控制系统。The second aspect of the present invention is to provide a control system for the strokes of characters.
本发明的第三个方面在于提出一种计算机设备。A third aspect of the present invention is to propose a computer device.
本发明的第四个方面在于提出一种计算机可读存储介质。A fourth aspect of the present invention is to provide a computer-readable storage medium.
有鉴于此,根据本发明的一个方面,提出了一种字形笔画的控制方法,包括:获取字形的内轮廓和外轮廓;根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;对水平规则线和/或竖直规则线按照预设规则进行控制。In view of this, according to one aspect of the present invention, a method for controlling the strokes of a glyph is proposed, including: obtaining the inner contour and the outer contour of the glyph; obtaining the horizontal contour line segment and the vertical contour according to the outer contour and the inner contour contained therein line segment, and divide the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule; add preset rules to any two components of the horizontal contour line segment and vertical contour line segment that satisfy the second preset rule to obtain All horizontal rule lines and vertical rule lines; the horizontal rule lines and/or vertical rule lines are controlled according to preset rules.
本发明提供的字形笔画的控制方法,首先获取字形的内外轮廓,以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。The method for controlling the strokes of a glyph provided by the present invention firstly obtains the inner and outer contours of the glyph, takes the current outer contour and the inner contour contained therein as processing objects, obtains horizontal contour line segments and vertical contour line segments, and controls the horizontal contour line segment according to the first preset rule. The contour line segment and the vertical contour line segment are grouped to facilitate subsequent judgment and determination of the rule line, and preset rules are added to any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition, wherein any two can be judged first. Whether the set of horizontal contour line segments satisfies the preset rules for adding, and then judges whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all contour line segments whether they meet the preset rules for adding and adding the contour line segments that meet the preset rules. Afterwards, the ruled line segments added with rules are controlled, so that the thickness and width of the strokes to be controlled are consistent, which solves the problem of unevenness and unevenness of the same horizontal or vertical strokes when the glyph is displayed, and makes the font library display better in the system, reducing manual labor. The time cost of verification has been improved, and the work efficiency has been improved.
根据本发明的上述字形笔画的控制方法,还可以具有以下技术特征:According to the control method of the above-mentioned glyph stroke of the present invention, it 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 the preset rule, the method further includes: judging whether there is a horizontal ruled line and/or a vertical ruled line that satisfies the third preset rule Rule line; if the judgment result is yes, delete the horizontal rule line and/or the vertical rule line that satisfy the third preset rule.
在该技术方案中,在对水平规则线和/或竖直规则线按照预设规则进行控制之前,可能存在一组线段分别存在于两对或多对规则线中等情况,这就会导致规则线解析存在歧义,因此,判断是否存在满足第三预设规则的水平规则线、竖直规则线,当存在时,将其删除,避免了规则线的不规范导致字形显示出现问题,保证了规则线的合理性。In this technical solution, before the horizontal ruled line and/or the vertical ruled line are controlled according to the preset rules, there may be a group of line segments respectively existing in two or more pairs of ruled lines, etc., which will lead to ruled lines There is ambiguity in the parsing. Therefore, it is judged whether there are horizontal rule lines and vertical rule lines that satisfy the third preset rule. If there are, delete them to avoid the irregularity of rule lines and cause font display problems, and ensure rule lines. rationality.
在上述任一技术方案中,优选地,判断是否存在满足第三预设规则的水平规则线和/或竖直规则线的步骤,具体包括:分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分;若判断结果为否,则删除任一对水平规则线或任一对的竖直规则线;判断同一条线段是否同时存在N对删除后的水平规则线或删除后的竖直规则线中;若判断结果为是,则删除N-1对删除后的水平规则线或删除后的竖直规则线;其中,N为大于1 的整数。In any of the above technical solutions, preferably, the step of judging whether there is a horizontal rule line and/or a vertical rule line that satisfies the third preset rule specifically includes: respectively judging any pair of horizontal rule lines or any pair of Whether the length of the overlapping part of the vertical rule line is the longest overlapping part; if the judgment result is no, delete any pair of horizontal rule lines or any pair of vertical rule lines; determine whether there are N pairs of the same line segment at the same time In the deleted horizontal rule line or the deleted vertical rule line; if the judgment result is yes, delete N-1 pairs of the deleted horizontal rule line or the deleted vertical rule line; wherein, N is greater than 1. Integer.
在该技术方案中,判断是否存在满足第三预设规则的水平规则线和/或竖直规则线的过程,分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分,可以先进行一种规则线的判断,再进行另外一种规则线的判断,如先进行水平规则线的判断,在所有水平规则线进行判断完毕之后,进行竖直规则线的判断,当重合部分不是最长的,就将这对规则线删除,即保留所有候选规则线中重合部分最长的那对规则线。然后再判断是否存在同一条规则线是否存在不止一对规则线中,如果存在,保留其中一对规则线,其余的进行删除,避免了规则线解析时存在歧义。In this technical solution, the process of judging whether there is a horizontal ruled line and/or a vertical ruled line that satisfies the third preset rule, and judges the coincidence part of any pair of horizontal ruled lines or any pair of vertical ruled lines respectively. Whether the length is the longest overlapping part, you can first judge one rule line, and then judge another rule line. In the judgment of straight rule lines, when the overlapping part is not the longest, the pair of rule lines is deleted, that is, the pair of rule lines with the longest overlapping part among all the candidate rule lines is retained. Then judge whether the same rule line exists in more than one pair of rule lines. If it exists, keep one pair of rule lines, and delete the rest to avoid ambiguity in rule line parsing.
在上述任一技术方案中,优选地,获取字形的内轮廓和外轮廓的步骤,具体包括:根据字形的字形回路获取字形轮廓;根据字形轮廓的轮廓方向确定内轮廓和外轮廓。In any of the above technical solutions, preferably, the step of acquiring the inner and outer contours of the glyph specifically includes: acquiring the glyph outline according to the glyph circuit of the glyph; and determining the inner and outer contours according to the outline direction of the glyph.
在该技术方案中,获取字形的内轮廓和外轮廓的过程,首先根据字形的字形回路获取字形轮廓,通过轮廓方向区分内轮廓和外轮廓,如此,获得了字形的内外轮廓,为后续字形处理提供基础。In this technical solution, in the process of obtaining the inner and outer contours of the glyph, first obtain the glyph outline according to the glyph circuit of the glyph, and distinguish the inner and outer contours by the outline direction, so that the inner and outer contours of the glyph are obtained, which are processed for the subsequent glyphs Provide the basis.
在上述任一技术方案中,优选地,根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份的步骤,具体包括:判断任一外轮廓是否包含任一内轮廓;若判断结果为是,则将任一外轮廓与其包含的所有内轮廓设置为一个处理对象;若判断结果为否,则将任一外轮廓设置为一个处理对象;遍历所有处理对象,筛选出水平轮廓线段和竖直轮廓线段;分别将同一条直线上的水平轮廓线段和同一条直线上的竖直轮廓线段划分为同一组份的水平轮廓线段和同一组份的竖直轮廓线段;按照从上至下的顺序将所有组份的水平轮廓线段排序,按照从左至右的顺序将所有组份的竖直轮廓线段排序。In any of the above technical solutions, preferably, the horizontal contour line segment and the vertical contour line segment are obtained according to the outer contour and the inner contour contained therein, and the horizontal contour line segment and the vertical contour line segment are divided into components according to the first preset rule The steps specifically include: judging whether any outer contour contains any inner contour; if the judgment result is yes, then any outer contour and all the inner contours it contains are set as a processing object; if the judgment result is no, then the Set any outer contour as a processing object; traverse all processing objects, filter out the horizontal contour line segment and the vertical contour line segment; divide the horizontal contour line segment on the same line and the vertical contour line segment on the same line into the same group respectively The horizontal contour line segments of the same component and the vertical contour line segments of the same component are sorted; the horizontal contour line segments of all components are sorted in the order from top to bottom, and the vertical contour line segments of all components are sorted in the order from left to right.
在该技术方案中,获取水平轮廓线段和竖直轮廓线段,并对轮廓线段进行划分组份的过程,首先,将内外轮廓进行匹配,通过判断任一外轮廓是否包含任一内轮廓,当外轮廓包含内轮廓时,将该外轮廓及其包含的内轮廓中看作一个整体,设置为一个处理对象;当外轮廓不包含内轮廓,则将其本身看作一个整体,设置为一个处理对象,遍历每一个外轮廓及其包含的内轮廓中所有轮廓线,判断并筛选其中的水平轮廓线段和竖直轮廓线段,可以先遍历水平轮廓线段,再遍历竖直轮廓线段,并分开保存,将同一水平线上的水平轮廓线段划分为同一组水平轮廓线段,将同一水平线上的竖直轮廓线段划分为同一组竖直轮廓线段,每组水平线段间按照从上至下的顺序,每组竖直线段间按照从左至右的顺序进行排序,方便后续按照顺序判断规则线。In this technical solution, in the process of obtaining horizontal contour line segments and vertical contour line segments, and dividing the contour line segments into components, first, the inner and outer contours are matched, and by judging whether any outer contour contains any inner contour, when the outer contour is When the contour includes the inner contour, the outer contour and the inner contour it contains are regarded as a whole and set as a processing object; when the outer contour does not contain the inner contour, it is regarded as a whole and is set as a processing object , traverse all the contour lines in each outer contour and the inner contour it contains, judge and filter the horizontal contour line segment and vertical contour line segment, you can traverse the horizontal contour line segment first, then traverse the vertical contour line segment, and save them separately, The horizontal contour line segments on the same horizontal line are divided into the same group of horizontal contour line segments, and the vertical contour line segments on the same horizontal line are divided into the same group of vertical contour line segments. The line segments are sorted in order from left to right, which is convenient for subsequent judgment of rule lines in order.
在上述任一技术方案中,优选地,若轮廓线段为水平轮廓线段,则第二预设规则为:两组水平轮廓线段之间的距离在第一预设范围内,且水平两组轮廓线段在竖直方向存在重合部分,且两组水平轮廓线段所形成的中间区域在字形填充区域内;若轮廓线段为竖直轮廓线段,则第二预设规则为:两组竖直轮廓线段之间的距离在第一预设范围内,且竖直两组轮廓线段在水平方向存在重合部分,且两组竖直轮廓线段所形成的中间区域在字形填充区域内。In any of the above technical solutions, preferably, if the contour line segments are horizontal contour line segments, the second preset rule is: the distance between the two sets of horizontal contour line segments is within the first preset range, and the two sets of horizontal contour line segments are within the first preset range. There are overlapping parts in the vertical direction, and the middle area formed by the two sets of horizontal contour line segments is within the glyph filling area; if the contour line segments are vertical contour line segments, the second preset rule is: between the two sets of vertical contour line segments The distance between the two sets of vertical contour line segments is within the first preset range, and there are overlapping parts in the horizontal direction of the vertical two sets of contour line segments, and the intermediate area formed by the two sets of vertical contour line segments is within the glyph filling area.
在该技术方案中,在判断两组水平轮廓线段是否满足第二预设规则以判断该两组水平轮廓线段是否添加预设规则,具体就是判断该两组水平轮廓线段是否满足三个条件:第一个:两组水平轮廓线段之间的距离在第一预设范围内,第一阈值可设定为笔画宽度阈值;第二个:水平两组轮廓线段在竖直方向存在重合部分,若不存在重合则继续判断当前组与其他组,否则进一步将两组线段中与对侧无重合的单个线段删除,删除后有一组线段数为0,则继续判断当前组与其他组;第三个:两组水平轮廓线段所形成的中间区域在字形填充区域内,如果满足三个条件,则将该对轮廓线段添加规则,如果不满足这三个条件,则继续判断当前组与其他组线段,这里判断两组水平线段所形成的中间区域是否在字形填充部分的判断,主要是将区域转化为线,进而将线离散为点,实质上是判断点是否均在外轮廓内部和内轮廓外部。判断两组竖直轮廓线段是否满足第二预设规则与判断水平轮廓线段是否满足第二预设规则类似,如此,将满足第二预设规则的任两组轮廓线段添加预设规则,避免了预设规则加不上的情况,进而保证了对笔画宽度的控制。In this technical solution, when judging whether the two groups of horizontal contour line segments satisfy the second preset rule to determine whether the two groups of horizontal contour line segments are added with a preset rule, it is specifically to determine whether the two groups of horizontal contour line segments satisfy three conditions: the first One: the distance between the two sets of horizontal contour line segments is within the first preset range, and the first threshold can be set as the stroke width threshold; the second: the two sets of horizontal contour line segments have overlapping parts in the vertical direction. If there is overlap, continue to judge the current group and other groups. Otherwise, further delete the single line segment that does not overlap with the opposite side in the two groups of line segments. After deletion, there is a group of line segments whose number is 0, then continue to judge the current group and other groups; the third: The middle area formed by the two sets of horizontal contour line segments is in the glyph filling area. If three conditions are met, add rules to the pair of contour line segments. If these three conditions are not met, continue to judge the current group and other groups of line segments, here The judgment of whether the middle area formed by the two sets of horizontal line segments is in the filling part of the glyph is mainly to convert the area into a line, and then discretize the line into points. In essence, it is to determine whether the points are both inside the outer contour and outside the inner contour. Determining whether two sets of vertical contour line segments satisfy the second preset rule is similar to judging whether the horizontal contour line segments satisfy the second preset rule. In this way, adding preset rules to any two groups of contour line segments that satisfy the second preset rule avoids The preset rules cannot be added, thereby ensuring the control of the stroke width.
根据本发明的第二个方面,提出了一种字形笔画的控制系统,包括:获取单元,用于获取字形的内轮廓和外轮廓;划分单元,用于根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;添加单元,用于将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;控制单元,用于将水平规则线和/或竖直规则线按照预设规则进行控制。According to a second aspect of the present invention, a control system for glyph strokes is proposed, comprising: an acquisition unit for acquiring the inner contour and outer contour of the glyph; a dividing unit for, according to the outer contour and the inner contour contained therein, Obtain the horizontal contour line segment and the vertical contour line segment, and divide the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule; add a unit for combining any two components of the horizontal contour line meeting the second preset rule. Preset rules are added to line segments and vertical contour line segments to obtain all horizontal and vertical ruled lines; a control unit is used to control the horizontal and/or vertical ruled lines according to the preset rules.
本发明提供的字形笔画的控制系统,首先获取单元获取字形的内外轮廓,划分单元以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,添加单元将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,控制单元对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。The control system for the strokes of a glyph provided by the present invention firstly obtains the inner and outer contours of the glyph by an acquisition unit, and the dividing unit takes the current outer contour and the inner contour contained therein as the processing object, obtains the horizontal contour line segment and the vertical contour line segment, and executes them according to the first preset Set a rule to group horizontal contour line segments and vertical contour line segments, so as to facilitate subsequent judgment and determination of rule lines, and the adding unit adds preset rules to any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition, wherein, You can first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all the contour line segments whether they meet the preset rules for adding and will meet the preset rules. After the rule is added to the regular contour line segment, the control unit controls the added rule rule line segment, so that the thickness and width of the controlled strokes are consistent, which solves the problem of unevenness and unevenness of the same horizontal stroke or vertical stroke when the glyph is displayed, so that the font library can be stored in the system. The display effect is better, the time cost of manual verification is reduced, and the work efficiency is improved.
根据本发明的上述字形笔画的控制系统,还可以具有以下技术特征:According to the control system of the above-mentioned glyph stroke of the present invention, it can also have the following technical features:
在上述技术方案中,优选地,还包括:第一判断单元,用于判断是否存在满足第三预设规则的水平规则线和/或竖直规则线;删除单元,用于若判断结果为是,则将满足第三预设规则的水平规则线和/或竖直规则线删除。In the above technical solution, preferably, it further includes: a first judging unit for judging whether there is a horizontal ruled line and/or a vertical ruled line that satisfies the third preset rule; a deletion unit for judging if the result is yes , the horizontal rule lines and/or vertical rule lines that satisfy the third preset rule are deleted.
在该技术方案中,在对水平规则线和/或竖直规则线按照预设规则进行控制之前,可能存在一组线段分别存在于两对或多对规则线中等情况,这就会导致规则线解析存在歧义,因此,第一判断单元判断是否存在满足第三预设规则的水平规则线、竖直规则线,当存在时,删除单元将其删除,避免了规则线的不规范导致字形显示出现问题,保证了规则线的合理性。In this technical solution, before the horizontal ruled line and/or the vertical ruled line are controlled according to the preset rules, there may be a group of line segments respectively existing in two or more pairs of ruled lines, etc., which will lead to ruled lines There is ambiguity in the analysis. Therefore, the first judgment unit judges whether there are horizontal rule lines and vertical rule lines that meet the third preset rule. If there are, the deletion unit deletes them to avoid the irregularity of rule lines. The problem ensures the rationality of the rule line.
在上述任一技术方案中,优选地,第一判断单元具体包括:第一判断子单元,用于分别判断任一对水平规则线或任一对竖直规则线的重合部分的长度是否为最长的重合部分;删除单元,具体用于若判断结果为否,则删除任一对水平规则线或任一对的竖直规则线;第二判断子单元,用于判断同一条线段是否同时存在N对删除后的水平规则线或删除后的竖直规则线中;删除单元,具体还用于若判断结果为是,则删除N-1对删除后的水平规则线或删除后的竖直规则线;其中,N为大于1的整数。In any of the above technical solutions, preferably, the first judging unit specifically includes: a first judging sub-unit for judging whether the length of the overlapping portion of any pair of horizontal ruled lines or any pair of vertical ruled lines is the maximum length. The long overlapping part; the deletion unit, which is specifically used to delete any pair of horizontal ruled lines or any pair of vertical ruled lines if the judgment result is no; the second judgment subunit is used to judge whether the same line segment exists at the same time In N pairs of deleted horizontal rule lines or deleted vertical rule lines; delete unit, specifically, if the judgment result is yes, delete N-1 pairs of deleted horizontal rule lines or deleted vertical rule lines line; where N is an integer greater than 1.
在该技术方案中,第一判断单元判断是否存在满足第三预设规则的水平规则线和/或竖直规则线的过程,第一判断子单元分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分,可以先进行一种规则线的判断,再进行另外一种规则线的判断,如先进行水平规则线的判断,在所有水平规则线进行判断完毕之后,进行竖直规则线的判断,当重合部分不是最长的,删除单元就将这对规则线删除,即保留所有候选规则线中重合部分最长的那对规则线。然后第二判断子单元判断是否存在同一条规则线是否存在不止一对规则线中,如果存在,保留其中一对规则线,删除单元将其余的规则线进行删除,避免了规则线解析时存在歧义。In this technical solution, the first judgment unit judges whether there is a process of horizontal rule lines and/or vertical rule lines that satisfy the third preset rule, and the first judgment subunit judges any pair of horizontal rule lines or any pair of Whether the length of the overlapping part of the vertical rule line is the longest overlapping part, you can first judge one rule line, and then judge another rule line. For example, first judge the horizontal rule line. After the rule line is judged, the vertical rule line is judged. When the overlapping part is not the longest, the deletion unit deletes the pair of rule lines, that is, retains the pair of rule lines with the longest overlapping part among all the candidate rule lines. Then the second judging subunit judges whether the same rule line exists in more than one pair of rule lines, if so, keep one pair of rule lines, and the deletion unit deletes the rest of the rule lines to avoid ambiguity in rule line parsing .
在上述任一技术方案中,优选地,获取单元具体包括:第一获取子单元,用于根据字形的字形回路获取字形轮廓;第二获取子单元,用于根据字形轮廓的轮廓方向确定内轮廓和外轮廓。In any of the above technical solutions, preferably, the obtaining unit specifically includes: a first obtaining subunit, used for obtaining the outline of the glyph according to the glyph circuit of the glyph; and a second obtaining subunit, used for determining the inner contour according to the outline direction of the outline of the glyph and outer contour.
在该技术方案中,获取单元获取字形的内轮廓和外轮廓的过程,首先第一获取子单元根据字形的字形回路获取字形轮廓,第二获取子单元通过轮廓方向区分内轮廓和外轮廓,如此,获得了字形的内外轮廓,为后续字形处理提供基础。In this technical solution, the acquisition unit acquires the inner contour and outer contour of the glyph, firstly, the first acquisition subunit acquires the glyph outline according to the glyph loop of the glyph, and the second acquisition subunit distinguishes the inner contour and the outer contour by the contour direction, so , the inner and outer contours of the glyph are obtained, which provides the basis for the subsequent glyph processing.
在上述任一技术方案中,优选地,划分单元具体包括:第二判断单元,用于判断任一外轮廓是否包含任一内轮廓;第一设置单元,用于若判断结果为是,则将任一外轮廓与其包含的所有内轮廓设置为一个处理对象;第二设置单元,用于若判断结果为否,则将任一外轮廓设置为一个处理对象;筛选单元,用于遍历所有处理对象,筛选出水平轮廓线段和竖直轮廓线段;合并单元,用于分别将同一条直线上的水平轮廓线段和同一条直线上的竖直轮廓线段划分为同一组份的水平轮廓线段和同一组份的竖直轮廓线段;排序单元,用于按照从上至下的顺序将所有组份的水平轮廓线段排序,按照从左至右的顺序将所有组份的竖直轮廓线段排序。In any of the above technical solutions, preferably, the dividing unit specifically includes: a second judging unit for judging whether any outer contour includes any inner contour; a first setting unit for setting the Any outer contour and all inner contours it contains are set as a processing object; the second setting unit is used to set any outer contour as a processing object if the judgment result is no; the screening unit is used to traverse all processing objects , screen out the horizontal contour line segment and the vertical contour line segment; the merging unit is used to divide the horizontal contour line segment on the same line and the vertical contour line segment on the same line into the horizontal contour line segment of the same component and the same component respectively. The vertical contour line segment of ; the sorting unit is used to sort the horizontal contour line segments of all components in the order from top to bottom, and sort the vertical contour line segments of all components in the order from left to right.
在该技术方案中,划分单元获取水平轮廓线段和竖直轮廓线段,并对轮廓线段进行划分组份的过程,首先,将内外轮廓进行匹配,第二判断单元通过判断任一外轮廓是否包含任一内轮廓,当外轮廓包含内轮廓时,第一设置单元将该外轮廓及其包含的内轮廓中看作一个整体,设置为一个处理对象;当外轮廓不包含内轮廓,第二设置单元则将其本身看作一个整体,设置为一个处理对象,筛选单元遍历每一个外轮廓及其包含的内轮廓中所有轮廓线,判断并筛选中水平轮廓线段和竖直轮廓线段,可以先遍历水平轮廓线段,再进行遍历竖直轮廓线段,并分开保存,合并单元将同一水平线上的水平轮廓线段划分为同一组水平轮廓线段,将同一水平线上的竖直轮廓线段划分为同一组竖直轮廓线段,排序单元将每组水平线段间按照从上至下的顺序,每组竖直线段间按照从左至右的顺序进行排序,方便后续按照顺序判断规则线。In this technical solution, the dividing unit obtains horizontal contour line segments and vertical contour line segments, and divides the contour line segments into components. First, the inner and outer contours are matched, and the second judgment unit judges whether any outer contour contains any An inner contour, when the outer contour contains the inner contour, the first setting unit regards the outer contour and the inner contour it contains as a whole, and sets it as a processing object; when the outer contour does not contain the inner contour, the second setting unit Then regard itself as a whole and set it as a processing object. The screening unit traverses all the contour lines in each outer contour and the inner contour it contains, and judges and filters the horizontal and vertical contour segments. You can traverse the horizontal contour first. Contour line segments, then traverse the vertical contour line segments and save them separately. The merging unit divides the horizontal contour line segments on the same horizontal line into the same group of horizontal contour line segments, and divides the vertical contour line segments on the same horizontal line into the same group of vertical contour line segments , the sorting unit sorts each group of horizontal line segments in a top-to-bottom order, and each group of vertical line segments in a left-to-right order, so as to facilitate subsequent judgment of rule lines in order.
在上述任一技术方案中,优选地,若轮廓线段为水平轮廓线段,则第二预设规则为:两组水平轮廓线段之间的距离在第一预设范围内,且水平两组轮廓线段在竖直方向存在重合部分,且两组水平轮廓线段所形成的中间区域在字形填充区域内;若轮廓线段为竖直轮廓线段,则第二预设规则为:两组竖直轮廓线段之间的距离在第一预设范围内,且竖直两组轮廓线段在水平方向存在重合部分,且两组竖直轮廓线段所形成的中间区域在字形填充区域内。In any of the above technical solutions, preferably, if the contour line segments are horizontal contour line segments, the second preset rule is: the distance between the two sets of horizontal contour line segments is within the first preset range, and the two sets of horizontal contour line segments are within the first preset range. There are overlapping parts in the vertical direction, and the middle area formed by the two sets of horizontal contour line segments is within the glyph filling area; if the contour line segments are vertical contour line segments, the second preset rule is: between the two sets of vertical contour line segments The distance between the two sets of vertical contour line segments is within the first preset range, and there are overlapping parts in the horizontal direction of the vertical two sets of contour line segments, and the intermediate area formed by the two sets of vertical contour line segments is within the glyph filling area.
在该技术方案中,在判断两组水平轮廓线段是否满足第二预设规则以判断该两组水平轮廓线段是否添加预设规则,具体就是判断该两组水平轮廓线段是否满足三个条件:第一个:两组水平轮廓线段之间的距离小于第一阈值,第一阈值可设定为笔画宽度阈值;第二个:水平两组轮廓线段在竖直方向存在重合部分,若不存在重合则继续判断当前组与其他组,否则进一步将两组线段中与对侧无重合的单个线段删除,删除后有一组线段数为0,则继续判断当前组与其他组;第三个:两组水平轮廓线段所形成的中间区域在字形填充区域内,如果满足三个条件,则将该对轮廓线段添加规则,如果不满足这三个条件,则继续判断当前组与其他组线段,这里判断两组水平线段所形成的中间区域是否在字形填充部分的判断,主要是将区域转化为线,进而将线离散为点,实质上是判断点是否均在外轮廓内部和内轮廓外部。判断两组竖直轮廓线段是否满足第二预设规则与判断水平轮廓线段是否满足第二预设规则类似,如此,将满足第二预设规则的任两组轮廓线段添加预设规则,避免了预设规则加不上的情况,进而保证了对笔画宽度的控制。In this technical solution, when judging whether the two groups of horizontal contour line segments satisfy the second preset rule to determine whether the two groups of horizontal contour line segments are added with a preset rule, it is specifically to determine whether the two groups of horizontal contour line segments satisfy three conditions: the first One: the distance between the two sets of horizontal contour line segments is less than the first threshold, and the first threshold can be set as the stroke width threshold; the second: the two sets of horizontal contour line segments have overlapping parts in the vertical direction. Continue to judge the current group and other groups, otherwise, further delete the single line segment that does not overlap with the opposite side in the two groups of line segments. After deletion, there is a group of line segments with a number of 0, then continue to judge the current group and other groups; the third: the level of the two groups The middle area formed by the contour line segment is in the glyph filled area. If three conditions are met, add rules to the pair of contour line segments. If these three conditions are not met, continue to judge the current group and other groups of line segments. Here, two groups are judged. The judgment of whether the middle area formed by the horizontal line segment is in the filled part of the glyph is mainly to convert the area into a line, and then discretize the line into points. In essence, it is to judge whether the points are both inside the outer contour and outside the inner contour. Determining whether two sets of vertical contour line segments satisfy the second preset rule is similar to judging whether the horizontal contour line segments satisfy the second preset rule. In this way, adding preset rules to any two groups of contour line segments that satisfy the second preset rule avoids The preset rules cannot be added, thereby ensuring the control of the stroke width.
根据本发明的第三个方面,本发明提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行计算机程序时实现以下步骤:获取字形的内轮廓和外轮廓;根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;对水平规则线和/或竖直规则线按照预设规则进行控制。According to a third aspect of the present invention, the present invention provides a computer device, comprising a memory, a processor and a computer program stored in the memory and running on the processor, the processor implements the following steps when executing the computer program: obtaining The inner contour and outer contour of the glyph; obtain the horizontal contour line segment and the vertical contour line segment according to the outer contour and the inner contour it contains, and divide the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule; will satisfy the Add a preset rule to the horizontal contour line segment and vertical contour line segment of any two components of the second preset rule, so as to obtain all horizontal rule lines and vertical rule lines; rules to control.
本发明提供的一种计算机设备,处理器执行计算机程序时实现:首先获取字形的内外轮廓,以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。In the computer equipment provided by the present invention, when the processor executes the computer program, it realizes: firstly obtain the inner and outer contours of the glyph, take the current outer contour and the inner contour contained therein as the processing object, obtain the horizontal contour line segment and the vertical contour line segment, and follow the steps The first preset rule groups horizontal contour line segments and vertical contour line segments to facilitate subsequent judgment and determination of rule lines, and adds preset rules to any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition, wherein , you can first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all the contour line segments whether they meet the preset rules for adding and will meet the preset rules. After setting the rule contour line segment and adding the rule, control the rule line segment adding the rule, so that the thickness and width of the strokes to be controlled are consistent, which solves the problem of uneven horizontal strokes or vertical strokes when the glyph is displayed, so that the font library can be displayed in the system. The effect is better, the time cost of manual verification is reduced, and the work efficiency is improved.
根据本发明的第四个方面,本发明提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:获取字形的内轮廓和外轮廓;根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;对水平规则线和/或竖直规则线按照预设规则进行控制。According to a fourth aspect of the present invention, the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: acquiring the inner and outer contours of the glyph; The contour and the inner contour it contains, obtain the horizontal contour line segment and the vertical contour line segment, and divide the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule; any two components that satisfy the second preset rule will be Add preset rules to the horizontal and vertical contour line segments of , to obtain all horizontal and vertical rule lines; control the horizontal and/or vertical rule lines according to the preset rules.
本发明提供的一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现:首先获取字形的内外轮廓,以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。A computer-readable storage medium provided by the present invention stores a computer program thereon, and the computer program is implemented when executed by a processor: firstly obtain the inner and outer contours of the glyph, take the current outer contour and the inner contour contained therein as the processing object, and obtain the Horizontal contour line segments and vertical contour line segments, and group the horizontal contour line segments and vertical contour line segments according to the first preset rule, so as to facilitate subsequent judgment and determination of rule lines, and any two groups of horizontal contour line segments that satisfy the second preset condition are grouped. Or adding preset rules for vertical contour line segments, in which, it is possible to first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all contours Whether the line segment satisfies the adding preset rules and after adding the contour line segment satisfying the preset rule, the rule line segment of the added rule is controlled, so that the thickness and width of the controlled strokes are consistent, which solves the problem that the same horizontal or vertical strokes are not displayed when the glyph is displayed. The problem of leveling and unevenness makes the font library display better in the system, reduces the time cost of manual verification, and improves work efficiency.
本发明的附加方面和优点将在下面的描述部分中变得明显,或通过本发明的实践了解到。Additional aspects and advantages of the present invention will become apparent in the description section that follows, or will be learned by practice of the present invention.
附图说明Description of drawings
本发明的上述和/或附加的方面和优点从结合下面附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of embodiments taken in conjunction with the accompanying drawings, wherein:
图1示出了为“草”字加规则的示意图;Fig. 1 shows the schematic diagram of adding rules for the word "grass";
图2示出了本发明的一个实施例的字形笔画的控制方法的流程示意图;2 shows a schematic flowchart of a control method for a glyph stroke according to an embodiment of the present invention;
图3示出了本发明的另一个实施例的字形笔画的控制方法的流程示意图;Fig. 3 shows the schematic flow chart of the control method of the glyph stroke of another embodiment of the present invention;
图4示出了本发明的一个具体实施例的字形笔画的控制方法的流程示意图;4 shows a schematic flowchart of a method for controlling a glyph stroke according to a specific embodiment of the present invention;
图5示出了当前工具对“傭”字加规则的结果示意图;Fig. 5 shows the result schematic diagram that current tool adds rule to " commission " word;
图6示出了本发明的一个具体实施例的对“傭”字加规则的结果示意图;6 shows a schematic diagram of the result of adding a rule to the word "commission" according to a specific embodiment of the present invention;
图7示出了本发明的一个实施例的字形笔画的控制系统的示意框图;Fig. 7 shows the schematic block diagram of the control system of the glyph stroke of an embodiment of the present invention;
图8示出了本发明的另一个实施例的字形笔画的控制系统的示意框图;Fig. 8 shows the schematic block diagram of the control system of the glyph stroke of another embodiment of the present invention;
图9示出了本发明的一个实施例的计算机设备的示意框图。FIG. 9 shows a schematic block diagram of a computer device according to an embodiment of the present invention.
具体实施方式Detailed ways
为了能够更清楚地理解本发明的上述方面、特征和优点,下面结合附图和具体实施方式对本发明进行进一步的详细描述。需要说明的是,在不冲突的情况下,本申请的实施例及实施例中的特征可以相互组合。In order to understand the above aspects, features and advantages of the present invention more clearly, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments may be combined with each other in the case of no conflict.
在下面的描述中阐述了很多具体细节以便于充分理解本发明,但是,本发明还可以采用其他不同于在此描述的其他方式来实施,因此,本发明的保护范围并不限于下面公开的具体实施例的限制。Many specific details are set forth in the following description to facilitate a full understanding of the present invention. However, the present invention can also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific details disclosed below. Example limitations.
本发明第一方面的实施例,提出一种字形笔画的控制方法,图2示出了本发明的一个实施例的字形笔画的控制方法的流程示意图:The embodiment of the first aspect of the present invention proposes a control method for a glyph stroke, and FIG. 2 shows a schematic flowchart of the control method for a glyph stroke according to an embodiment of the present invention:
步骤202,获取字形的内轮廓和外轮廓;
步骤204,根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;Step 204, obtaining the horizontal contour line segment and the 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 the first preset rule;
步骤206,将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;Step 206, adding a preset rule to the horizontal contour line segment and the vertical contour line segment of any two components that satisfy the second preset rule, to obtain all horizontal regular lines and vertical regular lines;
步骤208,对水平规则线和/或竖直规则线按照预设规则进行控制。Step 208: Control the horizontal ruled line and/or the vertical ruled line according to preset rules.
本发明提供的字形笔画的控制方法,首先获取字形的内外轮廓,以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。The method for controlling the strokes of a glyph provided by the present invention firstly obtains the inner and outer contours of the glyph, takes the current outer contour and the inner contour contained therein as processing objects, obtains horizontal contour line segments and vertical contour line segments, and controls the horizontal contour line segment according to the first preset rule. The contour line segment and the vertical contour line segment are grouped to facilitate subsequent judgment and determination of the rule line, and preset rules are added to any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition, wherein any two can be judged first. Whether the set of horizontal contour line segments satisfies the preset rules for adding, and then judges whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all contour line segments whether they meet the preset rules for adding and adding the contour line segments that meet the preset rules. Afterwards, the ruled line segments added with rules are controlled, so that the thickness and width of the strokes to be controlled are consistent, which solves the problem of unevenness and unevenness of the same horizontal or vertical strokes when the glyph is displayed, and makes the font library display better in the system, reducing manual labor. The time cost of verification has been improved, and the work efficiency has been improved.
图3示出了本发明的另一个实施例的字形笔画的控制方法的流程示意图。其中,该方法包括:FIG. 3 shows a schematic flowchart of a method for controlling a glyph stroke according to another embodiment of the present invention. Among them, the method includes:
步骤302,根据字形的字形回路获取字形轮廓;
步骤304,根据字形轮廓的轮廓方向确定内轮廓和外轮廓;
步骤306,根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;Step 306, according to the outer contour and the inner contour contained therein, obtain the horizontal contour line segment and the vertical contour line segment, and divide the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule;
步骤308,将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;
步骤310,判断是否存在满足第三预设规则的水平规则线和/或竖直规则线,若是,则进入步骤312,若否,则进入步骤314;
步骤312,将满足第三预设规则的水平规则线和/或竖直规则线删除;
步骤314,对水平规则线和/或竖直规则线按照预设规则进行控制。Step 314: Control the horizontal ruled line and/or the vertical ruled line according to preset rules.
在上述实施例中,在将水平规则线和/或竖直规则线按照预设规则进行控制之前,还包括:判断是否存在满足第三预设规则的水平规则线和/或竖直规则线;若判断结果为是,则将满足第三预设规则的水平规则线和/或竖直规则线删除。In the above embodiment, before controlling the horizontal ruled line and/or the vertical ruled line according to the preset rule, the method further includes: judging whether there is a horizontal ruled line and/or a vertical ruled line that satisfies the third preset rule; If the determination result is yes, the horizontal rule line and/or the vertical rule line that satisfy the third preset rule are deleted.
在该实施例中,在对水平规则线和/或竖直规则线按照预设规则进行控制之前,可能存在一组线段分别存在于两对或多对规则线中等情况,这就会导致规则线解析存在歧义,因此,判断是否存在满足第三预设规则的水平规则线、竖直规则线,当存在时,将其删除,避免了规则线的不规范导致字形显示出现问题,保证了规则线的合理性。In this embodiment, before the horizontal ruled line and/or the vertical ruled line are controlled according to the preset rules, there may be a group of line segments respectively existing in two or more pairs of ruled lines, etc., which will lead to ruled lines There is ambiguity in the parsing. Therefore, it is judged whether there are horizontal rule lines and vertical rule lines that satisfy the third preset rule. If there are, delete them to avoid the irregularity of rule lines and cause font display problems, and ensure rule lines. rationality.
在上述实施例中,优选地,获取字形的内轮廓和外轮廓的步骤,具体包括:根据字形的字形回路获取字形轮廓;根据字形轮廓的轮廓方向确定内轮廓和外轮廓。In the above embodiment, preferably, the step of obtaining the inner and outer contours of the glyph specifically includes: obtaining the glyph outline according to the glyph circuit of the glyph; and determining the inner and outer contours according to the outline direction of the glyph.
在该实施例中,获取字形的内轮廓和外轮廓的过程,首先根据字形的字形回路获取字形轮廓,通过轮廓方向区分内轮廓和外轮廓,如此,获得了字形的内外轮廓,为后续字形处理提供基础。In this embodiment, the process of obtaining the inner and outer contours of a glyph, first obtain the glyph outline according to the glyph circuit of the glyph, and distinguish the inner and outer contours by the outline direction, so that the inner and outer contours of the glyph are obtained, which are processed for the subsequent glyphs Provide the basis.
在上述任一实施例中,判断是否存在满足第三预设规则的水平规则线和/ 或竖直规则线的步骤,具体包括:分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分;若判断结果为否,则删除任一对水平规则线或任一对的竖直规则线;判断同一条线段是否同时存在N对删除后的水平规则线或删除后的竖直规则线中;若判断结果为是,则删除N-1 对删除后的水平规则线或删除后的竖直规则线;其中,N为大于1的整数。In any of the above-mentioned embodiments, the step of judging whether there is a horizontal rule line and/or a vertical rule line that satisfies the third preset rule specifically includes: respectively judging any pair of horizontal rule lines or any pair of vertical rule lines. Whether the length of the overlapping part of the line is the longest overlapping part; if the judgment result is no, delete any pair of horizontal rule lines or any pair of vertical rule lines; judge whether there are N pairs of deleted lines in the same line segment. In the horizontal rule line or the deleted vertical rule line; if the judgment result is yes, delete N-1 pairs of the deleted horizontal rule line or the deleted vertical rule line; wherein, N is an integer greater than 1.
在该实施例中,判断是否存在满足第三预设规则的水平规则线和/或竖直规则线的过程,分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分,可以先进行一种规则线的判断,再进行另外一种规则线的判断,如先进行水平规则线的判断,在所有水平规则线进行判断完毕之后,进行竖直规则线的判断,当重合部分不是最长的,就将这对规则线删除,即保留所有候选规则线中重合部分最长的那对规则线。然后再判断是否存在同一条规则线是否存在不止一对规则线中,如果存在,保留其中一对规则线,其余的进行删除,避免了规则线解析时存在歧义。In this embodiment, the process of judging whether there is a horizontal ruled line and/or a vertical ruled line that satisfies the third preset rule, and judges the coincidence part of any pair of horizontal ruled lines or any pair of vertical ruled lines respectively. Whether the length is the longest overlapping part, you can first judge one rule line, and then judge another rule line. In the judgment of straight rule lines, when the overlapping part is not the longest, the pair of rule lines is deleted, that is, the pair of rule lines with the longest overlapping part among all the candidate rule lines is retained. Then judge whether the same rule line exists in more than one pair of rule lines. If it exists, keep one pair of rule lines, and delete the rest to avoid ambiguity in rule line parsing.
在上述任一实施例中,优选地,根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份的步骤,具体包括:判断任一外轮廓是否包含任一内轮廓;若判断结果为是,则将任一外轮廓与其包含的所有内轮廓设置为一个处理对象;若判断结果为否,则将任一外轮廓设置为一个处理对象;遍历所有处理对象,筛选出水平轮廓线段和竖直轮廓线段;分别将同一条直线上的水平轮廓线段和同一条直线上的竖直轮廓线段划分为同一组份的水平轮廓线段和同一组份的竖直轮廓线段;按照从上至下的顺序将所有组份的水平轮廓线段排序,按照从左至右的顺序将所有组份的竖直轮廓线段排序。In any of the above embodiments, preferably, the horizontal contour line segment and the vertical contour line segment are obtained according to the outer contour and the inner contour contained therein, and the horizontal contour line segment and the vertical contour line segment are divided into components according to the first preset rule The steps specifically include: judging whether any outer contour contains any inner contour; if the judgment result is yes, then any outer contour and all the inner contours it contains are set as a processing object; if the judgment result is no, then the Set any outer contour as a processing object; traverse all processing objects, filter out the horizontal contour line segment and the vertical contour line segment; divide the horizontal contour line segment on the same line and the vertical contour line segment on the same line into the same group respectively The horizontal contour line segments of the same component and the vertical contour line segments of the same component are sorted; the horizontal contour line segments of all components are sorted in the order from top to bottom, and the vertical contour line segments of all components are sorted in the order from left to right.
在该实施例中,获取水平轮廓线段和竖直轮廓线段,并对轮廓线段进行划分组份的过程,首先,将内外轮廓进行匹配,通过判断任一外轮廓是否包含任一内轮廓,当外轮廓包含内轮廓时,将该外轮廓及其包含的内轮廓中看作一个整体,设置为一个处理对象;当外轮廓不包含内轮廓,则将其本身看作一个整体,设置为一个处理对象,遍历每一个外轮廓及其包含的内轮廓中所有轮廓线,判断并筛选其中的水平轮廓线段和竖直轮廓线段,可以先遍历水平轮廓线段,再遍历竖直轮廓线段,并分开保存,将同一水平线上的水平轮廓线段划分为同一组水平轮廓线段,将同一水平线上的竖直轮廓线段划分为同一组竖直轮廓线段,每组水平线段间按照从上至下的顺序,每组竖直线段间按照从左至右的顺序进行排序,方便后续按照顺序判断规则线。In this embodiment, in the process of obtaining horizontal contour line segments and vertical contour line segments, and dividing the contour line segments into components, first, the inner and outer contours are matched, and by judging whether any outer contour contains any inner contour, when the outer contour is When the contour includes the inner contour, the outer contour and the inner contour it contains are regarded as a whole and set as a processing object; when the outer contour does not contain the inner contour, it is regarded as a whole and is set as a processing object , traverse all the contour lines in each outer contour and the inner contour it contains, judge and filter the horizontal contour line segment and vertical contour line segment, you can traverse the horizontal contour line segment first, then traverse the vertical contour line segment, and save them separately, The horizontal contour line segments on the same horizontal line are divided into the same group of horizontal contour line segments, and the vertical contour line segments on the same horizontal line are divided into the same group of vertical contour line segments. The line segments are sorted in order from left to right, which is convenient for subsequent judgment of rule lines in order.
在上述任一实施例中,优选地,若轮廓线段为水平轮廓线段,则第二预设规则为:两组水平轮廓线段之间的距离小于第一阈值,且水平两组轮廓线段在竖直方向存在重合部分,且两组水平轮廓线段所形成的中间区域在字形填充区域内;若轮廓线段为竖直轮廓线段,则第二预设规则为:两组竖直轮廓线段之间的距离小于第一阈值,且竖直两组轮廓线段在水平方向存在重合部分,且两组竖直轮廓线段所形成的中间区域在字形填充区域内。In any of the above embodiments, preferably, if the contour line segments are horizontal contour line segments, the second preset rule is: the distance between the two groups of horizontal contour line segments is less than the first threshold, and the two groups of horizontal contour line segments are vertical There are overlapping parts in the directions, and the middle area formed by the two sets of horizontal contour line segments is within the glyph filling area; if the contour line segments are vertical contour line segments, the second preset rule is: the distance between the two sets of vertical contour line segments is less than The first threshold value, and the vertical two sets of contour line segments have overlapping parts in the horizontal direction, and the intermediate area formed by the two sets of vertical contour line segments is within the glyph filling area.
在该实施例中,在判断两组水平轮廓线段是否满足第二预设规则以判断该两组水平轮廓线段是否添加预设规则,具体就是判断该两组水平轮廓线段是否满足三个条件:第一个:两组水平轮廓线段之间的距离在第一预设范围内,第一阈值可设定为笔画宽度阈值;第二个:水平两组轮廓线段在竖直方向存在重合部分,若不存在重合则继续判断当前组与其他组,否则进一步将两组线段中与对侧无重合的单个线段删除,删除后有一组线段数为0,则继续判断当前组与其他组;第三个:两组水平轮廓线段所形成的中间区域在字形填充区域内,如果满足三个条件,则将该对轮廓线段添加规则,如果不满足这三个条件,则继续判断当前组与其他组线段,这里判断两组水平线段所形成的中间区域是否在字形填充部分的判断,主要是将区域转化为线,进而将线离散为点,实质上是判断点是否均在外轮廓内部和内轮廓外部。判断两组竖直轮廓线段是否满足第二预设规则与判断水平轮廓线段是否满足第二预设规则类似,如此,将满足第二预设规则的任两组轮廓线段添加预设规则,避免了预设规则加不上的情况,进而保证了对笔画宽度的控制。In this embodiment, when judging whether the two groups of horizontal contour line segments satisfy the second preset rule to determine whether the two groups of horizontal contour line segments are added with a preset rule, it is specifically to determine whether the two groups of horizontal contour line segments satisfy three conditions: the first One: the distance between the two sets of horizontal contour line segments is within the first preset range, and the first threshold can be set as the stroke width threshold; the second: the two sets of horizontal contour line segments have overlapping parts in the vertical direction. If there is overlap, continue to judge the current group and other groups. Otherwise, further delete the single line segment that does not overlap with the opposite side in the two groups of line segments. After deletion, there is a group of line segments whose number is 0, then continue to judge the current group and other groups; the third: The middle area formed by the two sets of horizontal contour line segments is in the glyph filling area. If three conditions are met, add rules to the pair of contour line segments. If these three conditions are not met, continue to judge the current group and other groups of line segments, here The judgment of whether the middle area formed by the two sets of horizontal line segments is in the filling part of the glyph is mainly to convert the area into a line, and then discretize the line into points. In essence, it is to determine whether the points are both inside the outer contour and outside the inner contour. Determining whether two sets of vertical contour line segments satisfy the second preset rule is similar to judging whether the horizontal contour line segments satisfy the second preset rule. In this way, adding preset rules to any two groups of contour line segments that satisfy the second preset rule avoids The preset rules cannot be added, thereby ensuring the control of the stroke width.
下面结合图4、图5和图6说明本发明一个具体实施例。A specific embodiment of the present invention will be described below with reference to FIG. 4 , FIG. 5 and FIG. 6 .
如图4所示,该具体实施例的步骤包括:As shown in Figure 4, the steps of this specific embodiment include:
步骤402,获取字形轮廓文件;
步骤404,获取字形轮廓,匹配字形内外轮廓:根据字形的轮廓方向确定内外轮廓,并判断每个内轮廓与外轮廓的包含关系,然后对每一个外轮廓匹配其包含的所有内轮廓,并将其作为一个整体,进行下一步的处理,若外轮廓不包含任何内轮廓,则其本身作为一个处理对象;
步骤406,获取每个外轮廓及其包含的内轮廓中水平和竖直线段,并排序:根据每条轮廓线的标识,筛选出当前外轮廓及其包含的内轮廓线段中所有水平线段和竖直线段,然后按照从上到下的顺序对水平线段进行排序,并按从左到右的顺序对竖直线段进行排序,最后以同一条直线上的线段为一组,每组间保持原来的排序方式,分别将水平线段和竖直线段按组进行保存;Step 406: Obtain the horizontal and vertical line segments in each outer contour and the inner contour it contains, and sort them: according to the identification of each contour line, screen out all the horizontal line segments and vertical line segments in the current outer contour and the inner contour line segments it contains. Straight line segments, then sort the horizontal line segments from top to bottom, and sort the vertical line segments from left to right, and finally take the line segments on the same straight line as a group, keeping the original one between each group Sorting method, save the horizontal line segment and the vertical line segment in groups;
步骤408,对水平线段初步加规则:对于任意两组水平线段,如果两者之间距离在笔画宽度阈值内、在竖直方向有重合,并且形成的中间区域在字形填充部分,则两者可初步确定为一对上下侧的规则线。假设按从上到下的顺序,每组水平线段表示为Ri(i=0,1,2,......N),对水平线段进行如下操作:
(1)若N=0,则水平线段判断结束,转入步骤410,否则令i=0,转入(2);(1) If N=0, the judgment of the horizontal line segment is over, and go to step 410; otherwise, let i=0, go to (2);
(2)令j=i+1,若j=N,转入(6),否则转入(3);(2) Let j=i+1, if j=N, go to (6), otherwise go to (3);
(3)Ri与Rj之间的距离,若小于笔画宽度最小值,返回(2),若大于笔画宽度最大值,转入(6),否则转入(4);(3) the distance between R i and R j , if it is less than the minimum value of stroke width, return to (2), if it is greater than the maximum value of stroke width, go to (6), otherwise go to (4);
(4)若Ri与Rj在竖直方向无重合,返回(2),否则判断Ri与Rj中每条线段与对侧所有线段是否存在重合,若无重合,则删除该线段,进而若删除后有一组线段数为0,则返回(2),否则转入(5);(4) If there is no overlap between Ri and R j in the vertical direction, return to (2). Otherwise, judge whether each line segment in Ri and R j overlaps with all the line segments on the opposite side. If there is no overlap, delete the line segment. Then, if there is a group of line segments whose number is 0 after deletion, return to (2), otherwise go to (5);
(5)若Ri与Rj形成的中间区域在字形填充部分,则将Ri与Rj加入规则线候选数组,转入(6),否则返回(2);(5) If the middle area formed by R i and R j is in the glyph filling part, then add R i and R j to the rule line candidate array, and transfer to (6), otherwise return to (2);
(6)判断候选数组中每对规则线,即Ri与Rk(i<k<N),选择其中重合部分最长的那对规则线并进行保存,转入(7);(6) Judging each pair of rule lines in the candidate array, namely R i and R k (i<k<N), select the pair of rule lines with the longest overlapping part and save them, and transfer to (7);
(7)令i=i+1,若i=N-1,则水平线段初步判断结束,转入步骤410,否则返回(2);(7) Let i=i+1, if i=N-1, then the preliminary judgment of the horizontal line segment is over, and go to step 410, otherwise return to (2);
步骤410,判断水平规则线的合理性:每对规则线中两组线段的关系合理化,但是对于各个规则线间的关系,需要进一步判断是否合理。假设 A、B和C分别代表每组水平线段,步骤408处理后的初步规则线可能存在以下两种情况:①A与C,B与C分别组成两对规则线;②A与B,B 与C分别组成两对规则线。对于这种一组线段分别存在于两对规则线中的情况,删除其中一对规则线,以保证规则线的合理性;Step 410: Judging the rationality of the horizontal ruled lines: the relationship between the two groups of line segments in each pair of ruled lines is rationalized, but the relationship between each ruled line needs to be further judged whether it is reasonable. Assuming that A, B, and C respectively represent each group of horizontal line segments, the preliminary rule lines processed in
步骤412,对竖直线段初步加规则:与步骤408类似;
步骤414,判断竖直规则线的合理性:与步骤410类似;
步骤416,字形加规则结果。
在上述具体实施例的实施过程包括主要步骤为:首先获取字形的内外轮廓,并将外轮廓与内轮廓进行匹配,其次获取每个外轮廓及其所包含的内轮廓中所有的水平轮廓线段和竖直轮廓线段,然后按从上到下的顺序,分别判断两组水平线段间是否应该加规则线,并进一步规范化,最后按从左到右的顺序,类似处理竖直方向的规则线。图5示出了当前工具对“傭”字加规则的结果示意图,如图5所示,圈3中四个竖线段间和圈4中两个横线段间均没有加上规则。而应该是圈3中的左右四个竖线段组成一组规则(即左侧两个竖线段为规则线左侧,右侧两个竖线段为规则线右侧),圈4中的上下两个横线段组成一组规则(即上侧横线段为规则线上侧,下侧横线段为规则线下侧)。图6示出了该具体实施对“傭”字加规则的结果示意图,如图6所示,圈5中的左右四个竖线段组成一组规则,圈6中的上下两个横线段组成一组规则,该具体实施例的方法使字库在系统显示效果更好,同时也减少人工核验的时间成本,提高工作效率。The implementation process of the above-mentioned specific embodiment includes the main steps: firstly acquiring the inner and outer contours of the glyph, and matching the outer contour with the inner contour, and secondly acquiring all the horizontal contour line segments and Vertical contour line segments, and then in the order from top to bottom, respectively determine whether regular lines should be added between the two sets of horizontal line segments, and further normalize them, and finally in the order from left to right, similar to the vertical direction of regular lines. Fig. 5 shows a schematic diagram of the result of adding rules to the word "commission" by the current tool. As shown in Fig. 5, no rules are added between the four vertical line segments in circle 3 and between the two horizontal line segments in circle 4. Instead, the left and right vertical line segments in circle 3 should form a set of rules (that is, the two vertical line segments on the left are the left side of the rule line, and the two vertical line segments on the right side are the right side of the rule line), and the upper and lower two in circle 4 Horizontal line segments form a set of rules (that is, the upper horizontal line segment is the upper side of the rule line, and the lower horizontal line segment is the lower side of the rule line). Figure 6 shows a schematic diagram of the result of adding rules to the word "commission" in this specific implementation. As shown in Figure 6, the left and right four vertical line segments in the circle 5 form a set of rules, and the upper and lower horizontal line segments in the circle 6 form a set of rules. The method of this specific embodiment makes the display effect of the font library better in the system, reduces the time cost of manual verification, and improves the work efficiency.
本发明第二方面的实施例,提出一种字形笔画的控制系统700,图7示出了本发明的一个实施例的字形笔画的控制系统700的示意框图。如图7 所示,字形笔画的控制系统700包括:获取单元72、划分单元74、添加单元 76和控制单元78。其中,获取单元72,用于获取字形的内轮廓和外轮廓;划分单元74,用于根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;添加单元76,用于将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;控制单元78,用于将水平规则线和/或竖直规则线按照预设规则进行控制。An embodiment of the second aspect of the present invention provides a control system 700 for glyph strokes. FIG. 7 shows a schematic block diagram of the control system 700 for glyph strokes according to an embodiment of the present invention. As shown in FIG. 7 , the control system 700 for glyph strokes includes: an acquisition unit 72 , a division unit 74 , an addition unit 76 and a control unit 78 . Wherein, the obtaining unit 72 is used to obtain the inner contour and the outer contour of the glyph; the dividing unit 74 is used to obtain the horizontal contour line segment and the vertical contour line segment according to the outer contour and the inner contour contained therein, and according to the first preset rule The horizontal contour line segment and the vertical contour line segment are divided into components; the adding unit 76 is used to add a preset rule to any two components of the horizontal contour line segment and the vertical contour line segment satisfying the second preset rule, to obtain all horizontal rules Lines and vertical ruled lines; the control unit 78 is used to control the horizontal ruled lines and/or the vertical ruled lines according to preset rules.
本发明提供的字形笔画的控制系统700,首先获取单元72获取字形的内外轮廓,划分单元74以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,添加单元76将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,控制单元78对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。In the control system 700 of the strokes of a glyph provided by the present invention, the acquisition unit 72 first acquires the inner and outer contours of the glyph, and the dividing unit 74 takes the current outer contour and the inner contour contained therein as the processing object, obtains the horizontal contour line segment and the vertical contour line segment, and executes them according to the following steps: The first preset rule groups horizontal contour line segments and vertical contour line segments, so as to facilitate subsequent judgment and determination of rule lines, and the adding unit 76 adds presets to any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition rules, in which, it is possible to first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, and whether all the contour line segments meet the preset rules for adding after the completion of all contour lines. After adding the rule to the contour line segment that satisfies the preset rule, the control unit 78 controls the rule line segment of the adding rule, so that the thickness and width of the controlled strokes are consistent, which solves the problem of unevenness and unevenness of the same horizontal stroke or vertical stroke when the font is displayed. , so that the font library has a better display effect in the system, reducing the time cost of manual verification and improving work efficiency.
图8示出了本发明的另一个实施例的字形笔画的控制系统800的示意框图。其中,字形笔画的控制系统800包括:获取单元82、划分单元84、添加单元86、控制单元88、第一判断单元90和删除单元92。其中,第一判断单元90具体包括:第一判断子单元902和第二判断子单元904。获取单元82具体包括:第一获取子单元822、第二获取子单元824。划分单元84具体包括:第二判断单元842、第一设置单元844、第二设置单元846、筛选单元848、合并单元850、排序单元852。FIG. 8 shows a schematic block diagram of a control system 800 for a glyph stroke according to another embodiment of the present invention. Wherein, the control system 800 of the 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 judging unit 90 specifically includes: a first judging sub-unit 902 and a second judging sub-unit 904 . The obtaining unit 82 specifically includes: a first obtaining subunit 822 and a second obtaining subunit 824 . The dividing unit 84 specifically includes: a second judging unit 842 , a first setting unit 844 , a second setting unit 846 , a screening unit 848 , a merging unit 850 , and a sorting unit 852 .
本发明提供的字形笔画的控制系统800,首先获取单元82获取字形的内外轮廓,划分单元84以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,添加单元86将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,控制单元88对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。The control system 800 for the strokes of a glyph provided by the present invention firstly obtains the inner and outer contours of the glyph by the acquiring unit 82, and the dividing unit 84 takes the current outer contour and the inner contour contained therein as processing objects to obtain the horizontal contour line segment and the vertical contour line segment, and according to the The first preset rule groups horizontal contour line segments and vertical contour line segments, so as to facilitate subsequent judgment and determination of rule lines, and the adding unit 86 adds presets to any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition. rules, in which, it is possible to first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, and whether all the contour line segments meet the preset rules for adding after the completion of all contour lines. After adding the rule to the contour line segment that satisfies the preset rule, the control unit 88 controls the rule line segment of the adding rule, so that the thickness and width of the strokes being controlled are consistent, and the problem of unevenness and unevenness of the same horizontal stroke or vertical stroke when the font is displayed is solved. , so that the font library has a better display effect in the system, reducing the time cost of manual verification and improving work efficiency.
在上述实施例中,优选地,还包括:第一判断单元90,用于判断是否存在满足第三预设规则的水平规则线和/或竖直规则线;删除单元92,用于若判断结果为是,则将满足第三预设规则的水平规则线和/或竖直规则线删除。In the above embodiment, preferably, it further includes: a first judging unit 90 for judging whether there is a horizontal ruled line and/or a vertical ruled line that satisfies the third preset rule; a deletion unit 92 for judging if the result of the judgment If yes, delete the horizontal rule line and/or the vertical rule line that satisfy the third preset rule.
在该实施例中,在对水平规则线和/或竖直规则线按照预设规则进行控制之前,可能存在一组线段分别存在于两对或多对规则线中等情况,这就会导致规则线解析存在歧义,因此,第一判断单元90判断是否存在满足第三预设规则的水平规则线、竖直规则线,当存在时,删除单元92将其删除,避免了规则线的不规范导致字形显示出现问题,保证了规则线的合理性。In this embodiment, before the horizontal ruled line and/or the vertical ruled line are controlled according to the preset rules, there may be a group of line segments respectively existing in two or more pairs of ruled lines, etc., which will lead to ruled lines There is ambiguity in the analysis. Therefore, the first judgment unit 90 judges whether there are horizontal rule lines and vertical rule lines that satisfy the third preset rule. When there are, the deletion unit 92 deletes them to avoid the irregularity of the rule lines. Display problems, to ensure the rationality of the rule line.
在上述任一实施例中,优选地,第一判断单元90具体包括:第一判断子单元902,用于分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分;删除单元92,具体用于若判断结果为否,则删除任一对水平规则线或任一对的竖直规则线;第二判断子单元904,用于判断同一条线段是否同时存在N对删除后的水平规则线或删除后的竖直规则线中;删除单元92,具体还用于若判断结果为是,则删除N-1对删除后的水平规则线或删除后的竖直规则线;其中,N为大于1的整数。In any of the above embodiments, preferably, the first judging unit 90 specifically includes: a first judging subunit 902 for judging the lengths of the overlapping parts of any pair of horizontal ruled lines or any pair of vertical ruled lines respectively Whether it is the longest overlapping part; the deletion unit 92 is specifically used to delete any pair of horizontal rule lines or any pair of vertical rule lines if the judgment result is no; the second judgment subunit 904 is used to judge the same Whether a line segment simultaneously exists in N pairs of deleted horizontal rule lines or deleted vertical rule lines; the deletion unit 92 is specifically also used to delete N-1 pairs of deleted horizontal rule lines or if the judgment result is yes. Deleted vertical regular line; wherein, N is an integer greater than 1.
在该实施例中,第一判断单元90判断是否存在满足第三预设规则的水平规则线和/或竖直规则线的过程,第一判断子单元902分别判断任一对水平规则线或任一对的竖直规则线的重合部分的长度是否为最长的重合部分,可以先进行一种规则线的判断,再进行另外一种规则线的判断,如先进行水平规则线的判断,在所有水平规则线进行判断完毕之后,进行竖直规则线的判断,当重合部分不是最长的,删除单元92就将这对规则线删除,即保留所有候选规则线中重合部分最长的那对规则线。然后第二判断子单元904判断是否存在同一条规则线是否存在不止一对规则线中,如果存在,保留其中一对规则线,删除单元92将其余的规则线进行删除,避免了规则线解析时存在歧义。In this embodiment, the first judging unit 90 judges whether there is a process of horizontal rule lines and/or vertical rule lines that satisfy the third preset rule, and the first judgment subunit 902 judges any pair of horizontal rule lines or any pair of vertical rule lines respectively. Whether the length of the overlapping part of a pair of vertical rule lines is the longest overlapping part, you can first judge one rule line, and then judge another rule line. For example, judge the horizontal rule line first. After all the horizontal rule lines are judged, the vertical rule lines are judged. When the overlapping part is not the longest, the deletion unit 92 deletes the pair of rule lines, that is, retains the pair with the longest overlapping part among all the candidate rule lines. rule line. Then the second judging subunit 904 judges whether the same rule line exists in more than one pair of rule lines, and if so, retains one pair of rule lines, and the deletion unit 92 deletes the rest rule lines, so as to avoid the time of rule line parsing. Ambiguity exists.
在上述任一实施例中,优选地,获取单元82具体包括:第一获取子单元822,用于根据字形的字形回路获取字形轮廓;第二获取子单元824,用于根据字形轮廓的轮廓方向确定内轮廓和外轮廓。In any of the above embodiments, preferably, the obtaining unit 82 specifically includes: a first obtaining subunit 822, used for obtaining the outline of the glyph according to the glyph circuit of the glyph; and a second obtaining subunit 824, used for obtaining the outline direction of the glyph according to the outline of the glyph Determine the inner and outer contours.
在该实施例中,获取单元82获取字形的内轮廓和外轮廓的过程,首先第一获取子单元822根据字形的字形回路获取字形轮廓,第二获取子单元824 通过轮廓方向区分内轮廓和外轮廓,如此,获得了字形的内外轮廓,为后续字形处理提供基础。In this embodiment, the acquisition unit 82 acquires the inner contour and the outer contour of the glyph. First, the first acquiring subunit 822 acquires the glyph outline according to the glyph loop of the glyph, and the second acquiring subunit 824 distinguishes the inner contour and the outer contour according to the contour direction. Outline, in this way, obtains the inner and outer contours of the glyph, which provides the basis for the subsequent glyph processing.
在上述任一实施例中,优选地,划分单元84具体包括:第二判断单元 842,用于判断任一外轮廓是否包含任一内轮廓;第一设置单元844,用于若判断结果为是,则将任一外轮廓与其包含的所有内轮廓设置为一个处理对象;第二设置单元846,用于若判断结果为否,则将任一外轮廓设置为一个处理对象;筛选单元848,用于遍历所有处理对象,筛选出水平轮廓线段和竖直轮廓线段;合并单元850,用于分别将同一条直线上的水平轮廓线段和同一条直线上的竖直轮廓线段划分为同一组份的水平轮廓线段和同一组份的竖直轮廓线段;排序单元852,用于按照从上至下的顺序将所有组份的水平轮廓线段排序,按照从左至右的顺序将所有组份的竖直轮廓线段排序。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 for judging if the result is yes , then any outer contour and all the inner contours it contains are set as a processing object; the second setting unit 846 is used to set any outer contour as a processing object if the judgment result is no; the screening unit 848 uses In order to traverse all the processing objects, filter out the horizontal contour line segment and the vertical contour line segment; the merging unit 850 is used to divide the horizontal contour line segment on the same straight line and the vertical contour line segment on the same straight line into horizontal contour line segments of the same component. The contour line segment and the vertical contour line segment of the same component; the sorting unit 852 is used for sorting the horizontal contour line segments of all components in the order from top to bottom, and sorting the vertical contour lines of all components in the order from left to right Line segment sorting.
在该实施例中,划分单元84获取水平轮廓线段和竖直轮廓线段,并对轮廓线段进行划分组份的过程,首先,将内外轮廓进行匹配,第二判断单元842 通过判断任一外轮廓是否包含任一内轮廓,当外轮廓包含内轮廓时,第一设置单元844将该外轮廓及其包含的内轮廓中看作一个整体,设置为一个处理对象;当外轮廓不包含内轮廓,第二设置单元846则将其本身看作一个整体,设置为一个处理对象,筛选单元848遍历每一个外轮廓及其包含的内轮廓中所有轮廓线,判断并筛选其中的水平轮廓线段和竖直轮廓线段,可以先遍历水平轮廓线段,再遍历竖直轮廓线段,并分开保存,合并单元850将同一水平线上的水平轮廓线段划分为同一组水平轮廓线段,将同一水平线上的竖直轮廓线段划分为同一组竖直轮廓线段,排序单元852将每组水平线段间按照从上至下的顺序,每组竖直线段间按照从左至右的顺序进行排序,方便后续按照顺序判断规则线。In this embodiment, the dividing unit 84 obtains horizontal contour line segments and vertical contour line segments, and divides the contour line segments into components. First, the inner and outer contours are matched, and the second judgment unit 842 judges whether any outer contour is Including any inner contour, when the outer contour includes the inner contour, the first setting unit 844 regards the outer contour and the inner contour it contains as a whole, and sets it as a processing object; when the outer contour does not include the inner contour, the first setting unit 844 The second setting unit 846 regards itself as a whole and sets it as a processing object. The screening unit 848 traverses all the contour lines in each outer contour and the inner contour contained in it, and determines and filters the horizontal contour line segment and the vertical contour. Line segments can first traverse the horizontal contour line segments, then traverse the vertical contour line segments, and save them 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, and divides the vertical contour line segments on the same horizontal line into For the same group of vertical contour line segments, the sorting unit 852 sorts each group of horizontal line segments in a top-to-bottom order, and each group of vertical line segments in a left-to-right order, so as to facilitate subsequent determination of rule lines in sequence.
在上述任一实施例中,优选地,若轮廓线段为水平轮廓线段,则第二预设规则为:两组水平轮廓线段之间的距离在第一预设范围内,且水平两组轮廓线段在竖直方向存在重合部分,且两组水平轮廓线段所形成的中间区域在字形填充区域内;若轮廓线段为竖直轮廓线段,则第二预设规则为:两组竖直轮廓线段之间的距离在第一预设范围内,且竖直两组轮廓线段在水平方向存在重合部分,且两组竖直轮廓线段所形成的中间区域在字形填充区域内。In any of the above embodiments, preferably, if the contour line segments are horizontal contour line segments, the second preset rule is: the distance between the two sets of horizontal contour line segments is within the first preset range, and the two sets of horizontal contour line segments are within the first preset range. There are overlapping parts in the vertical direction, and the middle area formed by the two sets of horizontal contour line segments is within the glyph filling area; if the contour line segments are vertical contour line segments, the second preset rule is: between the two sets of vertical contour line segments The distance between the two sets of vertical contour line segments is within the first preset range, and there are overlapping parts in the horizontal direction of the vertical two sets of contour line segments, and the intermediate area formed by the two sets of vertical contour line segments is within the glyph filling area.
在该实施例中,在判断两组水平轮廓线段是否满足第二预设规则以判断该两组水平轮廓线段是否添加预设规则,具体就是判断该两组水平轮廓线段是否满足三个条件:第一个:两组水平轮廓线段之间的距离小于第一阈值,第一阈值可设定为笔画宽度阈值;第二个:水平两组轮廓线段在竖直方向存在重合部分,若不存在重合则继续判断当前组与其他组,否则进一步将两组线段中与对侧无重合的单个线段删除,删除后有一组线段数为0,则继续判断当前组与其他组;第三个:两组水平轮廓线段所形成的中间区域在字形填充区域内,如果满足三个条件,则将该对轮廓线段添加规则,如果不满足这三个条件,则继续判断当前组与其他组线段,这里判断两组水平线段所形成的中间区域是否在字形填充部分的判断,主要是将区域转化为线,进而将线离散为点,实质上是判断点是否均在外轮廓内部和内轮廓外部。判断两组竖直轮廓线段是否满足第二预设规则与判断水平轮廓线段是否满足第二预设规则类似,如此,将满足第二预设规则的任两组轮廓线段添加预设规则,避免了预设规则加不上的情况,进而保证了对笔画宽度的控制。In this embodiment, when judging whether the two groups of horizontal contour line segments satisfy the second preset rule to determine whether the two groups of horizontal contour line segments are added with a preset rule, it is specifically to determine whether the two groups of horizontal contour line segments satisfy three conditions: the first One: the distance between the two sets of horizontal contour line segments is less than the first threshold, and the first threshold can be set as the stroke width threshold; the second: the two sets of horizontal contour line segments have overlapping parts in the vertical direction. Continue to judge the current group and other groups, otherwise, further delete the single line segment that does not overlap with the opposite side in the two groups of line segments. After deletion, there is a group of line segments with a number of 0, then continue to judge the current group and other groups; the third: the level of the two groups The middle area formed by the contour line segment is in the glyph filled area. If three conditions are met, add rules to the pair of contour line segments. If these three conditions are not met, continue to judge the current group and other groups of line segments. Here, two groups are judged. The judgment of whether the middle area formed by the horizontal line segment is in the filled part of the glyph is mainly to convert the area into a line, and then discretize the line into points. In essence, it is to judge whether the points are both inside the outer contour and outside the inner contour. Determining whether two sets of vertical contour line segments satisfy the second preset rule is similar to judging whether the horizontal contour line segments satisfy the second preset rule. In this way, adding preset rules to any two groups of contour line segments that satisfy the second preset rule avoids The preset rules cannot be added, thereby ensuring the control of the stroke width.
本发明第三方面的实施例,提出一种计算机设备,图9示出了本发明的一个实施例的计算机设备100的示意框图。其中,该计算机设备100包括:An embodiment of the third aspect of the present invention provides a computer device, and FIG. 9 shows a schematic block diagram of a computer device 100 according to an embodiment of the present invention. Wherein, the computer equipment 100 includes:
存储器102、处理器104及存储在存储器102上并可在处理器104上运行的计算机程序,处理器104执行计算机程序时实现以下步骤:获取字形的内轮廓和外轮廓;根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;对水平规则线和/或竖直规则线按照预设规则进行控制。The memory 102, the processor 104 and the computer program stored on the memory 102 and running on the processor 104, the processor 104 implements the following steps when executing the computer program: acquiring the inner and outer contours of the glyph; the inner contour, obtain the horizontal contour line segment and the vertical contour line segment, and divide the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule; any two components of the horizontal contour line segment that satisfy the second preset rule Add preset rules to vertical contour line segments to obtain all horizontal and vertical rule lines; control the horizontal and/or vertical rule lines according to the preset rules.
本发明提供的一种计算机设备100,处理器104执行计算机程序时实现:首先获取字形的内外轮廓,以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。In the computer device 100 provided by the present invention, when the processor 104 executes the computer program, it realizes: firstly obtain the inner and outer contours of the glyph, take the current outer contour and the inner contour contained therein as the processing object, obtain the horizontal contour line segment and the vertical contour line segment, And according to the first preset rule, the horizontal contour line segment and the vertical contour line segment are grouped, so as to facilitate the subsequent judgment and determination of the rule line, and any two groups of horizontal contour line segments or vertical contour line segments that satisfy the second preset condition are added to the preset rule. , wherein, it is possible to first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all the contour line segments whether to meet the preset rules for adding and adding After adding rules for contour line segments that meet the preset rules, the rule line segments of the added rules are controlled so that the thickness and width of the strokes to be controlled are consistent, which solves the problem of unevenness and unevenness of the same horizontal or vertical strokes when the font is displayed, and makes the font library in the The system display effect is better, the time cost of manual verification is reduced, and the work efficiency is improved.
本发明第四方面的实施例,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:获取字形的内轮廓和外轮廓;根据外轮廓及其包含的内轮廓,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段划分组份;将满足第二预设规则的任两组份的水平轮廓线段和竖直轮廓线段添加预设规则,以获取所有水平规则线和竖直规则线;对水平规则线和/或竖直规则线按照预设规则进行控制。The embodiment of the fourth aspect of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented: acquiring the inner contour and outer contour of the glyph; The inner contour it contains, obtains the horizontal contour line segment and the vertical contour line segment, and divides the horizontal contour line segment and the vertical contour line segment into components according to the first preset rule; Preset rules are added to contour line segments and vertical contour line segments to obtain all horizontal and vertical ruled lines; the horizontal and/or vertical ruled lines are controlled according to the preset rules.
本发明提供的一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现:首先获取字形的内外轮廓,以当前外轮廓及其包含的内轮廓为处理对象,获取水平轮廓线段和竖直轮廓线段,并按照第一预设规则对水平轮廓线段和竖直轮廓线段进行分组,以便于后续判断确定规则线,将满足第二预设条件的任意两组水平轮廓线段或竖直轮廓线段添加预设规则,其中,可以先进行判断任意两组水平轮廓线段是否满足添加预设规则,再进行判断任意两组竖直轮廓线段是否满足添加预设规则,在完成全部轮廓线段是否满足添加预设规则以及将满足预设规则的轮廓线段添加规则之后,对添加规则的规则线段进行控制,使得被控制的笔画粗细宽度一致,解决了字形显示时同一横笔画或竖笔画不平整不均匀的问题,使字库在系统显示效果更好,减少了人工核验的时间成本,提高了工作效率。A computer-readable storage medium provided by the present invention stores a computer program thereon, and the computer program is implemented when executed by a processor: firstly obtain the inner and outer contours of the glyph, take the current outer contour and the inner contour contained therein as the processing object, and obtain the Horizontal contour line segments and vertical contour line segments, and group the horizontal contour line segments and vertical contour line segments according to the first preset rule, so as to facilitate subsequent judgment and determination of rule lines, and any two groups of horizontal contour line segments that satisfy the second preset condition are grouped. Or adding preset rules for vertical contour line segments, in which, it is possible to first judge whether any two groups of horizontal contour line segments meet the preset rules for adding, and then judge whether any two groups of vertical contour line segments meet the preset rules for adding, after completing all contours Whether the line segment satisfies the adding preset rules and after adding the contour line segment satisfying the preset rule, the rule line segment of the added rule is controlled, so that the thickness and width of the controlled strokes are consistent, which solves the problem that the same horizontal or vertical strokes are not displayed when the glyph is displayed. The problem of leveling and unevenness makes the font library display better in the system, reduces the time cost of manual verification, and improves work efficiency.
在本说明书的描述中,术语“一个实施例”、“一些实施例”、“具体实施例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或实例。而且,描述的具体特征、结构、材料或特点可以在任何的一个或多个实施例或示例中以合适的方式结合。In the description of this specification, the description of the terms "one embodiment", "some embodiments", "specific embodiment", etc. means that a particular feature, structure, material or characteristic described in connection with the embodiment or example is included in the present invention at least one embodiment or example of . In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or instance. 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 descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims (12)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810149564.XA CN110147528B (en) | 2018-02-13 | 2018-02-13 | A kind of control method, control system, computer equipment and computer-readable storage medium of glyph strokes |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810149564.XA CN110147528B (en) | 2018-02-13 | 2018-02-13 | A kind of control method, control system, computer equipment and computer-readable storage medium of glyph strokes |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110147528A CN110147528A (en) | 2019-08-20 |
CN110147528B true CN110147528B (en) | 2020-12-29 |
Family
ID=67588811
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810149564.XA Active CN110147528B (en) | 2018-02-13 | 2018-02-13 | A kind of control method, control system, computer equipment and computer-readable storage medium of glyph strokes |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110147528B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN88102466A (en) * | 1987-04-30 | 1988-11-16 | 株式会社日立制作所 | Method and system for generating fonts |
CN1188274A (en) * | 1996-10-11 | 1998-07-22 | 佳能株式会社 | Character processing apparatus and method therefor |
CN101996309A (en) * | 2009-08-19 | 2011-03-30 | 北大方正集团有限公司 | Method and relevant device for identifying and transforming stroke contour |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8253742B2 (en) * | 2004-05-28 | 2012-08-28 | Microsoft Corporation | Rendering stroke pairs for graphical objects |
US8306328B2 (en) * | 2009-01-26 | 2012-11-06 | Mitsubishi Electric Research Laboratories | Method for converting outline characters to stylized stroke characters |
-
2018
- 2018-02-13 CN CN201810149564.XA patent/CN110147528B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN88102466A (en) * | 1987-04-30 | 1988-11-16 | 株式会社日立制作所 | Method and system for generating fonts |
CN1188274A (en) * | 1996-10-11 | 1998-07-22 | 佳能株式会社 | Character processing apparatus and method therefor |
CN101996309A (en) * | 2009-08-19 | 2011-03-30 | 北大方正集团有限公司 | Method and relevant device for identifying and transforming stroke contour |
Non-Patent Citations (1)
Title |
---|
中文True_Type字体的Autohint技术;周天祥;《绍兴文理学院学报》;20020630;第22卷(第2期);第20-23页 * |
Also Published As
Publication number | Publication date |
---|---|
CN110147528A (en) | 2019-08-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3922951A1 (en) | Method and device for drawing a three-dimensional road network map, apparatus and medium | |
CN103164865B (en) | A kind of method and apparatus that handwriting input is beautified | |
US8619333B2 (en) | Image forming apparatus, image forming apparatus control method, and program | |
CN102968764B (en) | Chinese character image inpainting method based on strokes | |
JPH0445874B2 (en) | ||
KR20120095852A (en) | Method and apparatus for drawing and erasing calligraphic ink objects on a display surface | |
CN104331928B (en) | A kind of contour automatic labeling method based on the triangulation network | |
US20070266307A1 (en) | Auto-layout of shapes | |
CN105740521A (en) | Small grid removing method and apparatus in oil reservoir numerical simulation system solution process | |
US20180113958A1 (en) | Method for Immediate Boolean Operations Using Geometric Facets | |
US20180018818A1 (en) | Method for Immediate Boolean Operations Using Geometric Facets | |
CN112991529A (en) | Partition algorithm for meshing map by utilizing triangles | |
CN105513006B (en) | A kind of TrueType font profile thickness method of adjustment and device | |
CN110147528B (en) | A kind of control method, control system, computer equipment and computer-readable storage medium of glyph strokes | |
CN109992865B (en) | A Method of Processing Elevation in AutoCAD Engineering Drawings | |
JPH04362793A (en) | Drawing method in raster device | |
WO2016181566A1 (en) | Character recognition method, character recognition device, and character recognition program | |
CN102456000B (en) | Method and device for eliminating crack in page | |
CN116342745A (en) | Editing method and device for lane line data, electronic equipment and storage medium | |
CN112102459B (en) | Complex atmospheric environment block quantization representation method for virtual electromagnetic wave transmission | |
CN115249303A (en) | Layout drawing method, device, equipment and storage medium based on drawing division | |
CN114356201A (en) | Writing beautifying method, device, equipment and readable storage medium | |
CN104112287B (en) | Method and device for segmenting characters in picture | |
JPH117548A (en) | Mesh division process for finite element method | |
CN111651161B (en) | Graphical interface construction method and device, computer equipment and storage medium |
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 | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230612 Address after: 3007, Hengqin international financial center building, No. 58, Huajin street, Hengqin new area, Zhuhai, Guangdong 519031 Patentee after: New founder holdings development Co.,Ltd. Patentee after: BEIJING FOUNDER ELECTRONICS Co.,Ltd. Address before: 100871, Beijing, Haidian District Cheng Fu Road 298, founder building, 9 floor Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd. Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd. |