








技术领域technical field
本发明属于文字信息处理技术领域,具体涉及一种基于轮廓字形模拟点阵字形效果的方法及系统。The invention belongs to the technical field of text information processing, and in particular relates to a method and system for simulating the effect of dot matrix fonts based on outline fonts.
背景技术Background technique
目前比较成熟的字形存储方式有点阵字形存储方式和轮廓字形存储方式。Currently relatively mature font storage methods are dot matrix font storage and outline font storage.
点阵字形存储方式采用二进制来存储固定尺寸大小的点阵字形,即黑白位图的存储方式。每个字形均以黑白象素点矩阵组成。其中,黑色像素用“1”表示,白色像素用“0”表示。点阵字形存储方式占用的存储空间较大,例如单个16×16的点阵字形需要占用32个字节的存储空间,而单个48×48的点阵字形则需要占用288个字节的存储空间。The dot-matrix font storage method uses binary to store fixed-size dot-matrix fonts, that is, the storage method of black and white bitmaps. Each glyph is composed of black and white pixel dot matrix. Wherein, a black pixel is represented by "1", and a white pixel is represented by "0". The dot matrix font storage method takes up a large storage space. For example, a single 16×16 dot matrix font needs to occupy 32 bytes of storage space, while a single 48×48 dot matrix font needs to occupy 288 bytes of storage space .
轮廓字形存储方式采用一个或多个封闭曲线轮廓来描述字形,使用时再采用相关的字体引擎进行尺寸缩放和填充,将其转换为位图。这种方式只需存储封闭轮廓上曲线的描述数据,具备无级平滑缩放而保持字体风格不变等优点。The outline glyph storage method uses one or more closed curve outlines to describe the glyph, and then uses the relevant font engine to perform size scaling and filling, and convert it into a bitmap. This method only needs to store the description data of the curve on the closed contour, and has the advantages of stepless smooth scaling while keeping the font style unchanged.
随着技术的发展,点阵字形的应用场合越来越少,因为轮廓字形技术基本上可以取代点阵字形技术。但当字形尺寸较小时,采用轮廓字形技术在字形缩放和填充后得到的结果会出现笔画粘连等问题,影响阅读效果。由于点阵字形中每一个字都是按照点矩阵大小来设计,所以不会出现上述问题。因此,当字形尺寸较小时,现有的处理方式是用点阵字形来替代轮廓字形。这种方式在提供轮廓字形数据的同时,还必须提供点阵字形数据,因此造成了字形数据的冗余,而且在同时提供多套点阵字形数据的情况下,数据量将会成倍的增长。另外,嵌入点阵字形数据必须获得相关部门的授权,从而增加了用户的成本。With the development of technology, there are fewer and fewer applications of dot matrix fonts, because outline font technology can basically replace dot matrix font technology. However, when the size of the glyph is small, problems such as sticking of strokes will appear in the result obtained by using the outline glyph technology after the glyph is scaled and filled, which will affect the reading effect. Since each character in the dot matrix font is designed according to the size of the dot matrix, the above problems will not occur. Therefore, when the font size is small, the existing processing method is to replace the outline font with the dot matrix font. This method must provide dot matrix glyph data while providing outline glyph data, thus causing redundancy of glyph data, and in the case of providing multiple sets of dot matrix glyph data at the same time, the amount of data will increase exponentially . In addition, the embedding of dot-matrix font data must be authorized by relevant departments, thereby increasing the cost of users.
发明内容Contents of the invention
针对现有技术中存在的缺陷,本发明的目的是提供一种基于轮廓字形模拟点阵字形效果的方法及系统,该方法及系统在轮廓字形的基础上,通过直接调整轮廓字形中笔画的方式,来模拟点阵字形的显示效果。Aiming at the defects in the prior art, the purpose of the present invention is to provide a method and system for simulating the effect of dot matrix fonts based on outline fonts. On the basis of outline fonts, the method and system directly adjust the strokes in outline fonts. , to simulate the display effect of dot matrix fonts.
为了实现上述目的,本发明采用的技术方案是,一种基于轮廓字形模拟点阵字形效果的方法,包括以下步骤:In order to achieve the above object, the technical solution adopted in the present invention is a method for simulating the effect of dot matrix fonts based on outline fonts, comprising the following steps:
(1)将所有的笔画调整代码嵌入到轮廓字库的公共数据部分,所述的笔画调整代码是指对轮廓字形中某类笔画进行调整的代码;(1) All stroke adjustment codes are embedded into the public data part of the outline font library, and the stroke adjustment codes refer to the codes that adjust a certain type of stroke in the outline font;
(2)将调用关系代码嵌入到在指定尺寸上需要调整笔画的轮廓字形数据的前面,所述的调用关系代码是指参照点阵字形的效果调用公共数据部分的笔画调整代码以完成对轮廓字形中的笔画进行调整的代码;(2) Embedding the call relation code in front of the outline glyph data that needs to adjust the stroke on the specified size, the call relation code refers to the stroke adjustment code of the public data part called with reference to the effect of the dot matrix font to complete the outline glyph The code for adjusting strokes in
(3)当读取需要调整笔画的轮廓字形数据时,字体引擎通过该轮廓数据前面的调用关系代码调用公共数据部分的笔画调整代码,在字形渲染之前对轮廓字形中的笔画进行调整。(3) When reading the outline glyph data whose strokes need to be adjusted, the font engine calls the stroke adjustment code in the public data part through the call relationship code in front of the outline data, and adjusts the strokes in the outline glyph before rendering the glyph.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,步骤(1)中,笔画调整方式包括笔画变形方式、笔画隐藏方式、笔画整体平移方式和笔画延伸方式。In a method for simulating the effect of dot matrix fonts based on outline fonts as described above, in step (1), the stroke adjustment methods include stroke deformation, stroke hiding, stroke overall translation and stroke extension.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的笔画变形方式包括水平类笔画和竖直类笔画之间的相互转换,水平类笔画和撇类笔画之间的相互转换,水平类笔画和捺类笔画之间的相互转换。A method for simulating the effect of dot matrix fonts based on outline fonts as described above, wherein the stroke deformation method includes the mutual conversion between horizontal strokes and vertical strokes, and the transformation between horizontal strokes and left strokes. Mutual conversion, mutual conversion between horizontal strokes and Na strokes.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的水平类笔画和竖直类笔画之间的相互转换包括水平类笔画转换为竖直类笔画和竖直类笔画转换为水平类笔画;所述的水平类笔画转换为竖直类笔画的过程为,①缩短水平类笔画的宽度,②延长水平类笔画的高度;所述的竖直类笔画转换为水平类笔画的过程与水平类笔画转换为竖直类笔画的过程相反。A method for simulating the effect of dot matrix fonts based on outline fonts as described above, wherein the mutual conversion between horizontal strokes and vertical strokes includes converting horizontal strokes to vertical strokes and vertical strokes Converted to horizontal class strokes; the process of converting the described horizontal class strokes into vertical class strokes is, ① shortening the width of the horizontal class strokes, and ② prolonging the height of the horizontal class strokes; the described vertical class strokes are converted into horizontal class strokes The process of converting horizontal strokes into vertical strokes is opposite.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的水平类笔画和撇类笔画之间的相互转换包括水平类笔画转换为撇类笔画和撇类笔画转换为水平类笔画;所述的水平类笔画转换为撇类笔画的过程包括以下步骤:A method for simulating the effect of dot matrix fonts based on outline fonts as described above, wherein the mutual conversion between horizontal strokes and left strokes includes conversion of horizontal strokes to left strokes and conversion of left strokes to horizontal strokes. Class stroke; The process that described horizontal class stroke is converted into skimming class stroke comprises the following steps:
①缩短水平类笔画的宽度;① Shorten the width of horizontal strokes;
②将步骤①得到的笔画左边顶点或者右边顶点在竖直方向上整体向上或者向下移动;② Move the left vertex or the right vertex of the stroke obtained in step ① upwards or downwards in the vertical direction as a whole;
③将步骤②得到的笔画的上边顶点在水平方向上整体向右移动或者下边顶点在水平方向上整体向左移动;3. move the upper vertex of the stroke obtained in step 2. to the right as a whole in the horizontal direction or move the lower vertex to the left as a whole in the horizontal direction;
所述的撇类笔画转换为水平类笔画的过程与水平类笔画转换为撇类笔画的过程相反。The process of converting the left strokes into the horizontal strokes is opposite to the conversion of the horizontal strokes into the left strokes.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的水平类笔画和捺类笔画之间的相互转换包括水平类笔画转换为捺类笔画和捺类笔画转换为水平类笔画;所述的水平类笔画转换为捺类笔画的过程包括以下步骤:A method for simulating the effect of dot matrix fonts based on outline fonts as described above, wherein the mutual conversion between horizontal strokes and Na strokes includes converting horizontal strokes to Na strokes and converting Na strokes to horizontal strokes. class strokes; the process of converting the horizontal class strokes into right-click class strokes comprises the following steps:
①缩短水平类笔画的宽度;① Shorten the width of horizontal strokes;
②将步骤①得到的笔画左边顶点或者右边顶点在竖直方向上整体向上或者向下移动;② Move the left vertex or the right vertex of the stroke obtained in step ① upwards or downwards in the vertical direction as a whole;
③将步骤②得到的笔画的上边顶点在水平方向上整体向左移动或者下边顶点在水平方向上整体向右移动;3. move the upper vertex of the stroke obtained in step 2. to the left as a whole in the horizontal direction or move the lower vertex to the right as a whole in the horizontal direction;
所述的捺类笔画转换为水平类笔画的过程与水平类笔画转换为捺类笔画的过程相反。The process of converting the Na strokes into horizontal strokes is opposite to the process of converting horizontal strokes into Na strokes.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的笔画隐藏方式的过程包括以下步骤:A method for simulating the effect of dot matrix fonts based on outline fonts as described above, wherein the process of hiding the strokes includes the following steps:
①在笔画调整过程中始终没有被调整的笔画上任选一点作为隐藏点;①Choose a point on the stroke that has not been adjusted during the stroke adjustment process as a hidden point;
②将待隐藏笔画上的所有点沿着水平方向移动到与隐藏点在同一竖直方向上,或者沿着竖直方向移动到与隐藏点在同一水平方向上;② Move all points on the stroke to be hidden horizontally to the same vertical direction as the hidden point, or move vertically to the same horizontal direction as the hidden point;
③将待隐藏笔画上的所有点沿着竖直方向移动到隐藏点,或者沿着水平方向移动到隐藏点。③ Move all points on the stroke to be hidden to the hidden point vertically or horizontally to the hidden point.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的笔画整体平移方式包括在水平方向上移动和在竖直方向上移动两种方式;所述的在水平方向上移动的过程为将笔画上的所有点加上在水平方向的移动量,移动所有点;所述的在竖直方向上移动的过程为将笔画上的所有点加上在竖直方向的移动量,移动所有点。A method for simulating the effect of dot-matrix fonts based on outline fonts as described above, wherein the overall translation of the strokes includes two ways of moving in the horizontal direction and moving in the vertical direction; The process of moving is to add all points on the stroke to the amount of movement in the horizontal direction, and move all points; the process of moving in the vertical direction is to add all points on the stroke to the amount of movement in the vertical direction , move all points.
如上所述的一种基于轮廓字形模拟点阵字形效果的方法,其中,所述的笔画延伸方式包括笔画的延长和缩减两种方式;所述的笔画的延长和缩减的过程为,首先确定延长或缩减的方向和距离,然后将笔画一端的顶点沿着确定的方向延长或缩减至确定的距离处。A method for simulating the effect of dot matrix fonts based on outline fonts as described above, wherein the stroke extension method includes two methods of stroke extension and reduction; the process of the stroke extension and reduction is firstly to determine the extension Or reduce the direction and distance, and then extend or reduce the vertices at one end of the stroke to the determined distance along the determined direction.
一种基于轮廓字形模拟点阵字形效果的系统,所述的系统包括将所有的笔画调整代码嵌入到轮廓字库的公共数据部分和将调用关系代码嵌入到在指定尺寸上需要调整笔画的轮廓字形数据前面的嵌入装置,以及读取需要调整笔画的轮廓字形数据时,字体引擎通过该轮廓数据前面的调用关系代码调用公共数据部分的笔画调整代码,在字形渲染之前对轮廓字形中的笔画进行调整的调整装置;所述的笔画调整代码是指对轮廓字形中某类笔画进行调整的代码;所述的调用关系代码是指参照点阵字形的效果调用公共数据部分的笔画调整代码以完成对轮廓字形中的笔画进行调整的代码。A system for simulating the effect of dot-matrix fonts based on outline fonts, the system includes embedding all stroke adjustment codes into the public data part of the outline font library and embedding calling relationship codes into the outline font data whose strokes need to be adjusted on a specified size When the above embedded device and the outline glyph data needing to be adjusted are read, the font engine calls the stroke adjustment code in the public data part through the call relationship code in front of the outline data, and the strokes in the outline glyph are adjusted before the glyph is rendered. adjustment device; the stroke adjustment code refers to the code for adjusting a certain type of stroke in the outline glyph; the described call relationship code refers to the stroke adjustment code of the public data part called with reference to the effect of the dot matrix font to complete the outline glyph The strokes in the code are adjusted.
本发明所述的方法及系统在轮廓字形的基础上通过对轮廓字形中的笔画进行调整的方式,实现了在指定尺寸上模拟点阵字形的效果,避免了嵌入点阵字形数据时造成的数据冗余,同时降低了用户的成本。The method and system of the present invention realize the effect of simulating dot matrix fonts on a specified size by adjusting the strokes in the outline glyphs on the basis of outline glyphs, and avoid data loss caused by embedding dot matrix glyph data Redundancy while reducing costs for users.
附图说明Description of drawings
图1是本发明所述的方法流程图;Fig. 1 is the method flowchart of the present invention;
图2是具体实施方式中矩形类水平笔画转换为竖直类笔画示意图;Fig. 2 is a schematic diagram of the conversion of a rectangular class horizontal stroke into a vertical class stroke in the specific embodiment;
图3是具体实施方式中矩形类水平笔画转换为撇类笔画示意图;Fig. 3 is a schematic diagram of converting a rectangular class horizontal stroke into a skimming class stroke in a specific embodiment;
图4是具体实施方式中矩形类水平笔画转换为捺类笔画示意图;Fig. 4 is that in the specific embodiment, the horizontal strokes of the rectangle class are converted into a sketch map of the strokes of the Na class;
图5是具体实施方式中笔画隐藏方式示意图;Fig. 5 is a schematic diagram of a stroke hiding method in a specific embodiment;
图6是具体实施方式中笔画整体平移方式示意图;Fig. 6 is a schematic diagram of the overall translation mode of strokes in the specific embodiment;
图7是具体实施方式中笔画延伸方式示意图;Fig. 7 is a schematic diagram of stroke extension mode in the specific embodiment;
图8是实施例1中轮廓字形“疆”字示意图;Fig. 8 is a schematic diagram of the outline font "Jiang" in embodiment 1;
图9是实施例1中轮廓字形“疆”字调整后的效果图;Fig. 9 is the effect diagram after the adjustment of the contour font "Jiang" word in embodiment 1;
图10是实施例2中轮廓字形“置”字示意图;Fig. 10 is a schematic diagram of the outline font "place" in embodiment 2;
图11是实施例2中轮廓字形“置”字调整后的效果图。Fig. 11 is an effect diagram after adjustment of the contour font "Zhi" in embodiment 2.
具体实施方式Detailed ways
下面结合实施例和附图对本发明进行详细描述。The present invention will be described in detail below in conjunction with the embodiments and the accompanying drawings.
本发明主要应用于当在指定尺寸上轮廓字形中的笔画发生粘连,影响正常阅读时,通过调整轮廓字形中笔画的方式,来模拟点阵字形的显示效果。The present invention is mainly applied to simulating the display effect of dot matrix fonts by adjusting the strokes in the outline fonts when the strokes in the outline fonts in the specified size stick together and affect normal reading.
本发明所述的基于轮廓字形模拟点阵字形效果的系统,包括将所有的笔画调整代码嵌入到轮廓字库的公共数据部分和将调用关系代码嵌入到在指定尺寸上需要调整笔画的轮廓字形数据前面的嵌入装置,以及读取需要调整笔画的轮廓字形数据时,字体引擎通过该轮廓数据前面的调用关系代码调用公共数据部分的笔画调整代码,在字形渲染之前对轮廓字形中的笔画进行调整的调整装置。其中,笔画调整代码是指对轮廓字形中某类笔画进行调整的代码;调用关系代码是指参照点阵字形的效果调用公共数据部分的笔画调整代码以完成对轮廓字形中的笔画进行调整的代码。The system for simulating dot-matrix glyph effects based on outline glyphs according to the present invention includes embedding all stroke adjustment codes into the public data part of the outline font library and embedding calling relation codes in front of the outline glyph data whose strokes need to be adjusted on a specified size When reading the outline glyph data whose strokes need to be adjusted, the font engine calls the stroke adjustment code in the public data part through the call relationship code in front of the outline data, and adjusts the strokes in the outline glyph before rendering the glyph device. Among them, the stroke adjustment code refers to the code for adjusting a certain type of stroke in the outline glyph; the calling relationship code refers to the code for calling the stroke adjustment code in the public data part with reference to the effect of the dot matrix glyph to complete the adjustment of the stroke in the outline glyph .
图1出示了采用本发明所述的系统模拟点阵字形效果的方法流程,包括以下步骤。Fig. 1 shows the flow of the method for simulating the effect of dot matrix fonts using the system of the present invention, including the following steps.
(1)将所有的笔画调整代码嵌入到轮廓字库的公共数据部分。(1) Embed all stroke adjustment codes into the public data part of the outline font.
笔画的调整方式主要包括笔画变形方式、笔画隐藏方式、笔画整体平移方式和笔画延伸方式等。笔画的调整方式可以根据实际应用的需要进行扩展。The stroke adjustment methods mainly include the stroke deformation method, the stroke hiding method, the stroke overall translation method and the stroke extension method, etc. The stroke adjustment method can be expanded according to the needs of practical applications.
笔画变形方式包括水平类笔画和竖直类笔画之间的相互转换,水平类笔画和撇类笔画之间的相互转换,水平类笔画和捺类笔画之间的相互转换。Stroke deformation methods include mutual conversion between horizontal strokes and vertical strokes, mutual conversion between horizontal strokes and left strokes, and mutual conversion between horizontal strokes and right strokes.
水平类笔画和竖直类笔画之间的相互转换包括水平类笔画转换为竖直类笔画和竖直类笔画转换为水平类笔画。水平类笔画转换为竖直类笔画的过程为:①缩短水平类笔画的宽度,②延长水平类笔画的高度。竖直类笔画转换为水平类笔画按照与上述步骤相逆的方式即可实现。The mutual conversion between horizontal type strokes and vertical type strokes includes conversion of horizontal type strokes into vertical type strokes and conversion of vertical type strokes into horizontal type strokes. The process of converting horizontal strokes into vertical strokes is: ① shortening the width of horizontal strokes, and ② extending the height of horizontal strokes. The conversion of vertical strokes into horizontal strokes can be realized in the reverse manner of the above steps.
以图2所示的由顶点21、顶点22、顶点23和顶点24组成的矩形类水平笔画转换为竖直类笔画为例。首先缩短顶点21和顶点22、顶点23和顶点24之间的水平距离,调整笔画在水平方向上的宽度。然后加大顶点21和顶点24、顶点22和顶点23之间的竖直距离,调整笔画在竖直方向上的高度,从而达到水平类笔画转换为竖直类笔画的目的。转换后的效果如图2中由顶点21′、顶点22′、顶点23′和顶点24′组成的竖直笔画。Take the conversion of the rectangular horizontal strokes composed of
水平类笔画和撇类笔画之间的相互转换包括水平类笔画转换为撇类笔画和撇类笔画转换为水平类笔画。水平类笔画转换为撇类笔画的过程包括以下步骤:The mutual conversion between horizontal strokes and left strokes includes conversion of horizontal strokes to left strokes and conversion of left strokes to horizontal strokes. The process of converting horizontal strokes into skimming strokes includes the following steps:
①缩短水平类笔画的宽度;① Shorten the width of horizontal strokes;
②将步骤①得到的笔画左边顶点或者右边顶点在竖直方向上整体向上或者向下移动;② Move the left vertex or the right vertex of the stroke obtained in step ① upwards or downwards in the vertical direction as a whole;
③将步骤②得到的笔画的上边顶点在水平方向上整体向右移动或者下边顶点在水平方向上整体向左移动。③ Move the upper vertex of the stroke obtained in step ② to the right as a whole in the horizontal direction or move the lower vertex to the left as a whole in the horizontal direction.
撇类笔画转换为水平类笔画按照与上述步骤相逆的方式即可实现。The conversion of skimming type strokes into horizontal type strokes can be realized in the reverse manner of the above steps.
以图3所示的由顶点31、顶点32、顶点33和顶点34组成的矩形类水平笔画转换为撇类笔画为例。首先将顶点31和顶点32之间的水平距离缩短,然后将顶点32在竖直方向上向下移动。顶点33和顶点34重复顶点31和顶点32的变换操作。最后将顶点33和顶点34在水平方向上整体向左移动。转换后的效果如图3中由顶点31′、顶点32′、顶点33′和顶点34′组成的撇笔画。Take the conversion of the rectangular horizontal strokes composed of
水平类笔画和捺类笔画之间的相互转换包括水平类笔画转换为捺类笔画和捺类笔画转换为水平类笔画。其中,水平类笔画转换为捺类笔画的过程包括以下步骤:The conversion between horizontal strokes and 捺 strokes includes conversion of horizontal strokes to 捺 strokes and conversion of 捺 strokes to horizontal strokes. Wherein, the process of converting horizontal type strokes into right strokes includes the following steps:
①缩短水平类笔画的宽度;① Shorten the width of horizontal strokes;
②将步骤①得到的笔画左边顶点或者右边顶点在竖直方向上整体向上或者向下移动;② Move the left vertex or the right vertex of the stroke obtained in step ① upwards or downwards in the vertical direction as a whole;
③将步骤②得到的笔画的上边顶点在水平方向上整体向左移动或者下边顶点在水平方向上整体向右移动;3. move the upper vertex of the stroke obtained in step 2. to the left as a whole in the horizontal direction or move the lower vertex to the right as a whole in the horizontal direction;
捺类笔画转换为水平类笔画按照与上述步骤相逆的方式即可实现。Na type strokes are converted into horizontal type strokes and can be realized according to the mode opposite to the above-mentioned steps.
以图4所示的由顶点41、顶点42、顶点43和顶点44组成的矩形类水平笔画转换为捺类笔画为例。首先将顶点41和顶点42之间的水平距离缩短,然后将顶点42在竖直方向上向上移动。顶点43和顶点44重复顶点41和顶点42的变换操作。最后将顶点43和顶点44在水平方向上整体向右移动。调整后的效果如图4中由顶点41′、顶点42′、顶点43′和顶点44′组成的捺笔画。Take the conversion of the rectangle-like horizontal strokes composed of vertices 41, 42, 43 and 44 shown in FIG. 4 into Na-like strokes as an example. First shorten the horizontal distance between the apex 41 and the apex 42, and then move the apex 42 upward in the vertical direction. Vertex 43 and vertex 44 repeat the transform operation of vertex 41 and vertex 42 . Finally, the vertices 43 and 44 are moved to the right as a whole in the horizontal direction. The effect after adjustment is shown in Fig. 4 as the stroke of a stroke consisting of apex 41', apex 42', apex 43' and apex 44'.
笔画隐藏方式的调整过程包括以下步骤:The adjustment process of the stroke hiding method includes the following steps:
①在笔画调整过程中始终没有被调整的笔画上任选一点作为隐藏点;①Choose a point on the stroke that has not been adjusted during the stroke adjustment process as a hidden point;
②将待隐藏笔画上的所有点沿着水平方向移动到与隐藏点在同一竖直方向上,或者沿着竖直方向移动到与隐藏点在同一水平方向上;② Move all points on the stroke to be hidden horizontally to the same vertical direction as the hidden point, or move vertically to the same horizontal direction as the hidden point;
③将待隐藏笔画上的所有点沿着竖直方向移动到隐藏点,或者沿着水平方向移动到隐藏点。③ Move all points on the stroke to be hidden to the hidden point vertically or horizontally to the hidden point.
以图5所示的由顶点51、顶点52、顶点53和顶点54组成的矩形类水平笔画隐藏到线段的一个端点55为例,端点55为隐藏点,假设图5中的线段不需要任何调整。首先将矩形类水平笔画上所有点沿着水平方向移动到与端点55在同一竖直方向上,然后再将矩形类水平笔画上所有点移动到端点55处,这样便将原始矩形类水平笔画转换成了一个点,达到了隐藏笔画的目的。Take the rectangular horizontal strokes composed of
笔画整体平移包括在水平方向上移动和在竖直方向上移动两种方式。其中,在水平方向上移动的过程为将笔画上的所有点加上在水平方向的移动量,移动所有点。在竖直方向上移动的过程为将笔画上的所有点加上在竖直方向的移动量,移动所有点。The overall translation of strokes includes moving in the horizontal direction and moving in the vertical direction. Wherein, the process of moving in the horizontal direction is to add the moving amount in the horizontal direction to all the points on the stroke, and move all the points. The process of moving in the vertical direction is to add the moving amount in the vertical direction to all the points on the stroke, and move all the points.
以图6所示的由顶点61、顶点62、顶点63和顶点64组成的矩形类水平笔画移动到由顶点61′、顶点62′、顶点63′和顶点64′组成的矩形类水平笔画的位置上为例。首先将矩形类水平笔画上所有点加上水平方向的移动量,移动所有点。然后将所有点加上竖直方向上的移动量,移动所有点。Move to the position of the rectangle class horizontal stroke that is made up of vertex 61 ', vertex 62 ', vertex 63 ' and vertex 64 ' Take the example above. First, add all the points on the horizontal stroke of the rectangle to the moving amount in the horizontal direction, and move all the points. Then add all points to the amount of movement in the vertical direction, and move all points.
笔画延伸包括笔画的延长和缩减两种方式。笔画的延长或缩减的过程为:首先确定延长或缩减的方向和距离,然后将笔画一端的顶点沿着确定的方向延长或缩减至确定的距离处。Stroke extension includes stroke extension and reduction. The process of extending or reducing strokes is as follows: firstly determine the direction and distance of extending or reducing, and then extend or reduce the vertices at one end of the stroke along the determined direction to the determined distance.
以图7所示的由顶点71、顶点72、顶点73和顶点74组成的矩形类水平笔画中的顶点71和顶点72延伸到顶点71′和顶点72′为例。延长的方向水平向左,延长的距离至顶点71′和顶点72′处。将矩形类水平笔画的顶点71和顶点72沿着水平方向延长至顶点71′和顶点72′处。如果顶点71′和72′在顶点71和顶点72、顶点73和顶点74之间,则为缩减矩形类水平笔画。在竖直方向上的延伸操作与在水平方向上的延伸操作类似。Take for example the
将对笔画的上述调整方式编写成代码,嵌入到轮廓字库的公共数据部分,以供调整轮廓字形时调用。Write the above-mentioned stroke adjustment method into code, embed it into the public data part of the outline font library, and call it when adjusting the outline font.
(2)将调用关系代码嵌入到在指定尺寸上需要调整笔画的轮廓字形数据的前面。(2) Embedding the calling relationship code in front of the outline glyph data whose stroke needs to be adjusted on the specified size.
针对每一个需要调整笔画的具体轮廓字形来说,参照点阵字形的效果在指定尺寸上调整笔画时可能用到步骤(1)中的一种或几种调整方式,因此将具体轮廓字形的调整过程代码,即调用公共数据部分的笔画调整代码以完成对具体轮廓字形中的笔画进行调整的调用关系代码应嵌入到轮廓字库中存储具体轮廓字形数据的前面。For each specific outline glyph that needs to adjust the stroke, one or more adjustment methods in step (1) may be used when adjusting the stroke on the specified size with reference to the effect of the dot matrix glyph, so the adjustment of the specific outline glyph The procedure code, that is, call the stroke adjustment code of the public data part to complete the adjustment of the stroke in the specific outline glyph. The calling relationship code should be embedded in the outline font before storing the specific outline glyph data.
(3)当读取需要调整笔画的轮廓字形数据时,字体引擎通过该轮廓数据前面的调用关系代码调用公共数据部分的笔画调整代码,在字形渲染之前对轮廓字形中的笔画进行调整。(3) When reading the outline glyph data whose strokes need to be adjusted, the font engine calls the stroke adjustment code in the public data part through the call relationship code in front of the outline data, and adjusts the strokes in the outline glyph before rendering the glyph.
实施例1Example 1
以调整图8所示的轮廓字形“疆”字(方正细黑中提取)为例。当字形大小为16 X 16像素时,字形的显示效果会发生笔画粘连的问题,影响阅读效果。因此需要参照点阵字形的效果对“疆”字的轮廓字形进行调整。Take the adjustment of the contour font "Jiang" shown in Figure 8 as an example. When the glyph size is 16 X 16 pixels, the display effect of the glyph will have the problem of sticking strokes, which will affect the reading effect. Therefore, it is necessary to adjust the contour font of the word "Jiang" with reference to the effect of the dot matrix font.
首先需要将点801和点802在水平方向上延伸到与点805在同一竖直方向上,点803和点804在水平方向上延伸到与点813在同一竖直方向上。由于点811、点812、点813和点814组成的笔画会和相邻的笔画发生粘连,因此需要将该笔画隐藏。采用上述的隐藏操作,将其隐藏到点805处。由点806、807、808和809组成的笔画,对点806和点807在水平方向上进行延伸操作,延伸到与点805在同一竖直方向上;对点808和点809在水平方向上同样进行延伸操作,延伸到与点813在同一竖直方向上。最后对由点815、816、817和818组成的笔画,实施延伸操作。将点815和点816沿水平方向延伸到与点805在同一竖直方向上,将点817和点818沿水平方向延伸到与点813在同一竖直方向上。经过上述调整后,最终得到如图9所示的与点阵字形相似的显示效果。First,
实施例2Example 2
以调整图10所示的轮廓字形“置”字为例。当字形大小为12 X 12像素时,轮廓字形的显示效果会发生笔画粘连的问题,影响阅读效果。因此需要参照点阵字形的效果对“置”字的轮廓字形进行调整。Take the adjustment of the outline character "Zhi" shown in Figure 10 as an example. When the glyph size is 12 X 12 pixels, the display effect of the outline glyph will have the problem of sticking strokes, which will affect the reading effect. Therefore, it is necessary to adjust the outline font of the word "Zhi" with reference to the effect of the dot matrix font.
首先需要将某些笔画进行隐藏,包含由点1010,1011、1012和1013组成的笔画,将其隐藏到点1001处;由点1014、1015、1016和1017组成的笔画,同样将其隐藏到点1001处。然后进行变笔操作,将由点1006、1007、1008和1009组成的水平类笔画变换为竖直类笔画。具体操作步骤为:沿水平方向上将点1006、1007移动到与点1004在同一竖直方向上,再将点1008、1009移动到与点1005在同一竖直方向上,再沿竖直方向将点1007和点1009移动到与点1018在同一水平方向上。此外,还需要对由点1002、1003、1004和1005组成的笔画进行整体平移操作。将点1004沿水平方向移动到与点1001在同一竖直方向上,其他三点随点1004移动相同的水平移动量。经过上述调整后,最终得到如图11所示的与点阵字形形似的显示效果。First of all, some strokes need to be hidden, including strokes composed of
需要说明的是:本发明的核心是在轮廓字形的基础上通过对轮廓字形中的笔画进行调整,实现模拟点阵字形效果的目的。因此,只要是通过对轮廓字形中的笔画进行调整,来达到模拟点阵字形效果的方式,便属于本发明的技术创新范围。It should be noted that: the core of the present invention is to adjust the strokes in the outline font on the basis of the outline font to achieve the purpose of simulating the effect of the dot matrix font. Therefore, as long as the strokes in the outline font are adjusted to achieve the effect of simulating the dot matrix font, it belongs to the technical innovation scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA2008102266911ACN101447087A (en) | 2008-11-20 | 2008-11-20 | Method for stimulating matrix font effect based on outline font and system thereof |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CNA2008102266911ACN101447087A (en) | 2008-11-20 | 2008-11-20 | Method for stimulating matrix font effect based on outline font and system thereof |
| Publication Number | Publication Date |
|---|---|
| CN101447087Atrue CN101447087A (en) | 2009-06-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CNA2008102266911APendingCN101447087A (en) | 2008-11-20 | 2008-11-20 | Method for stimulating matrix font effect based on outline font and system thereof |
| Country | Link |
|---|---|
| CN (1) | CN101447087A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102541828A (en)* | 2012-01-11 | 2012-07-04 | 深圳市同洲视讯传媒有限公司 | Creating method for font example and embedded type system device |
| CN104992143A (en)* | 2015-06-04 | 2015-10-21 | 北京大学 | Automatic extraction method for character strokes of vector fonts |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102541828A (en)* | 2012-01-11 | 2012-07-04 | 深圳市同洲视讯传媒有限公司 | Creating method for font example and embedded type system device |
| CN104992143A (en)* | 2015-06-04 | 2015-10-21 | 北京大学 | Automatic extraction method for character strokes of vector fonts |
| CN104992143B (en)* | 2015-06-04 | 2018-10-26 | 北京大学 | A kind of Chinese-character stroke extraction method towards vector font |
| Publication | Publication Date | Title |
|---|---|---|
| CN101625848B (en) | Realization method of vector font library oriented to embedded platform | |
| CN101699426B (en) | Document format conversion system and method | |
| CN101833542B (en) | Method and device for rendering fonts of user interface | |
| CN103186511B (en) | Chinese characters word-formation method and apparatus, the method for construction fontlib | |
| CN107644006A (en) | A kind of Chinese script character library automatic generation method based on deep neural network | |
| CN101183283A (en) | A Method of Writing Handwritten Information Directly | |
| CN111221596B (en) | Font rendering method, apparatus and computer readable storage medium | |
| EP2033106B1 (en) | Remoting sub-pixel resolved characters | |
| CN1588350A (en) | Treating method and its use for dynamic Chinese character word library containing writing time sequence information | |
| CN106126760A (en) | A kind of method that web page picture optimizes | |
| KR100539056B1 (en) | Method for Lossy Optimization And Storage of Font | |
| CN103177419A (en) | Caching method for vector diagram converted bitmap and special image processing device | |
| CN109657203B (en) | Method and system for font size adjustment | |
| CN103150150A (en) | Method and device for displaying weather information | |
| CN101447087A (en) | Method for stimulating matrix font effect based on outline font and system thereof | |
| CN115988170A (en) | Method and device for clearly displaying Chinese and English characters in real-time video screen combination in cloud conference | |
| CN111881648A (en) | A method for generating e-book font files | |
| CN101388112B (en) | Method and system for changing font style | |
| CN103489268B (en) | A kind of Arabic display packing for POS platform | |
| CN107908379B (en) | A Method for Displaying Original Drawings of Digital Publishing on Large Pages | |
| CN100587796C (en) | The Method of Generating Smooth Dot-matrix Fonts from Vector Fonts | |
| CN110164399A (en) | 8 bit depth type matrix storage optimization methods | |
| CN101894543A (en) | Vector font display method for E-book reader | |
| CN101127207B (en) | A method and device for improving the display quality of gray-scale fonts | |
| CN101273360B (en) | Error diffusion for display frame buffer saving electricity |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C12 | Rejection of a patent application after its publication | ||
| RJ01 | Rejection of invention patent application after publication | Open date:20090603 |