TWI409800B - About rasterizing asian characters based on stroke font representation - Google Patents
About rasterizing asian characters based on stroke font representation Download PDFInfo
- Publication number
- TWI409800B TWI409800B TW097139129A TW97139129A TWI409800B TW I409800 B TWI409800 B TW I409800B TW 097139129 A TW097139129 A TW 097139129A TW 97139129 A TW97139129 A TW 97139129A TW I409800 B TWI409800 B TW I409800B
- Authority
- TW
- Taiwan
- Prior art keywords
- stroke
- primitive
- pen
- chinese
- font data
- Prior art date
Links
Abstract
Description
本發明是有關於根據輪廓字體的資料產生低解析度小字品質之文字顯示的技術,尤指一種根據筆劃基礎字型資料產生低解析度中文小字品質的方法和裝置。The present invention relates to a technique for generating a low-resolution small-word-quality text display based on profile font data, and more particularly to a method and apparatus for generating low-resolution Chinese small-word quality based on stroke basic font data.
一般被廣泛地應用於計算器中文字型的產生和顯示的技術是屬於筆劃基礎字型的產生方法,這項技術也已經被披露於台灣專利証書號143771上,筆劃基礎字型資料的產生包含二個過程,第一個過程是先定義一個基本筆劃集,每個基本筆劃是藉由制訂一些參數來描述屬於同一個筆劃類別之筆形的生成,第二個過程是利用被完整定義的基本筆劃集來組合漢字,藉以產生每個被組合成漢字字型的筆劃參數值的資料,這些筆劃參數值的資料是構成每個對應漢字形狀的字型資料。至於填充字形以顯示字型資料所表現字形的方法是使用填充圖形的技術為之,填充圖形的演算係將字形轉換成圖元表現的影像資料,然後以黑白或灰度的圖元影像顯示在計算器的螢幕上。The technology that is widely used in the generation and display of text types in calculators is a method for generating the basic fonts of strokes. This technology has also been disclosed in Taiwan Patent Certificate No. 143771, and the generation of stroke basic font data includes In the two processes, the first process is to first define a basic stroke set. Each basic stroke is to describe the generation of the pen shape belonging to the same stroke category by formulating some parameters. The second process is to use the basic strokes that are completely defined. The combination of Chinese characters is used to generate data of each stroke parameter value combined into a Chinese character font, and the data of these stroke parameter values is the font data constituting each corresponding Chinese character shape. The method of filling the glyphs to display the glyphs of the glyph data is to use the technique of filling the graphics, and the calculus of the filling graphics converts the glyphs into image data represented by the primitives, and then displays them in black and white or grayscale image images. On the screen of the calculator.
在筆劃基礎字型技術裏建造一個基本筆劃可看成是定義一個代數系統,使得在該系統裏的筆劃形狀是用外顯和內隱之二項參數的空間關係作表示,如專利案143771所披露,每個基本筆劃是用二項外顯參數和二項內涵參數定義,外顯參數為關鍵點和寬度,而內涵參數為特徵點和相鄰特徵點間的貝茲控制點,於是在一個基本筆劃的定義裏就以外顯和內涵二項參數的代數關係來表示,據此,特徵點是以關鍵點和 寬度表示,換言之,一旦給了關鍵點的位置和寬度值,將它們的值代入被定義的代數式中就決定了特徵點的位置,同理,一旦決定了特徵點的位置,則相鄰二個特徵點間的曲線形狀就由被定義於其間座標點的貝茲控制點所決定,將所有相鄰特徵點間的曲線段連接起來就構成了筆劃的輪廓形狀。Constructing a basic stroke in the stroke basic font technique can be seen as defining an algebraic system such that the stroke shape in the system is represented by the spatial relationship between the explicit and implicit parameters, as in patent case 143771. Disclosure, each basic stroke is defined by two explicit parameters and two intensional parameters, the explicit parameters are key points and widths, and the intrinsic parameters are the Bezi control points between the feature points and adjacent feature points, so in one The definition of the basic stroke is expressed in the algebraic relationship between the explicit and connotative two parameters. According to this, the feature point is the key point and The width indicates, in other words, once the position and width values of the key points are given, the values of the feature points are determined by substituting their values into the defined algebraic expression. Similarly, once the position of the feature points is determined, the adjacent two are adjacent. The shape of the curve between the feature points is determined by the Bezi control points defined by the coordinate points between them, and the curve segments between all the adjacent feature points are connected to form the outline shape of the stroke.
所以一個文字形狀的表現就可以用那些指定給各個組成字形之基本筆劃的外顯參數值來表示,這些筆劃參數值就構成該個文字的字型資料,至於用字型資料來產生字形則是個反向的程式,首先,借著將這些筆劃參數值代入事先定義的代數式裏即可得到組成字形的每個筆形,這些筆形的呈現就可用來顯示該文字形狀。其次,根據這項觀點所設計的一個填充圖形的程式就將這些筆形組成的圖形投射到一個指定尺寸的點陣空間裏,產生點陣圖元被圖形覆蓋的樣本,再根據樣本的覆蓋值生成點陣的圖元字型,並將圖元字型顯示在電腦螢幕上,以點陣圖元影像來顯示文字形狀。Therefore, the expression of a character shape can be represented by the value of the explicit parameter assigned to the basic stroke of each constituent glyph. The value of these stroke parameters constitutes the font data of the character, and the use of the font data to generate the glyph is a Inverse programming, first, by substituting these stroke parameter values into a pre-defined algebraic expression, each pen shape forming a glyph can be obtained, and the presentation of these pen shapes can be used to display the shape of the character. Secondly, according to this point of view, a program that fills the graph projects the graphs composed of these pen shapes into a lattice space of a specified size, and generates a sample in which the bitmap elements are covered by the graphic, and then generates a cover value according to the sample. The character font of the dot matrix is displayed, and the font of the primitive is displayed on the computer screen, and the shape of the character is displayed by the bitmap image.
文字形狀顯示於電腦螢幕上,通常是以圖元影像的形式顯示,亦即用不同圖元值所縱橫排列的影像圖呈現,其中,一個圖元代表計算器顯像裏一個最小的顯像單位,而計算器顯像則是將一個圖形以點陣圖的形式顯示在螢幕上的一個方塊區域,通常這個方塊區域是相當小的,亦即只能用少數圖元來構成文字形狀,這些少數圖元被排成點陣的樣子來呈現形狀,其中每個點陣元素值代表深淺度的圖元值,而圖元影像所呈現的文字形狀又稱為點陣字型。The shape of the text is displayed on the computer screen, usually in the form of a picture image, that is, an image picture arranged vertically and horizontally with different element values, wherein one element represents a minimum imaging unit in the calculator image. The calculator image is a block area displayed on the screen in the form of a dot matrix. Usually, the square area is quite small, that is, only a few primitives can be used to form the text shape. The primitives are arranged in a lattice to represent the shape, wherein each lattice element value represents a shallow primitive value, and the text shape represented by the primitive image is also called a dot matrix font.
如前所述,在螢幕上建造字型資料時所用的點陣圖是採用一個大範圍的畫面區域來描述以及顯示各個筆劃的形狀,這個畫面區域所含圖元的數目是遠遠超過在顯示字型時所用圖元數目的畫面區塊,換言之,字型資料是在高解析度空間上建造字形中取得。根據採樣理論,將字型資料表現成低解析度之點陣字型時就會產生將高解析度圖形轉換至低解析度上顯像的異化問題。特別是在所謂的可縮放字型技術上,這種異化現象是個難解的問題。As mentioned earlier, the bitmap used to build font data on the screen uses a wide range of screen areas to describe and display the shape of each stroke. The number of elements contained in this area is far greater than the display. The picture block of the number of primitives used in the font, in other words, the font data is obtained by constructing the glyph in the high-resolution space. According to the sampling theory, when the font data is expressed as a low-resolution dot matrix font, an alienation problem of converting a high-resolution image to a low-resolution image is generated. Especially in the so-called scalable font technology, this alienation phenomenon is a difficult problem.
對筆劃基礎字型技術而言,較低階的可縮放字型的產生需要以圖形處理技術將在高解析度上描述的字形投射成低解析度的字型來顯示,由於字形是以筆形組合而成,而筆形是用直線段和曲線段所構成之輪廓形狀在高解析度空間上被精確描述,因此只要用不同尺寸的座標值當做參數,就可以將中文形狀的描述投射至一個寬廣領域的各個不同低解析度空間上來產生和顯示各別標度的點陣字型。For stroke basic font technology, the generation of lower-order scalable fonts requires the use of graphics processing techniques to project glyphs described in high resolution into low-resolution fonts, since the glyphs are in pen-shaped combination. The pen shape is precisely described by a straight line segment and a curved segment shape in a high-resolution space, so that the description of the Chinese shape can be projected to a wide field by using the coordinate values of different sizes as parameters. The different low resolution spaces are used to generate and display the dot matrix fonts of the respective scales.
然而,可縮放字型的問題在於低解析度顯示時會使得字型的品質變差,因為低解析度的字型僅允許少量的圖元來組成其影像形狀,若由高至低的階層差距過大,則會由於採樣不足產生圖形異化現象導致變形,尤其是在處理筆劃基礎中文字型時更顯惡化,因為在低解析度空間上的筆劃更會沾黏在一起,導致筆劃形狀消失而呈現斑斑黑塊的影像。However, the problem with scalable fonts is that the quality of the fonts is degraded in low-resolution displays, because low-resolution fonts allow only a small number of primitives to form their image shape, from high to low level differences. If it is too large, it will be deformed due to insufficient image sampling, especially when the stroke type is processed, because the strokes in the low resolution space will stick together, causing the stroke shape to disappear. An image of a black spotted patch.
在以下的披露中更能清楚地瞭解到低解析度中文品質變差的現象,亦即在高解析度空間上描述的筆劃字形直接投影到低解析度空間上顯示的技術問題,是無法完整地保持原描述的圖形品質,特別是投射至相當低的解析 度時更是讓人無法接受。所以,在此情況下就需要有一種自動轉換的程式來微調原筆劃字型的資料,使得微調後的字型資料所表現的字形被投射至一個指定尺寸的低解析度上時會產生可被接受之小字字型品質的顯示,此種轉換程式又稱為產生中文小字品質的方法。In the following disclosure, it is more clearly understood that the phenomenon of low-resolution Chinese quality deterioration, that is, the technical problem of directly projecting the stroke font described on the high-resolution space to the low-resolution space is not completely complete. Maintain the graphical quality of the original description, especially to project a fairly low resolution The degree is even more unacceptable. Therefore, in this case, an automatic conversion program is needed to fine-tune the original stroke type data, so that the glyphs represented by the fine-tuned font data are projected to a low resolution of a specified size to generate Accepting the display of small font quality, this conversion program is also known as the method of generating Chinese small print quality.
本發明的目的就是要提供一種可產生中文小字品質的方法和裝置。It is an object of the present invention to provide a method and apparatus for producing Chinese small print quality.
本發明提供一種中文字形表現的轉換機制,它將在高解析度空間表現的中文字形轉換成適合於在低解析度空間表現的中文字形,因此而能自動產生適合在低解析度空間顯示之中文小字品質的點陣字型;其中,中文字形是用筆劃形狀組合而成,每個筆劃形狀是用一組其所對應之基本筆劃的參數值來表現,每個基本筆劃有外顯和內涵二種參數,外顯參數包含關鍵點和寬度,而內涵參數包含特徵點和貝茲控制點,對應某個基本筆劃之一個筆劃形狀是由一組指定的外顯參數值所決定,亦即,給了該基本筆劃之關鍵點位置以及寬度值,將它們代入定義基本筆劃的參數代數系統裏就決定了特徵點的位置,且一旦特徵點位置決定後,該代數系統再根據預先定義於每組相鄰特徵點間之坐標系的貝茲控制點決定該筆劃的輪廓形狀,所以在高解析度空間建造的每個中文字形是用組合它的基本筆劃識別碼和外顯參數值所構成之筆劃字型資料作表現,當用這些筆劃字型資料直接去填充成解析度之點陣字型時,根據採樣理論會產生低解析度中文點陣字型的顯示品質變差的現象,因些本發明所提出的中文字形表現的轉換機制仍是透過採樣的過程來轉換筆形,使得筆形覆蓋在點陣圖元區塊上得以用一些採樣的規則來作調整,使得各個筆形於變換後所決定的字形適合於在低階解 析度的空間上來顯示中文的小字品質。The invention provides a conversion mechanism of a Chinese character expression, which converts a Chinese character form expressed in a high-resolution space into a Chinese character shape suitable for expression in a low-resolution space, thereby automatically generating a Chinese suitable for display in a low-resolution space. Small dot-quality dot matrix font; wherein, the Chinese character shape is composed of stroke shapes, each stroke shape is represented by a set of parameter values of the corresponding basic strokes, and each basic stroke has an explicit and connotation two. Parameters, the explicit parameters include key points and widths, and the intrinsic parameters include feature points and Bezi control points. A stroke shape corresponding to a basic stroke is determined by a set of specified explicit parameter values, that is, The key point position and width value of the basic stroke are substituted into the parameter algebra system defining the basic stroke to determine the position of the feature point, and once the feature point position is determined, the algebra system is pre-defined according to each group of phases. The Bezi control point of the coordinate system between adjacent feature points determines the outline shape of the stroke, so each Chinese constructed in the high-resolution space The shape is represented by the stroke type data composed of the basic stroke identification code and the explicit parameter value. When these stroke type data are directly used to fill the dot matrix font of resolution, it will be generated according to the sampling theory. The phenomenon that the display quality of low-resolution Chinese dot matrix fonts deteriorates, because the conversion mechanism of the Chinese character expression proposed by the present invention is still to convert the pen shape through the sampling process, so that the pen shape covers the bitmap element block. It is possible to adjust with some sampling rules, so that the glyphs determined by each pen shape after transformation are suitable for the low-order solution. The space of the degree of analysis shows the quality of small characters in Chinese.
根據本發明的一項觀點,變換點陣字形使之適合於產生在低階解析度空間之小字品質的顯示,包含有三項主要的程式:(1)避免直筆之間或橫筆之間在點陣空間上的重迭;(2)限制筆劃覆蓋在點陣圖元區塊上的範圍;以及(3)調整筆劃來避免多個筆劃同時覆蓋在點陣圖元區塊上,或者微調筆劃來儘量避免一個筆劃之輪廓曲線的二邊線段同時覆蓋在一個圖元區塊上。According to one aspect of the invention, the transformed lattice font is adapted to produce a small-quality display in a low-order resolution space, including three main programs: (1) avoiding a point between straight pens or between horizontal pens Overlap in the array space; (2) limit the extent that the stroke covers the bitmap element block; and (3) adjust the stroke to avoid multiple strokes covering the bitmap element block at the same time, or fine-tune the stroke Try to avoid the two-sided line segment of a stroke's contour curve covering one element block at the same time.
根據本發明的另一項觀點,為了避免筆劃沾黏所採取之限制筆劃覆蓋在點陣圖元上的範圍,其規則是以移動筆劃關鍵點至其所座落圖元區塊的中心線,並以關鍵點為中心之線段長為寬度值的線段覆蓋在圖元區塊範圍,作為測度筆劃是否有佔據了一個以上的圖元區塊,若有則縮減寬度值來限制筆劃關鍵點所控制之筆形部份的覆蓋範圍僅限於一個圖元區塊內,最後以移動後的關鍵點位置和縮減後的寬度值來更新字型資料。According to another aspect of the present invention, in order to avoid the limitation that the strokes of the strokes are covered on the bitmap elements, the rule is to move the stroke key points to the center line of the pixel block in which they are located. The line segment with the length of the line segment centered on the key point is covered in the extent of the picture element block, and whether the measurement stroke has occupied more than one picture element block, if any, the width value is reduced to limit the control of the stroke key point. The coverage of the pen-shaped portion is limited to one primitive block, and finally the font data is updated with the moved key position and the reduced width value.
根據本發明的又一項觀點,為了避免多個筆劃同時佔據一個圖元區塊,其規則是以移動關鍵點來移離筆劃不再佔據該圖元區塊,以及為了避免一個筆劃之外形的二邊同時覆蓋在一個圖元區塊上,也是以移動關鍵點來使得該圖元區塊的筆劃覆蓋比例值低於一個預先設定值。According to still another aspect of the present invention, in order to avoid that a plurality of strokes occupy one primitive block at the same time, the rule is that moving the key point away from the stroke no longer occupies the primitive block, and in order to avoid a stroke shape The two sides are simultaneously covered on one primitive block, and the moving key point is also used to make the stroke coverage value of the primitive block lower than a preset value.
根據本發明的再一項觀點,本發明提供一種產生中文小字品質之顯示的系統,這種系統包含有(1)接受在高解析度空間上建造之筆劃基礎之中文字型資料的裝置;(2)佈置字型資料所表現之中文字形於點陣坐標系裏的置;(3)分析那些組成中文字形之筆劃覆蓋於點陣圖元區塊上之樣本的裝置;(4)轉換中文字形來重新佈置筆劃覆蓋於點陣圖元區塊上的裝置;以及(5)採用 轉換後表現中文字形之字型資料於填充演算程式裏運作產生中文小字品質顯示的裝置。According to still another aspect of the present invention, the present invention provides a system for generating a display of Chinese small print quality, the system comprising: (1) means for accepting textual data in a stroke based on a high resolution space; 2) arranging the characters in the font data to be placed in the lattice coordinate system; (3) analyzing the devices that form the strokes of the Chinese character in the bitmap element block; (4) converting the Chinese character To rearrange the arrangement of the stroke on the bitmap element block; and (5) After conversion, the Chinese character font data is displayed in the filling calculation program to produce a Chinese small character display device.
圖1表示一個構成中文字形之筆劃基礎字型資料的例子,其中圖1A表示一個中文字形10是由筆形11和筆形12二個筆劃所組成,而筆形11是識別碼511的基本筆劃所生成,筆形12是識別碼623的基本筆劃所生成,定義一個基本筆劃的外顯參數包含有關鍵點和寬度二項,如圖1A所示,基本筆劃識別碼13裏的511是由關鍵點14裏的二個關鍵點K1 和K2 的位置以及寬度15裏的一個寬度W1 的值來定義筆形11;而識別碼623是由K3 和K4 的位置以及寬度W2和W3的值來定義筆形12,換言之,中文字形10是由這些基本筆劃識別碼、關鍵點位置、和寬度值所代表的筆形11和筆形12所組成,所以圖1A的這些外顯參數值就構成了代表中文字形10的筆劃基礎字型資料。1 shows an example of a basic type of character constituting a stroke of a Chinese character, wherein FIG. 1A shows that a Chinese character 10 is composed of two strokes of a pen 11 and a pen 12, and the pen 11 is generated by a basic stroke of the identification code 511. The pen shape 12 is generated by the basic stroke of the identification code 623. The explicit parameter defining a basic stroke includes two points of key points and widths. As shown in FIG. 1A, the 511 in the basic stroke identification code 13 is determined by the key point 14. The position of the two key points K 1 and K 2 and the value of a width W 1 in the width 15 define the pen shape 11; and the identification code 623 defines the pen shape by the positions of K 3 and K 4 and the values of the widths W2 and W3. 12. In other words, the Chinese character 10 is composed of the basic stroke identification code, the key point position, and the pen shape 11 and the pen shape 12 represented by the width value, so that the external parameter values of FIG. 1A constitute the representative Chinese character 10 Stroke basic font data.
每個基本筆劃是採用參數來定義一個其筆劃生成過程的一個代數系統,例如圖1B所示的代數式是用來決定筆形11上的特徵點f1 、f2 和f3 以及筆形12上的特徵點f4 、f5 和f6 在字型空間上的位置,換言之,這些特徵點的位置可由代入字型資料到預先定義的這些式子來決定,而圖1C表示相鄰的二個特徵點間的貝茲控制點可透過預先定義在該二個點所構成之邏輯座標上的位置來決定,例如圖1C所示相鄰特徵點f5 和f6 之間貝茲控制點C1 、C2 、C3 是由它們預先定義在方塊17所構成之邏輯座標位置所決定,當每組相鄰特徵點依順(或反)時針方向被串連起來後,就構成一個貝茲控制多 邊形18,根據這個貝茲控制多邊形18所計算出來的封閉曲線就構成筆形12的輪廓形狀,為了說明本發明在以下的披露,圖1D表示在基本筆劃的定義下之任一關鍵點所控制的筆形部份19,筆形部份19會隨著關鍵點的移動以及寬度值的縮減而改變其形狀和位置。Each basic stroke is an algebraic system that uses parameters to define a stroke generation process. For example, the algebraic equation shown in FIG. 1B is used to determine feature points f 1 , f 2 , and f 3 on the pen shape 11 and features on the pen shape 12. The positions of points f 4 , f 5 and f 6 in the font space, in other words, the positions of these feature points can be determined by substituting the font data into the predefined expressions, and FIG. 1C shows the adjacent two feature points. The Bezi control point can be determined by pre-defining the position on the logical coordinates formed by the two points, for example, the Bezi control points C 1 , C between adjacent feature points f 5 and f 6 shown in FIG. 1C 2 , C 3 is determined by their predefined logical coordinate positions formed at block 17, and each set of adjacent feature points are connected in a cis (or inverse) clockwise direction to form a Bezi control polygon 18 The closed curve calculated from the Bezi control polygon 18 constitutes the contour shape of the pen shape 12. To illustrate the disclosure of the present invention, FIG. 1D shows the pen portion controlled at any key point under the definition of the basic stroke. 19, pen department Part 19 changes its shape and position as the key points move and the width value decreases.
所以,筆劃基礎字型技術是由二個過程組成:第一個過程是對一套中文字形樣本先行定義一個基本筆劃集,使得透過它們的代數系統可以組合該套樣本裏的所有字形,藉此組合來建造代表這些字形的筆劃基礎字型資料;第二個過程是用字型資料來產生中文字形以及顯示中文字形的圖元影像或圖元影像於電腦的螢幕上。圖2表示用字型裏的筆劃資料來產生筆劃外形之方法的流程圖20,如方塊21所示,這個方法的第一項步驟是如方塊21所示,首先接收一個基本筆劃碼以及其所對應之關鍵點位置和寬度值的筆劃資料,其次如方塊22所示,再去呼叫一個計算機程式來執行該基本筆劃所定義的代數系統,因此如方塊23所示,經由代入關鍵點位置和寬度值於預先定義的方程式中取得各個特徵點的位置,再如方塊24所示,經由預先定義在相鄰特徵點之間坐標系上的貝茲控制點來取得每個控制點在字型空間上的位置,如方塊25所示,這些貝茲控制點於是被連接成一個貝茲控制多邊形,最後如方塊26所示,用這個貝茲控制多邊形來產生對應這個基本筆劃的一個筆形。Therefore, the stroke basic font technique consists of two processes: the first process is to first define a basic stroke set for a set of Chinese character samples so that the algebraic system through them can combine all the glyphs in the set of samples. The combination is used to construct stroke basic font data representing these glyphs; the second process is to use font data to generate Chinese characters and display Chinese character image or graphic images on the screen of the computer. 2 is a flow chart 20 showing a method of generating a stroke shape using stroke data in a font. As shown in block 21, the first step of the method is to first receive a basic stroke code and its contents as shown in block 21. The stroke data corresponding to the key point position and width value is next, as shown in block 22, and then a computer program is called to execute the algebraic system defined by the basic stroke, so as shown in block 23, by substituting the key position and width The values of the respective feature points are obtained in a predefined equation, and as shown in block 24, each control point is obtained on the font space via a Bezi control point defined in a coordinate system between adjacent feature points. The position, as indicated by block 25, is then connected to a Bezi control polygon, and finally, as shown in block 26, the Bezi control polygon is used to generate a pen shape corresponding to the basic stroke.
當要顯示中文字形於計算器的螢幕上時,此時需要有一個填充的程式,這個程式首先將中文字形投射到一個指定尺寸的圖元影像空間上,於是產生中文字形覆蓋在圖元上,經由圖形相交之演算計算後,每個圖元就能收 集到中文字形覆蓋其上的一些資訊當做樣本,然後根據各種不同的樣本來決定一個圖元覆蓋值,並用此值當作顯示該圖元影像的深淺度。通常這個指定尺寸的圖元影像空間是取一個以圖元方塊縱橫排列的點陣,例如圖3所示的點陣字形,圖3A表示一個點陣空間30,它以左上角的端點31為空間座標的原點,在示範的例子中,點陣空間30是由8列和8行的點陣圖元構成,如圖3B所示,一個圖元區塊在點陣空間上的座標是取它在列和行的位置順序,例如圖元方塊區塊34是在列32的第4個位置和在行33的第3個位置,因此圖元區塊34在點陣空間30的座標為(4、3),所以,若將中文字形10投射在點陣空間30上(圖3A),則描述字形10的筆劃參數值,亦即關鍵點位置和寬度值,它們所投射到的圖元區塊以及佔據的大小等資訊,統可由空間的轉換來取得,也因此筆形覆蓋在圖元的資訊可以被抽樣測知,例如圖3C所示,圖元區塊36被筆形11的小部份覆蓋;圖元區塊37包含筆形11的關鍵點K2 ,因此這個圖元區塊是被K2 所控制筆形的二端線段所夾的筆形部份覆蓋;圖元區塊35雖包含筆形12的關鍵點K4 ,但是筆形覆蓋其上並不包含其外形之二端線段包圍的部份;圖元區塊38雖然不包含關鍵點,亦即不是關鍵點所控制的筆形部份,但是它包含筆形二端線段所包圍的部份,其中判斷筆形覆蓋一個圖元以及佔據的面積,可從圖元方塊和貝茲控制多邊形之相交演算法的計算中獲得。When the Chinese character is to be displayed on the screen of the calculator, a padding program is needed at this time. The program firstly projects the Chinese character into a picture space of a specified size, so that the Chinese character is overlaid on the picture element. After calculation by graph intersection calculation, each primitive can collect some information of the Chinese character overlay on it as a sample, and then determine a primitive coverage value according to various samples, and use this value as the display primitive. The depth of the image. Usually, the image space of the specified size image is a dot matrix arranged in a vertical and horizontal direction of the primitive block, for example, the dot matrix font shown in FIG. 3. FIG. 3A shows a dot matrix space 30, which is the end point 31 of the upper left corner. The origin of the space coordinates, in the exemplary example, the lattice space 30 is composed of 8 columns and 8 rows of bitmap elements, as shown in FIG. 3B, the coordinates of a primitive block in the lattice space are taken. Its positional order of columns and rows, for example, primitive block block 34 is at the 4th position of column 32 and at the 3rd position of row 33, so the coordinates of primitive block 34 in lattice space 30 are ( 4, 3), therefore, if the Chinese character 10 is projected on the lattice space 30 (Fig. 3A), the stroke parameter values of the glyph 10, that is, the key point position and the width value, which are projected to the primitive area, are described. The information such as the size of the block and the size occupied can be obtained by the conversion of the space, and thus the information of the pen-shaped overlay on the primitive can be sampled and detected. For example, as shown in FIG. 3C, the primitive block 36 is covered by a small portion of the pen shape 11. ; FIG metablock containing 37 key points of the pen 11 K 2, so this FIG metablock are controlled by K 2 Pencil-shaped second end segment portion sandwiched cover; FIG metablock comprising 35 keys, although the pen 12 K 4, but which is not covered pencil its second end segment comprising a portion of the outer shape surrounded; primitive area Block 38 does not contain a key point, that is, a pen-shaped portion that is not controlled by a key point, but it includes a portion surrounded by a pen-shaped two-end line segment, wherein the pen shape covers a primitive and the occupied area can be obtained from the primitive block. Obtained in the calculation of the intersection algorithm of the Bezi control polygon.
圖3D表示從佈置中文字形在點陣空間上所產生筆劃覆蓋在點陣圖元上的一些樣本,例如標示41和42的撇筆頂部之關鍵點所控制的筆形是一條直線段,且這條直線段會橫跨二個圖元,標示43和44分別的圖元含有二 個不同筆劃的二個關鍵點,標示45和46分別的關鍵點所控制的筆形區覆蓋在多個圖元區塊上,標示47的圖元被二個不同筆劃覆蓋其上,但只含其中一個筆劃的關鍵點,而標示48則含有二個不同筆劃的關鍵點,且其中一個關鍵點控制的筆形區(為一條直線)覆蓋在二個圖元區塊,標示49的圖元含有一個筆劃的關鍵點以及它所控制的筆形區。Figure 3D shows some samples overlaid on the bitmap elements from the strokes generated in the arrangement of the characters in the lattice space. For example, the strokes controlled by the key points on the top of the markers of 41 and 42 are a straight line segment, and this The straight line segment will span two primitives, and the primitives labeled 43 and 44 respectively contain two Two key points of different strokes, the pen-shaped areas controlled by the key points of 45 and 46 respectively are covered on multiple primitive blocks, and the elements marked with 47 are covered by two different strokes, but only The key point of a stroke, while the indication 48 contains two key points of different strokes, and one of the key points controlled by the pen area (which is a straight line) is covered in two primitive blocks, and the element marked 49 contains a stroke. The key point and the pen area it controls.
如上所述,吾人可從每個圖元區塊被筆劃覆蓋的狀況所衍生的樣本,瞭解到怎樣去設定圖元覆蓋值並據以塗黑,例如圖4的點陣字型40是將圖3之圖元區塊所被覆蓋的樣本塗黑成一個二進位元的點陣影像,而圖5的點陣字型50是將圖3之圖元區塊所被覆蓋的樣本塗黑成一個灰度的點陣影像。一般而言,將圖元區塊塗黑的規則有二:(1)若一個圖元區塊被筆劃覆蓋的比例值超過一個預先設定值,例如覆蓋了一半以上的圖元區塊的面積,則將這個圖元塗成黑點或較深的灰值;(2)若一個圖元區塊同時被筆劃外形二端的線段所圍成的部份筆形所覆蓋;其中(2)是為了避免產生斷線的視覺效果,因此將它塗成黑點或較深的灰值,所以若一個圖元區塊包含有關鍵點則這個圖元區塊必然被塗黑,而若一個圖元區塊沒有含關鍵點但被部份筆形覆蓋且不含筆形二端線段和覆蓋比例值小於預先設定值,則這個圖元區塊必然不會被塗黑。As described above, from the sample derived from the condition that each primitive block is covered by the stroke, we can understand how to set the primitive coverage value and black out it. For example, the dot matrix font 40 of FIG. 4 is a map. The sample covered by the primitive block of 3 is blackened into a bitmap image of the binary, and the dot matrix 50 of FIG. 5 is blackened by the sample covered by the primitive block of FIG. Grayscale dot matrix image. In general, there are two rules for blackening a primitive block: (1) if the scale value of a primitive block covered by a stroke exceeds a predetermined value, for example, covers an area of more than half of the primitive block, Then, the primitive is painted as a black dot or a darker gray value; (2) if a primitive block is covered by a part of the pen surrounded by the line segment of the stroke shape; (2) is to avoid The visual effect of the broken line, so it is painted as a black dot or a darker gray value, so if a primitive block contains key points, the primitive block must be blacked out, and if a primitive block does not have If the key point is covered but partially covered by the pen and the pen-shaped two-end line segment is not included and the coverage ratio value is less than the preset value, the picture element block will not be blacked out.
以上的敍述說明瞭目前筆劃基礎字型的技術,這項技術被廣泛地應用於產生可縮放字型,然而用這項技術來產生低解析度的中文字形,例如16×16或以下之低解析度的可縮放字型,就會有嚴重的小字品質的問題,因為在低解析度空間上來顯示在高解像空間所建造的組合筆劃或者多個組 合圖樣(Glyphs)的一個中文字形時,不可避免地會產生筆劃或圖樣沾黏在一塊的現象。The above description illustrates the current technique of stroke basic fonts, which is widely used to generate scalable fonts. However, this technique is used to produce low-resolution Chinese characters, such as low resolution of 16×16 or less. Degree of gradual fonts, there will be serious small word quality problems, because in the low resolution space to display the combined strokes or groups built in the high resolution space When a Chinese character of a Glyphs is formed, it is inevitable that a stroke or a pattern will stick together.
最常見的這種筆劃沾黏在一塊的現象是相鄰二個橫筆(或直筆)之間,在低解像空間上因為間隙的空間不足以分開它們,而產生相鄰二個筆劃沾黏在一塊的現象,圖6表示二個相鄰橫筆沾黏一起的一個例子,如圖6A所示,根據填充演算法的規則,中文字形60的橫筆62會佔據點陣之第5列的圖元區塊,而第6列的中間部份圖元區塊會被另一個橫筆63覆蓋,致使相鄰的二個橫筆(橫筆62和橫筆63)之間沒有一列空白間隙的圖元空間來分開它們,因而對中文字形60做塗黑時就會產生如圖6B的筆劃沾黏現象。The most common phenomenon in which such strokes stick together is between two adjacent horizontal pens (or straight pens). In the low resolution space, because the space of the gap is not enough to separate them, the adjacent two strokes are sticky. In the case of a block, FIG. 6 shows an example in which two adjacent pens are glued together. As shown in FIG. 6A, according to the rule of the padding algorithm, the pen 62 of the Chinese character 60 occupies the fifth column of the dot matrix. The primitive block, and the middle portion of the sixth column is covered by another horizontal pen 63, so that there is no blank gap between the adjacent two horizontal pens (the horizontal pen 62 and the horizontal pen 63). The primitive space separates them, so that when the Chinese character 60 is blackened, the stroke of the stroke of Fig. 6B is generated.
另外一種常見的筆劃沾黏的現象,會發生在筆劃較多的中文字形上,例如圖7所示的例子,如圖7A所示,中文字形70是由許多筆劃所組成,因而造成這些筆劃所覆蓋的圖元區塊緊密相連在一起,例如圖元區塊73和74的二個區塊,以及圖元區塊75、76和77的三個區塊都是彼此之間緊密相連在一起,使得這些區域經由填充演算法的塗黑程式處理後,會產生如圖7B所示的黑塊,因而造成不能被接受的中文小字品質。Another common phenomenon of stroke sticking occurs in the middle of a stroke with a large number of strokes. For example, as shown in Fig. 7, as shown in Fig. 7A, the Chinese character 70 is composed of a plurality of strokes, thereby causing the strokes. The covered primitive blocks are closely linked together, for example, two blocks of primitive blocks 73 and 74, and three blocks of primitive blocks 75, 76, and 77 are closely connected to each other. After these areas are processed by the blackening program of the padding algorithm, a black block as shown in FIG. 7B is generated, resulting in an unacceptable Chinese small character quality.
在以下的披露,本發明提出一種可以提升中文小字品質的解決方案,它是一種在點陣空間上轉換中文字形的方法,使得轉換後的字形在點陣圖元上的樣本覆蓋會趨於一致,因此而增加了空白圖元的數目,以及盡可能避免產生筆劃沾黏的現象,藉此來提升中文小字品質。然而,這種在點陣空間上轉換中文字形的方法需要增加字型資料的一些資訊,這些資訊包含可偵知筆劃的種類,以決定是否為可在點陣空間上隨意移動的直、橫、斜的 獨立筆劃,或者是否為不可隨意移動的複合筆劃,以及可偵知是否為水準的寬度或者垂直的寬度來決定筆劃移動的方向等。In the following disclosure, the present invention proposes a solution for improving the quality of Chinese small characters, which is a method for converting Chinese characters in a lattice space, so that the sample coverage of the converted glyphs on the bitmap elements tends to be uniform. Therefore, the number of blank primitives is increased, and the phenomenon of scratches on the strokes is avoided as much as possible, thereby improving the quality of Chinese characters. However, this method of converting Chinese characters in the lattice space requires some information of the font data, which includes the types of detectable strokes to determine whether it is straight or horizontal, which can be freely moved in the lattice space. slanted Independent strokes, or whether it is a compound stroke that cannot be moved freely, and whether it is a horizontal width or a vertical width to determine the direction in which the stroke moves.
如圖8所示,傳統的中文筆劃是被分成點、撇、捺、橫、豎、勾等類別,在以下的披露中,中文筆劃覆蓋在點陣圖元的樣本裏是被分成三種,第一種是垂直或水準的獨立筆劃,第二種是非垂直或非水準的獨立筆劃,第三種是如圖9所示的關節筆劃,關節筆劃是由至少二個獨立筆劃構成,關節筆劃在一個點陣圖元的樣本裏會包含二個或更多個分別來自不同筆劃之關鍵點,而且,在填充的演算法裏,這種被關節筆劃所覆蓋的圖元是被定義為黑點,所以,這些關節筆劃的關鍵點是不能被移離其所座落之圖元區塊的,換言之,構成關節筆劃之獨立筆劃在關節處是不能被分開的。As shown in Fig. 8, the traditional Chinese strokes are divided into points, 撇, 捺, horizontal, vertical, and hook categories. In the following disclosure, the Chinese strokes are divided into three types in the sample of the bitmap elements. One is a vertical or horizontal independent stroke, the second is a non-vertical or non-level independent stroke, the third is a joint stroke as shown in Figure 9, the joint stroke is composed of at least two independent strokes, the joint stroke is in one The sample of the bitmap element contains two or more key points from different strokes, and in the filled algorithm, the element covered by the joint stroke is defined as a black point, so The key point of these joint strokes is that they cannot be removed from the primitive block in which they are located. In other words, the independent strokes that make up the joint stroke cannot be separated at the joint.
圖10A和10B表示獨立筆劃之關鍵點在其座落之圖元區塊內移動的方式和範圍,如果是移動和水準寬度定義相關之關鍵點,則如圖10A所示,將關鍵點往水平方向移動至其所座落圖元區塊之垂直中線93上,而如果是移動和垂直寬度定義相關之關鍵點,則如圖10B所示,將關鍵點往垂直方向移動至其所座落圖元區塊之水平中線94上。圖10C和圖10D表示一種線段的求法,該線段是取關鍵點為中點並以寬度值為其長度,如果該線段是由水準寬度定義,則如圖10C所示,該線段是個水平線段95,而如果該線段是由垂直寬度定義,則如圖10D所示,該線段是個垂直線段96。10A and 10B show the manner and range in which the key points of the independent stroke move within the primitive block in which they are located. If it is a key point related to the definition of the movement and level width, as shown in FIG. 10A, the key point is leveled. The direction is moved to the vertical center line 93 of the block in which it is located, and if the moving and vertical width define the relevant key points, as shown in FIG. 10B, the key point is moved vertically to the position where it is located. The horizontal midline 94 of the primitive block. 10C and 10D show a method of finding a line segment which takes a key point as a midpoint and a width value as its length. If the line segment is defined by a level width, as shown in FIG. 10C, the line segment is a horizontal line segment 95. And if the line segment is defined by the vertical width, as shown in FIG. 10D, the line segment is a vertical line segment 96.
圖11的流程圖110表示本發明所披露的方法,如圖11方塊112所示,本方法所接收到的資料是如圖1A所示之筆劃基礎字型的資料,包括基本筆劃碼13,關鍵點14、寬度15、以及筆劃類別和寬度屬性(水準或垂直)等資 訊,這些資料構成表現一個在高解析度影像空間上被建造的中文字形。其次如方塊114所示,本方法將這些資料以及它們所表現的字形放入一個被指定尺寸之點陣的座標(圖3),於是,如方塊116所示,根據點陣圖元區塊所收集到之筆劃覆蓋其上的樣本進行分析,並藉以調整字型資料來從事轉換字形,使得調整後的字型資料所表現的新字形,更適合於在低解析度空間上填充產生小字品質的顯示,最後如方塊118所示,對描繪新字形來產生指定尺寸的點陣字型。The flowchart of FIG. 11 shows the method disclosed in the present invention. As shown in block 112 of FIG. 11, the data received by the method is the basic data of the stroke as shown in FIG. 1A, including the basic stroke code 13, the key. Point 14, width 15, and stroke category and width attributes (level or vertical) The information constitutes a Chinese character that is constructed in a high-resolution image space. Next, as indicated by block 114, the method places the data and the glyphs they represent into a coordinate of a lattice of a specified size (Fig. 3), thus, as indicated by block 116, according to the bitmap primitive block. The collected strokes cover the samples on it for analysis, and the font data is adjusted to engage in the conversion of the glyphs, so that the new glyphs represented by the adjusted font data are more suitable for filling the low-resolution space with small-word quality. Display, and finally, as indicated by block 118, a new glyph is drawn to produce a bitmap font of a specified size.
這種採用在點陣空間上轉換中文字形的方法包含三個程式,第一個程式是在點陣空間上佈置直筆和橫筆,使得二個直筆(或橫筆)之間至少有一列或一行之點陣圖元區塊的間隙來分開它們,第二個程式是去限縮筆劃覆蓋於點陣圖元上的範圍,使得筆劃之關鍵點和寬度所控制的筆形部份不至於橫跨一個以上的圖元區塊,第三個程式是去排除多個筆劃同時佔據在一個圖元上,以及一個獨立筆劃之非關鍵點控制的筆形部份會有筆形二端線段覆蓋在一個圖元上。This method of converting a Chinese character in a lattice space consists of three programs. The first program is to arrange a straight pen and a horizontal pen on the dot matrix space so that there is at least one column or row between the two straight pens (or horizontal pens). The gap between the dot matrix blocks separates them. The second program is to limit the extent of the strokes over the bitmap elements so that the strokes controlled by the key points and widths of the strokes do not span one In the above primitive block, the third program is to exclude multiple strokes from occupying one primitive at the same time, and the pen-shaped portion of the non-key point control of a separate stroke has a pen-shaped two-end line segment covering one primitive. .
圖12表示本發明所披露之採用轉換中文字型資料來產生低解析度中文小字品質的方法,如圖12流程圖120所示,首先在方塊121接收在高解析度空間上所建造表現一個字形的字型資料,然後開始依序執行本發明方法的三項程式,如方塊122所示,第一項程式是去佈置直、橫筆在點陣空間上的位置,使得直筆或橫筆之間不會有沾黏的現象會發生,因此如方塊123所示,首先測試是否有足夠的空間來容納它們的佈置,以及如果不夠空間佈置時,則如方塊124所示,通知字型設計人用一個簡化體裁的文字來重 組這個文字,如果是有足夠空間佈置時,則在完成第一個程式後就已經移動了直、橫筆,也已經更新了部份的字型資料,接著如方塊125所示,進行第二個程式,亦即執行限縮筆劃覆蓋於點陣圖元範圍的任務,最後如方塊126所示,進行第三個程式,亦即執行重新調整筆劃覆蓋於各個點陣圖元區塊上的狀況,以排除多個筆劃同時覆蓋在同一個圖元上,以及多餘的筆劃覆蓋。FIG. 12 shows a method for generating low-resolution Chinese small character quality by using the converted Chinese character type data disclosed in the present invention. As shown in a flowchart 120 of FIG. 12, first, at block 121, a glyph is constructed to be constructed on a high-resolution space. The font data, and then begin to execute the three programs of the method of the present invention in sequence, as shown in block 122, the first program is to arrange the position of the straight and horizontal pen in the lattice space, so that between the straight pen or the horizontal pen No sticking will occur, so as indicated by block 123, first test if there is enough room to accommodate their placement, and if there is not enough space, then as indicated by block 124, the font designer is notified. a simplified genre of text to emphasize Group this text, if there is enough space to arrange, then after the first program is completed, the straight and horizontal pens have been moved, and some font data has been updated, and then as shown in block 125, the second a program, that is, a task of performing a limit-restricted stroke covering the range of the bitmap element, and finally, as shown in block 126, performing a third program, that is, performing a re-adjustment stroke covering the conditions of each bitmap element block. To exclude multiple strokes while overwriting the same primitive, as well as extra stroke coverage.
為了避免如圖6所示二個相鄰橫筆擁塞在一起的問題,圖13表示一種用移動關鍵點方式來解決這個問題,如圖13A所示,移動落在區塊62(圖6A)之橫筆的關鍵點往上移,使得該二個相鄰橫筆之間至少有一列空白的圖元區塊來分隔它們,就可避免它們的沾黏,也才能得到如圖13B所示的塗黑結果。惟,如果點陣空間沒有足夠的空隙來分隔一個文字的直、橫筆時,則需要讓字型設計人知道這種狀況,例如圖14表示一個具有6個橫筆的漢字140,需要被放置在一個10×10的點陣空間上,這時就會產生沒有足夠的空隙來區隔它們的現象,而產生如圖14B的塗黑文字141。為了避免這種現象的產生,因此,當字型設計人接收到不足空間的訊息時,就需要再重組一個文字來取代它,例如圖15A所示,字型設計人可能用一個簡化體裁的文字150來取代文字140,以產生如圖15B所示的塗黑字型。In order to avoid the problem of two adjacent pens being congested as shown in Fig. 6, Fig. 13 shows a problem by solving the problem by moving key points, as shown in Fig. 13A, the movement falls on block 62 (Fig. 6A). The key point of the horizontal pen is moved upwards, so that at least one column of blank primitive blocks are separated between the two adjacent horizontal pens to avoid their adhesion, and the coating as shown in FIG. 13B can be obtained. Black result. However, if the lattice space does not have enough space to separate the straight and horizontal pens of a character, then the font designer needs to know the situation. For example, Figure 14 shows a Chinese character 140 with 6 horizontal pens, which needs to be placed. In a 10 x 10 dot matrix space, there is a phenomenon that there are not enough gaps to separate them, resulting in a blackened text 141 as shown in Fig. 14B. In order to avoid this phenomenon, when the font designer receives the message of insufficient space, it needs to reorganize a text to replace it. For example, as shown in Fig. 15A, the font designer may use a simplified genre text. 150 is substituted for the text 140 to produce a blackened font as shown in Fig. 15B.
圖16的流程圖160表示圖12方塊122所示的第一個處理程式,首先如方塊161所示,從字型資料之基本筆劃的解碼中收集到一個文字的橫筆和直筆,再如方塊163所示,將每個直筆的關鍵點投射至點陣坐標系的X-軸,以及橫筆的關鍵點投射至Y-軸,然後如方塊165所示,以移動關鍵 點和限縮寬度值的方式,將每個以投射關鍵點為中心點的寬度線段限制在一個圖元的長度裏,並且如方塊167所示,以遊走關鍵點在鄰近圖元區塊中心線上之位置的方式,使得任何二個相鄰的直筆或橫筆皆至少有一個點陣圖元的長度來區隔它們彼此,最後如方塊169所示,採用新的關鍵點位置以及新的寬度值來更新字型資料以完成本發明方法的第一個處理程式。The flowchart 160 of FIG. 16 represents the first processing routine shown in block 122 of FIG. 12. First, as shown in block 161, a horizontal pen and a straight pen of a character are collected from the decoding of the basic stroke of the font data, and As shown at 163, the key points of each straight pen are projected onto the X-axis of the lattice coordinate system, and the key points of the horizontal pen are projected onto the Y-axis, and then as shown in block 165, to move the key Point and limit the width value, each width line segment centered on the projection key point is limited to the length of one primitive, and as shown in block 167, to move the key point on the center line of the adjacent primitive block The position is such that any two adjacent straight or horizontal pens have at least one dot element length to distinguish them from each other, and finally, as indicated by block 169, a new key position and a new width value are used. The font data is updated to complete the first processing of the method of the present invention.
圖17的流程圖170表示圖12方塊125所示的第二個處理程式,首先如方塊171所示,將一個文字裏的非直筆和非橫筆收集起來,並且算出它們各個關鍵點所控制之筆形部份所覆蓋的點陣圖元區塊,再如方塊173所示,查看是否有筆劃的寬度值超過一個圖元的長度,如果有這種情形,則如方塊175所示,將該寬度所對應的關鍵點移至其所座落之圖元區塊的中心線,並縮減寬度值,使得關鍵點控制之筆形區(此時通常是一個線段或接近一個線段)會落在一個圖元區塊內,再如方塊176所示,查看其關鍵點控制之筆形區是否覆蓋多個圖元區塊,以及被覆蓋的圖元不含有關節類的筆劃,如果有這種情形,則方塊177所示,移動關鍵點至被覆蓋最多的那個圖元區塊的中心線並縮減寬度值,使得最後移動關鍵點控制筆形區會落在一個圖元區塊內,而如果被覆蓋的圖元區塊中有含被關節類筆劃覆蓋的圖元,則如方塊178所示,不移動它們來保持所有關節筆劃的關鍵點一直待在同一個圖元區塊內,最後如方塊179所示,採用新的關鍵點位置和新的寬度值來更新字型資料以完成第二個處理程式。Flowchart 170 of Fig. 17 shows the second processing routine shown in block 125 of Fig. 12. First, as shown in block 171, the non-linear and non-pencils in a text are collected and calculated by their respective key points. The bitmap element block covered by the pen portion is further displayed as shown in block 173 to see if the width of the stroke exceeds the length of one primitive. If this is the case, the width is as shown in block 175. The corresponding key point is moved to the center line of the primitive block in which it is located, and the width value is reduced, so that the pen-shaped area of the key point control (in this case, usually a line segment or a line segment) will fall on one primitive. In the block, as shown in block 176, it is checked whether the pen-shaped area controlled by the key point covers multiple primitive blocks, and the covered primitive does not contain the stroke of the joint class. If this is the case, block 177 As shown, moving the keypoint to the centerline of the most covered primitive block and reducing the width value, so that the last moving key control pen area will fall within a primitive block, and if the covered primitive area There is a inclusion in the block The primitives covered by the section strokes are as shown in block 178. They are not moved to keep the key points of all joint strokes in the same primitive block. Finally, as shown in block 179, the new key position is used. And the new width value to update the font data to complete the second handler.
圖18A之點陣文字字形180是經由執行流程圖170之程式,處理圖7A之點陣文字字形70後所得到的結果,其中標示182、184、186、187各別 的圖元區塊是處理文字字形70裏有撇筆之部份筆形覆蓋多個圖元區塊後的結果,因為這些撇筆的頂部筆形皆覆蓋了多於一個圖元區塊,所以經由移動控制這些頂部筆形之各個關鍵點至它們分別所座落之圖元區塊的中心線,並且經由縮減寬度值,於是將它們的頂部筆形的覆蓋限制在一個圖元區塊裏,其他的筆劃覆蓋情形如標示188,189也是經由處理筆形覆蓋圖元區域之限制所得到的結果,標示83和84是處理一個筆劃覆蓋多個圖元後的結果,而標示87則是不能移動的關節類筆劃覆蓋,圖18B是對應圖18A的塗黑字型,這時不難發現,圖18B的塗黑字型仍然有一些沾黏的現象,例如標示181的圖元區塊是由於有超過二個筆劃的覆蓋所導致的沾黏,而標示183的圖元區塊是由於有一個獨立筆劃之非關鍵點控制的筆形區的二端線段同時落入在同一個圖元區塊裏所導致,然而標示86的筆劃覆蓋是一定會產生非關鍵點控制的筆形區的二端線段同時落在一個圖元區塊內的情形,亦即無法借由移動筆劃之關鍵點來避免這種現象的產生。The dot matrix font glyph 180 of FIG. 18A is a result obtained by processing the dot matrix character glyph 70 of FIG. 7A by executing the flowchart of the flowchart 170, wherein the labels 182, 184, 186, and 187 are respectively indicated. The primitive block is the result of processing a part of the pen in the text glyph 70 to cover a plurality of primitive blocks, because the top pens of the pens cover more than one primitive block, so Control the key points of these top pens to the centerline of the primitive blocks they are located in, and by reducing the width values, then limit their top pen-shaped coverage to one primitive block, and other strokes cover The situation, such as the indications 188, 189, is also the result of processing the limit of the pen-shaped overlay primitive area, the indications 83 and 84 are the result of processing one stroke covering a plurality of primitives, and the indication 87 is the movement of the joint type stroke that cannot be moved. Fig. 18B corresponds to the black-painted shape of Fig. 18A. It is not difficult to find that the black-painted shape of Fig. 18B still has some sticking phenomenon. For example, the primitive block labeled 181 is covered by more than two strokes. The resulting sticking is caused by the fact that the two-end line segment of the pen-shaped area controlled by the non-key point of a separate stroke falls into the same primitive block at the same time, however 86 is shown covering the stroke will produce two-terminal segment of non-critical region of the pen point control in case of a fall while FIG metablock, i.e. not to prevent this phenomenon by means of the stroke movement of the key points.
所以當完成第一和第二程式後,仍然需要去查驗被筆劃覆蓋之圖元區塊的樣本中,是否有如標示181和標示183的情況,若有,則需進行如圖19所示之流程圖190之第三項程式的處理,首先如方塊191所示,收集被筆劃覆蓋的所有圖元區塊,然後對每一個圖元區塊進行如方塊192所示之處理,亦即計算各個筆劃覆蓋在圖元區塊上的覆蓋面積,如方塊196所示,取出大於預先設定值者,再如方塊193所示,查看是否有多個筆劃覆蓋,若是多個筆劃同時覆蓋其上時,則如方塊197所示,移動那個佔據最大面積之筆劃的關鍵點,將該筆劃移離使之不會覆蓋在其上,反之,若僅有一 個筆劃的筆形覆蓋其上時,則如方塊194所示,查看是否有非關鍵點控制的筆形的二端線段同時覆蓋在其上,若有這種情形,則如方塊195所示,盡可能移動該筆劃之關鍵點使之不會有筆形的二端線段同時覆蓋在其上,最後如方塊198所示,採用移動後之關鍵點的位置來更新字型資料。Therefore, after completing the first and second programs, it is still necessary to check whether the sample of the primitive block covered by the stroke has the conditions such as the mark 181 and the mark 183, and if so, the flow as shown in FIG. 19 is performed. The processing of the third program of FIG. 190 first collects all the primitive blocks covered by the stroke as shown in block 191, and then performs processing as shown in block 192 for each primitive block, that is, calculates each stroke. Covering the coverage area on the primitive block, as shown in block 196, taking out a value greater than a preset value, and then as shown in block 193, to see if there are multiple stroke overlays, if multiple strokes are overlaid at the same time, then As shown in block 197, the key point of the stroke occupying the largest area is moved, and the stroke is moved away so as not to overwrite it, and if there is only one When the stroke of the stroke is overlaid thereon, as shown in block 194, it is checked whether there is a pen-shaped two-end line segment controlled by a non-key point simultaneously covering it. If this is the case, as shown in block 195, as much as possible The key point of the stroke is moved so that the pen-shaped two-end line segment is not covered at the same time, and finally, as shown in block 198, the position of the key point after the movement is used to update the font data.
圖20A之點陣字形200是經由流程圖190的程式處理圖18A之點陣字形180後的結果,其中標示201的圖元區塊是將多個筆劃同時覆蓋其上之最大覆蓋的筆劃移離後的結果,而標示202的圖元區塊是將一個獨立筆劃之外形的二端線段同時覆蓋其上的狀況排除後的結果,圖20B是圖20A的點陣塗黑字型,從比較圖7B和圖20B中可以看出圖20B已經是具有可被接受之中文小字品質的點陣字型。為了進一步做比較,圖21A表示經由本發明處理後之一些中文小字品質的點陣字型,而圖21B表示未經本發明處理之那些不具有可被接受之點陣字型。The dot matrix 200 of FIG. 20A is the result of processing the dot matrix font 180 of FIG. 18A via the program of the flowchart 190, wherein the primitive block of the label 201 is a stroke that removes the maximum coverage of the plurality of strokes simultaneously covering the plurality of strokes. After the result, the primitive block of the mark 202 is the result of the condition that the two-end line segment of the outer shape of the independent stroke is simultaneously covered, and FIG. 20B is the black-drawn pattern of the dot matrix of FIG. 20A. It can be seen in Fig. 20B and Fig. 20B that Fig. 20B is already a dot matrix font with acceptable Chinese small character quality. For further comparison, Fig. 21A shows some Chinese small character quality dot matrix fonts processed by the present invention, and Fig. 21B shows those dot matrix fonts which are not processed by the present invention and which are not acceptable.
一旦本發明作出如上的披露後,一般熟悉字型技術的專業人士就不難做出些微的調整,將本發明所披露的技術實作於幾個方面:(1)當作中文點陣字型的生產工具;(2)當作可縮放中文字型產品中產生低解析度時的字型產生器;(3)包裝於特定機器中產生低解析度中文點陣字型;以及(4)放置於網路電腦上提供低解析度中文點陣字型的顯示等。Once the present invention is disclosed as above, it is not difficult for a person familiar with the font technology to make minor adjustments, and the technology disclosed in the present invention is implemented in several aspects: (1) as a Chinese dot matrix font Production tool; (2) as a font generator for generating low resolution in scalable Chinese font products; (3) packaging for low resolution Chinese dot matrix fonts in a specific machine; and (4) placement Provide low-resolution Chinese dot matrix font display on the network computer.
10‧‧‧一個中文字形10‧‧‧Chinese character
11‧‧‧該字形的一個筆形11‧‧‧ a pen shape of the glyph
13‧‧‧基本筆劃識別碼13‧‧‧Basic stroke identification code
14‧‧‧表示一個外顯參數的關鍵點14‧‧‧ indicates a key point of an explicit parameter
15‧‧‧表示另一個外顯參數的寬度15‧‧‧ indicates the width of another explicit parameter
17‧‧‧方塊座標系17‧‧‧square coordinate system
18‧‧‧貝茲控制多邊形18‧‧‧Bez Control Polygon
21~26‧‧‧流程圖的方塊21~26‧‧‧ Flowchart block
30‧‧‧點陣空間30‧‧ ‧ dot matrix space
31‧‧‧空間座標的原點31‧‧‧ Origin of space coordinates
34~38‧‧‧圖元區塊34~38‧‧‧图元块块
41、42‧‧‧撇筆頂部之關鍵點所控制的筆形部分41, 42‧‧‧ pen-shaped part controlled by the key points at the top of the pen
50、200‧‧‧點陣字型50, 200‧‧‧ dot matrix font
63‧‧‧一個橫筆所覆蓋的圖元區域63‧‧‧A primitive area covered by a horizontal pen
93‧‧‧垂直中線93‧‧‧Vertical midline
94‧‧‧水平中線94‧‧‧ horizontal midline
95‧‧‧水平線段95‧‧‧ horizontal line segments
96‧‧‧垂直線段96‧‧‧ vertical line segments
140‧‧‧橫筆數較多的一個漢字140‧‧‧ A Chinese character with a large number of horizontal pens
141‧‧‧該漢字的塗黑文字141‧‧‧Black text of the Chinese character
圖1舉例說明筆劃基礎字型資料以及其所表現之字形的生成,其中圖1A表示一種以筆劃為基礎的字型資料;圖1B表示在筆劃定義中制定一些參數式,將筆劃字型資料代入這些代數式裏可決定筆形輪廓的特徵點;圖1C表示在筆劃定義中制定另一個參數式,它可從相鄰特徵點中決定連接它們之間的曲線形狀;以及圖1D表示一個關鍵點控制的筆形區。Figure 1 illustrates the stroke basic font data and the generation of the glyphs it represents, wherein Figure 1A shows a stroke-based font data; Figure 1B shows the formulation of some parameter formulas in the stroke definition, and the stroke type data is substituted. These algebraic equations determine the feature points of the pen-shaped contour; Figure 1C shows that another parametric formula is defined in the stroke definition, which can determine the shape of the curve connecting them from adjacent feature points; and Figure 1D shows a key point control. Pen area.
圖2表示由筆劃字型資料產生筆形之方法的流程圖。Figure 2 is a flow chart showing a method of generating a pen shape from stroke type data.
圖3表示點陣座標以及字型資料所表現之中文字形在點陣座標裏的呈現,其中圖3A表示以字型資料表現之點陣中文字形在點陣坐標系裏的呈現;圖3B表示點陣圖元區塊的座標位置;圖3C表示點陣圖元區塊被中文字形之筆劃所覆蓋的一些樣本;以及圖3D表示筆劃覆蓋在圖元區塊上的樣本訊息。Figure 3 shows the representation of the character shape in the lattice coordinates in the representation of the lattice coordinates and the font data. Figure 3A shows the representation of the character shape in the lattice in the lattice coordinate system represented by the font data; Figure 3B shows the point The coordinate position of the bitmap element block; FIG. 3C shows some samples of the bitmap element block covered by the stroke of the Chinese character; and FIG. 3D shows the sample message of the stroke cover on the picture element block.
圖4 表示根據圖3C之筆劃覆蓋樣本去填充成黑白影像的輸出結果。Figure 4 shows the output of the stroke-covered sample according to Figure 3C to fill the black-and-white image.
圖5 表示將圖3C填充成灰度影像的輸出結果。Fig. 5 shows an output result of filling Fig. 3C into a grayscale image.
圖6 表示相鄰二個橫筆重迭的情形,其中圖6A舉例表示一個點陣中文字形;以及圖6B表示它的塗黑結果。Fig. 6 shows a case where two adjacent horizontal pens overlap, wherein Fig. 6A exemplifies a character pattern in a dot matrix; and Fig. 6B shows a blackening result thereof.
圖7 表示多個筆劃擁塞點陣空間的情形,其中圖7A舉例表示一個點陣中文字形;以及圖7B表示它的塗黑結果。Fig. 7 shows the case where a plurality of strokes congest the lattice space, wherein Fig. 7A exemplifies a character pattern in a dot matrix; and Fig. 7B shows its blackout result.
圖8 表示中文字的筆劃類別。Figure 8 shows the stroke categories of Chinese characters.
圖9 表示圖元區塊被一些關節類別之筆劃覆蓋的情形。Figure 9 shows the case where the primitive block is covered by strokes of some joint categories.
圖10表示移動關鍵點和限縮寬度的規則,其中圖10A表示關鍵點平移至圖元區塊中心線;圖10B表示關鍵點垂直移至圖元區塊中心線; 圖10C表示水準限縮寬度;以及圖10D表示垂直限縮寬度。Figure 10 shows the rules for moving key points and limiting the width, wherein Figure 10A shows the key point shifting to the center line of the primitive block; Figure 10B shows the key point moving vertically to the center line of the primitive block; Fig. 10C shows the level limit width; and Fig. 10D shows the vertical limit width.
圖11表示本發明所顯示用於產生中文小字品質之顯示方法的流程圖。Figure 11 is a flow chart showing the display method for generating Chinese small print quality as shown in the present invention.
圖12表示本發明根據中文小字品質要求所披露用於點陣字形之轉換程式的流程圖。Figure 12 is a flow chart showing the conversion program for dot matrix fonts disclosed in the Chinese small print quality requirement according to the present invention.
圖13表示經由移動橫筆產生小字品質之效果,其中圖13A表示移動圖6A之點陣字形中的一個橫筆後之點陣字形;圖13B表示對移動後之點陣字形作填充處理後的結果。Fig. 13 is a view showing an effect of generating a small character quality by moving a horizontal pen, wherein Fig. 13A shows a dot matrix shape after moving one of the dot matrix characters of Fig. 6A; Fig. 13B shows a filling process for the lattice pattern after the movement result.
圖14舉例表示多個橫筆在點陣空間裏會產生不足空間來隔離它們的現象,其中圖14A是橫筆超多之一個點陣字形的例子;圖14B是它經由填充處理後的結果。Fig. 14 exemplifies a phenomenon in which a plurality of horizontal pens generate insufficient space in the lattice space to isolate them, wherein Fig. 14A is an example of a dot matrix shape in which the horizontal pen is excessively large; and Fig. 14B is a result of its processing via padding.
圖15表示對不足空間分配橫筆的例子(圖14)重組成簡化形態的一個文字,其中圖15A表示重組後簡化的點陣字形;而圖15B表示它被填充後的結果。Fig. 15 shows an example in which an example of the allocation of the horizontal pen to the insufficient space (Fig. 14) is reorganized into a simplified form, in which Fig. 15A shows a simplified dot matrix font after recombination; and Fig. 15B shows a result after it is filled.
圖16表示佈置橫直筆於點陣空間上之分配方法的流程圖。Fig. 16 is a flow chart showing a method of arranging a straight pen on a lattice space.
圖17表示限制筆劃覆蓋點陣圖元區塊之處理方法的流程圖。Figure 17 is a flow chart showing a method of restricting the processing of a stroke covering a bitmap element block.
圖18表示限制圖7A之筆劃覆蓋點陣圖元區塊的效果,其中圖18A表示限制圖7A之筆劃覆蓋點陣圖元區塊後的點陣字形;圖18B表示填充圖18A之點陣字形後的結果。Figure 18 is a diagram showing the effect of limiting the stroke of Figure 7A to cover a bitmap primitive block, wherein Figure 18A shows the dot matrix font after the stroke of Figure 7A is limited to cover the bitmap element block; Figure 18B shows the dot matrix font of Figure 18A. After the result.
圖19表示重整筆劃覆蓋點陣圖元區塊之處理方法的流程圖。Figure 19 is a flow chart showing a method of processing a reformation stroke covering a bitmap primitive block.
圖20表示重整圖18之例子的筆劃覆蓋點陣圖元區塊後的效果,其中圖20A表示重整筆劃覆蓋圖元區塊後的點陣字形;圖20B表示填充圖20A 之點陣字形的結果。Figure 20 is a diagram showing the effect of reforming the stroke of the example of Figure 18 to cover the bitmap element block, wherein Figure 20A shows the dot matrix font after the reforming stroke covers the primitive block; Figure 20B shows the filling pattern 20A. The result of the dot matrix glyph.
圖21舉例表示一些本發明所產生之小字品質的字型輸出,其中圖21A表示經本發明處理的點陣字型輸出,而圖21B表示未經本發明處理後的點陣字型輸出。Fig. 21 exemplifies some of the small-quality word output produced by the present invention, wherein Fig. 21A shows the dot matrix font output processed by the present invention, and Fig. 21B shows the dot matrix font output which has not been processed by the present invention.
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW097139129A TWI409800B (en) | 2008-10-13 | 2008-10-13 | About rasterizing asian characters based on stroke font representation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW097139129A TWI409800B (en) | 2008-10-13 | 2008-10-13 | About rasterizing asian characters based on stroke font representation |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201015532A TW201015532A (en) | 2010-04-16 |
TWI409800B true TWI409800B (en) | 2013-09-21 |
Family
ID=44830085
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW097139129A TWI409800B (en) | 2008-10-13 | 2008-10-13 | About rasterizing asian characters based on stroke font representation |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI409800B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5852448A (en) * | 1996-09-20 | 1998-12-22 | Dynalab Inc. | Stroke-based font generation independent of resolution |
TW370646B (en) * | 1998-01-21 | 1999-09-21 | Pyna Comware Toaiwan Inc | Stroked-based font generation independent of resolution |
US6157390A (en) * | 1996-09-20 | 2000-12-05 | Dynalab (S) Ltd. | Stroke-based font generation |
US6232987B1 (en) * | 1996-04-02 | 2001-05-15 | Hyundai Electronics Industries Co., Ltd. | Progressively renderable outline font and methods of generating, transmitting and rendering the same |
US6501475B1 (en) * | 1999-10-22 | 2002-12-31 | Dynalab Inc. | Glyph-based outline font generation independent of resolution |
-
2008
- 2008-10-13 TW TW097139129A patent/TWI409800B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6232987B1 (en) * | 1996-04-02 | 2001-05-15 | Hyundai Electronics Industries Co., Ltd. | Progressively renderable outline font and methods of generating, transmitting and rendering the same |
US5852448A (en) * | 1996-09-20 | 1998-12-22 | Dynalab Inc. | Stroke-based font generation independent of resolution |
US6157390A (en) * | 1996-09-20 | 2000-12-05 | Dynalab (S) Ltd. | Stroke-based font generation |
TW370646B (en) * | 1998-01-21 | 1999-09-21 | Pyna Comware Toaiwan Inc | Stroked-based font generation independent of resolution |
US6501475B1 (en) * | 1999-10-22 | 2002-12-31 | Dynalab Inc. | Glyph-based outline font generation independent of resolution |
Also Published As
Publication number | Publication date |
---|---|
TW201015532A (en) | 2010-04-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TW486642B (en) | Glyph-based outline font generation independent of resolution | |
EP0786757B1 (en) | Adjusting contrast in antialiasing | |
US5719595A (en) | Method and apparauts for generating a text image on a display with anti-aliasing effect | |
CN101676988B (en) | Stroke foundation Chinese font small character quality display method | |
JPS62123573A (en) | Computer graphic apparatus and operation thereof | |
US5579030A (en) | Method and apparatus for display of text on screens | |
US8243077B2 (en) | Method for generating stroke-based font characters for a low-resolution display | |
JP4162670B2 (en) | How to generate a silhouetted gray font | |
US5489920A (en) | Method for determining the optimum angle for displaying a line on raster output devices | |
CN110110028B (en) | Method and system for displaying map according to user-defined area and oriented to OGC standard | |
JP3247988B2 (en) | Method of displaying characters on a raster display device | |
US7701467B2 (en) | Character display apparatus, character display method, character display program, and recording medium | |
JPH09510799A (en) | Raster shape converter from multi-level to binary level | |
TWI409800B (en) | About rasterizing asian characters based on stroke font representation | |
US7773094B2 (en) | Method and device for the display of images | |
JP2012108825A (en) | Information processing device, information processing method and program | |
CN102074004B (en) | Method and device for determining type of barrier of spatial entity | |
US7170528B1 (en) | Fast glyph rendering for vector based fonts | |
TWI282947B (en) | Silhouette oriented gray font generation | |
KR100691501B1 (en) | Conversion method of outline font to bitmap image using snap hinting and stem hinting technic and computer readable media storing the software in which the conversion method is implemented | |
JP5492911B2 (en) | Character creation method and character creation device | |
CN100377179C (en) | Shape processor | |
JPH10116176A (en) | Object reference memory mapping | |
CN112233005A (en) | Three-dimensional logo watermark generation method for train dispatching terminal |