本發明是有關於一種調整方法和裝置,特別係關於一種自動調整筆劃的方法和裝置。The present invention relates to an adjustment method and device, and in particular to a method and device for automatically adjusting pen strokes.
根據亞洲國家使用標準編碼的字符數量,至少有數千字到數萬字,以台灣所使用的Big5規格就包括13,060個漢字,而以Unicode 15.0的規格,甚至收錄了97,058個漢字字碼。The number of characters encoded in standard formats used by Asian countries ranges from thousands to tens of thousands. The Big5 format used in Taiwan includes 13,060 Chinese characters, while the Unicode 15.0 format includes 97,058 Chinese character codes.
在數位系統上,要使用這些字符,就必須將每個字符製作出來,並放入各種規格定義好的字符代碼中,稱為碼本(codebook)。因此,若要於數位系統上使用新風格字體,需字體設計師做滿一個碼本的新風格字型,往往需要花費數年的時間才能完成。In order to use these characters on a digital system, each character must be produced and put into various character codes defined by specifications, called codebooks. Therefore, if a new style font is to be used on a digital system, a font designer needs to create a new style font that fills a codebook, which often takes several years to complete.
因此,如何加快新風格字體的產生,以解決上述的問題,乃為此一業界亟待解決的問題。Therefore, how to speed up the production of new style fonts to solve the above problems is an issue that the industry needs to solve urgently.
本發明之一實施態樣係在提供一種自動調整筆劃的方法,包含:接收複數種筆劃,其中該複數種筆劃的每一者包括表示筆劃起始點位置及終點位置的至少二控制點參數,以及表示筆劃寬度的一寬度參數;根據該複數種筆劃所組成的複數個具有一新風格字體的外觀的字,產生一具有該新風格字體的外觀的一新字;從該複數種筆劃中選擇用以組成該新字的至少一筆劃;調整該至少一筆劃的該至少二控制點參數以及該寬度參數的至少一者以修正該至少一筆劃;疊合修正後的該至少一筆劃於該新字對應的筆劃位置上,其中該新字對應的筆劃位置上具有一原圖筆劃;計算該修正後的該至少一筆劃與該原圖筆劃間的一疊合比率以及一面積比值;判斷該疊合比率以及該面積比值是否不再變化;以及響應該疊合比率以及該面積比值不再變化,根據該調整後的至少二控制點參數以及該寬度參數,組合該修正後的該至少一筆劃至該新字中。One embodiment of the present invention is to provide a method for automatically adjusting strokes, comprising: receiving a plurality of strokes, wherein each of the plurality of strokes includes at least two control point parameters representing the stroke start point position and the stroke end point position, and a width parameter representing the stroke width; generating a new word having the appearance of a new style font based on a plurality of words having the appearance of the new style font composed of the plurality of strokes; selecting at least one stroke from the plurality of strokes to form the new word; adjusting the at least two control point parameters and the width parameter of the at least one stroke; The invention relates to a method for modifying at least one stroke according to at least one of the control point parameters and the width parameter; superimposing the modified at least one stroke on a stroke position corresponding to the new character, wherein the stroke position corresponding to the new character has an original stroke; calculating an overlay ratio and an area ratio between the modified at least one stroke and the original stroke; determining whether the overlay ratio and the area ratio no longer change; and in response to the overlay ratio and the area ratio no longer changing, combining the modified at least one stroke into the new character according to the adjusted at least two control point parameters and the width parameter.
在一些實施例中,自動調整筆劃的方法更包括:根據一第一方向調整該至少一筆劃的該至少二控制點參數,以修正該至少一筆劃;以及疊合修正後的該至少一筆劃於該新字對應的筆劃位置上,以計算該修正後的該至少一筆劃與該原圖筆劃間的該疊合比率。In some embodiments, the method of automatically adjusting strokes further includes: adjusting the at least two control point parameters of the at least one stroke according to a first direction to modify the at least one stroke; and superimposing the modified at least one stroke on the stroke position corresponding to the new character to calculate the superposition ratio between the modified at least one stroke and the original stroke.
在一些實施例中,當該疊合比率低於該至少一筆劃修正前的一疊合比率,紀錄該第一方向為一錯誤調整方向。In some embodiments, when the overlap ratio is lower than an overlap ratio before the at least one stroke is corrected, the first direction is recorded as an erroneous adjustment direction.
在一些實施例中,自動調整筆劃的方法更包括:調整該至少一筆劃的該寬度參數,以修正該至少一筆劃的寬度;以及計算寬度修正後的該至少一筆劃的面積與該原圖筆劃的面積間的該面積比值。In some embodiments, the method of automatically adjusting strokes further includes: adjusting the width parameter of the at least one stroke to modify the width of the at least one stroke; and calculating the area ratio between the area of the at least one stroke after the width modification and the area of the original stroke.
在一些實施例中,自動調整筆劃的方法,更包括設置該疊合比率的一疊合比率門檻值,以及該面積比值的一面積比值門檻值。In some embodiments, the method of automatically adjusting strokes further includes setting an overlap ratio threshold value of the overlap ratio and an area ratio threshold value of the area ratio.
在一些實施例中,自動調整筆劃的方法,更包括響應該疊合比率以及該面積比值不再變化,以及該疊合比率以及該面積比值分別大於該疊合比率門檻值以及該面積比值門檻值,根據該調整後的至少二控制點參數以及該寬度參數,組合該修正後的該至少一筆劃至該新字中。In some embodiments, the method of automatically adjusting strokes further includes combining the corrected at least one stroke into the new character according to the adjusted at least two control point parameters and the width parameter in response to the overlap ratio and the area ratio no longer changing, and the overlap ratio and the area ratio being respectively greater than the overlap ratio threshold value and the area ratio threshold value.
本案之另一實施態樣是提供一種自動調整筆劃裝置,包含:一儲存裝置,配置以儲存複數電腦可執行指令;以及一處理器,電性耦接於該儲存裝置,並配置以擷取並執行該等電腦可執行指令,以執行一種自動調整筆劃的方法,該自動調整筆劃的方法包含:接收複數種筆劃,其中該複數種筆劃的每一者包括表示筆劃起始點位置及終點位置的至少二控制點參數,以及表示筆劃寬度的一寬度參數;根據該複數種筆劃所組成的複數個具有一新風格字體的外觀的字,產生一具有該新風格字體的外觀的一新字;從該複數種筆劃中選擇用以組成該新字的至少一筆劃;調整該至少一筆劃的該至少二控制點參數以及該寬度參數的至少一者以修正該至少一筆劃;疊合修正後的該至少一筆劃於該新字對應的筆劃位置上,其中該新字對應的筆劃位置上具有一原圖筆劃;計算該修正後的該至少一筆劃與該原圖筆劃間的一疊合比率以及一面積比值;判斷該疊合比率以及該面積比值是否不再變化;以及響應該疊合比率以及該面積比值不再變化,根據該調整後的至少二控制點參數以及該寬度參數,組合該修正後的該至少一筆劃至該新字中。Another embodiment of the present invention provides an automatic stroke adjustment device, comprising: a storage device configured to store a plurality of computer executable instructions; and a processor electrically coupled to the storage device and configured to capture and execute the computer executable instructions to perform a method for automatically adjusting strokes, the method comprising: receiving a plurality of strokes, wherein each of the plurality of strokes comprises at least two control point parameters representing the stroke start point position and the end point position, and a width parameter representing the stroke width; generating a new word having the appearance of a new style font according to a plurality of words having the appearance of the new style font composed of the plurality of strokes; and generating a new word having the appearance of the new style font from the plurality of strokes. At least one stroke for forming the new character is selected from a plurality of strokes; at least one of the at least two control point parameters and the width parameter of the at least one stroke is adjusted to modify the at least one stroke; the modified at least one stroke is superimposed on a stroke position corresponding to the new character, wherein the stroke position corresponding to the new character has an original stroke; an overlap ratio and an area ratio between the modified at least one stroke and the original stroke are calculated; it is determined whether the overlap ratio and the area ratio no longer change; and in response to the overlap ratio and the area ratio no longer changing, the modified at least one stroke is combined into the new character according to the adjusted at least two control point parameters and the width parameter.
在一些實施例中,自動調整筆劃的裝置更包括一輸入輸出單元電性耦接於該處理器,用以接收該複數種筆劃以傳送給該處理器。In some embodiments, the device for automatically adjusting strokes further includes an input-output unit electrically coupled to the processor, for receiving the plurality of strokes and transmitting them to the processor.
在一些實施例中,自動調整筆劃的裝置該儲存裝置更儲存該複數種筆劃。In some embodiments, the storage device of the device for automatically adjusting strokes further stores the plurality of strokes.
本案之再一實施態樣是提供一種非暫態電腦可讀取儲存媒體,其特徵在於,用於儲存一電腦程式,該電腦程式包含多個程式指令,該電腦程式在載入到一自動調整筆劃裝置後執行一自動調整筆劃方法,包含:接收複數種筆劃,其中該複數種筆劃的每一者包括表示筆劃起始點位置及終點位置的至少二控制點參數,以及表示筆劃寬度的一寬度參數;根據該複數種筆劃所組成的複數個具有一新風格字體的外觀的字,產生一具有該新風格字體的外觀的一新字;從該複數種筆劃中選擇用以組成該新字的至少一筆劃;調整該至少一筆劃的該至少二控制點參數以及該寬度參數的至少一者以修正該至少一筆劃;疊合修正後的該至少一筆劃於該新字對應的筆劃位置上,其中該新字對應的筆劃位置上具有一原圖筆劃;計算該修正後的該至少一筆劃與該原圖筆劃間的一疊合比率以及一面積比值;判斷該疊合比率以及該面積比值是否不再變化;以及響應該疊合比率以及該面積比值不再變化,根據該調整後的至少二控制點參數以及該寬度參數,組合該修正後的該至少一筆劃至該新字中。Another embodiment of the present invention provides a non-transitory computer-readable storage medium, which is characterized in that it is used to store a computer program, the computer program includes a plurality of program instructions, and the computer program executes an automatic stroke adjustment method after being loaded into an automatic stroke adjustment device, including: receiving a plurality of strokes, wherein each of the plurality of strokes includes at least two control point parameters representing the stroke start point position and the end point position, and a width parameter representing the stroke width; generating a new word with the appearance of the new style font based on a plurality of words with the appearance of the new style font composed of the plurality of strokes; selecting a stroke from the plurality of strokes to form a new word; at least one stroke of the new character; adjusting at least one of the at least two control point parameters and the width parameter of the at least one stroke to modify the at least one stroke; superimposing the modified at least one stroke on a stroke position corresponding to the new character, wherein the stroke position corresponding to the new character has an original stroke; calculating an overlay ratio and an area ratio between the modified at least one stroke and the original stroke; determining whether the overlay ratio and the area ratio no longer change; and in response to the overlay ratio and the area ratio no longer changing, combining the modified at least one stroke into the new character according to the adjusted at least two control point parameters and the width parameter.
本案提出一種筆劃調整方法,在根據所生成的新字選擇出對應的筆劃後,本案筆劃調整方法會將所選擇出的筆劃疊合在所生成新字的對應筆劃的原圖筆劃上,並根據和所生成新字的對應筆劃的原圖筆劃間的疊合比率以及面積比值,調整選擇出筆劃的控制點參數和寬度參數,來修正選擇出筆劃的外觀以及選擇出筆劃的面積,藉以讓調整後的筆劃趨近於原圖筆劃。由於本案的筆劃調整方法,無須設計師手動調整選擇出的筆劃,因此可節省大量設計時間。因此可節省大量設計時間。This case proposes a stroke adjustment method. After selecting a corresponding stroke according to a generated new character, the stroke adjustment method of this case will overlap the selected stroke on the original stroke of the corresponding stroke of the generated new character, and adjust the control point parameters and width parameters of the selected stroke according to the overlap ratio and area ratio between the original stroke of the corresponding stroke of the generated new character to correct the appearance of the selected stroke and the area of the selected stroke, so as to make the adjusted stroke close to the original stroke. Because the stroke adjustment method of this case does not require designers to manually adjust the selected stroke, a lot of design time can be saved. Therefore, a lot of design time can be saved.
以下揭示提供許多不同實施例或例證用以實施本發明的不同特徵。特殊例證中的元件及配置在以下討論中被用來簡化本揭示。所討論的任何例證只用來作解說的用途,並不會以任何方式限制本發明或其例證之範圍和意義。此外,本揭示在不同例證中可能重複引用數字符號且/或字母,這些重複皆為了簡化及闡述,其本身並未指定以下討論中不同實施例且/或配置之間的關係。The following disclosure provides many different embodiments or examples for implementing different features of the present invention. The components and configurations in a particular example are used to simplify the present disclosure in the following discussion. Any example discussed is used for illustrative purposes only and does not limit the scope and significance of the present invention or its examples in any way. In addition, the present disclosure may repeatedly reference numbers and/or letters in different examples. These repetitions are for simplification and clarification, and do not in themselves specify the relationship between different embodiments and/or configurations in the following discussion.
在全篇說明書與申請專利範圍所使用之用詞(terms),除有特別註明外,通常具有每個用詞使用在此領域中、在此揭露之內容中與特殊內容中的平常意義。某些用以描述本揭露之用詞將於下或在此說明書的別處討論,以提供本領域技術人員在有關本揭露之描述上額外的引導。The terms used throughout the specification and the patent application generally have the ordinary meaning of each term used in this field, in the context of this disclosure, and in the specific context, unless otherwise specified. Certain terms used to describe the present disclosure will be discussed below or elsewhere in this specification to provide additional guidance to those skilled in the art in describing the present disclosure.
關於本文中所使用之『耦接』或『連接』,均可指二或多個元件相互直接作實體或電性接觸,或是相互間接作實體或電性接觸,而『耦接』或『連接』還可指二或多個元件相互操作或動作。As used herein, "coupling" or "connection" may refer to two or more elements being in direct physical or electrical contact with each other, or being in indirect physical or electrical contact with each other, and "coupling" or "connection" may also refer to the mutual operation or action of two or more elements.
在本文中,使用第一、第二與第三等等之詞彙,是用於描述各種元件、組件、區域、層與/或區塊是可以被理解的。但是這些元件、組件、區域、層與/或區塊不應該被這些術語所限制。這些詞彙只限於用來辨別單一元件、組件、區域、層與/或區塊。因此,在下文中的一第一元件、組件、區域、層與/或區塊也可被稱為第二元件、組件、區域、層與/或區塊,而不脫離本發明的本意。如本文所用,詞彙『與/或』包含了列出的關聯項目中的一個或多個的任何組合。本案文件中提到的「及/或」是指表列元件的任一者、全部或至少一者的任意組合。In this article, the use of the terms first, second, and third, etc., is understood to be used to describe various elements, components, regions, layers, and/or blocks. However, these elements, components, regions, layers, and/or blocks should not be limited by these terms. These terms are limited to identifying a single element, component, region, layer, and/or block. Therefore, a first element, component, region, layer, and/or block in the following text may also be referred to as a second element, component, region, layer, and/or block without departing from the original intention of the present invention. As used herein, the term "and/or" includes any combination of one or more of the listed associated items. The "and/or" mentioned in the present document refers to any combination of any one, all, or at least one of the listed elements.
傳統上,若要於數位系統上使用新風格字體,需字體設計師親自做滿一個完整規範碼本的新風格字型,不僅相當耗費時間亦不具時效,在推出時,設計的新風格字體可能已不受消費者所喜愛。因此,本案藉由人工智慧,利用字體設計師親自設計出具新風格字體的字做為代表字,將已存在的風格字體中字體設計師未設計過的字,渲染成具新風格字體的字,同時根據被渲染成新風格字體的字,從筆劃庫中挑選出對應筆劃,自動微調所挑出筆劃的參數,如筆劃位置以及筆劃大小,來符合新風格字體的字,以完善新風格字體的字。由於本案無須字體設計師親自做滿一個碼本具新風格字體的字,因此可節省大量設計時間,更具時效性。Traditionally, if you want to use a new style font on a digital system, the font designer needs to personally create a new style font with a complete standard codebook, which is not only very time-consuming but also not timely. When the new style font is launched, the designed new style font may no longer be liked by consumers. Therefore, this case uses artificial intelligence to use the characters designed by the font designer himself to create a new style font as representative characters, and renders the characters in the existing style font that the font designer has not designed into the new style font. At the same time, according to the characters rendered into the new style font, the corresponding strokes are selected from the stroke library, and the parameters of the selected strokes, such as stroke position and stroke size, are automatically fine-tuned to match the characters in the new style font to improve the characters in the new style font. Since this case does not require the font designer to personally create a full code book of new style fonts, it can save a lot of design time and be more timely.
第1圖為根據本案一較佳實施例,一種自動調整筆劃裝置10的方塊圖。自動調整筆劃裝置10包含:記憶體11、處理器12及輸入輸出單元13。上述的元件可藉由例如,但不限於匯流排彼此進行通訊。記憶體11為可用以儲存資料的任何儲存裝置,可為例如,但不限於隨機存取記憶體(random access memory;RAM)、唯讀記憶體(read only memory;ROM)、快閃記憶體、硬碟或其他可用以儲存資料的儲存裝置。記憶體11配置以至少儲存複數電腦可讀取指令。處理器12電性耦接於記憶體11,配置以自記憶體11存取電腦可讀取指令,以執行自動調整筆劃的功能。輸入輸出單元13為可由使用者操作以與處理器12通訊,進行資料的輸入與輸出。在一些實施例中,自動調整筆劃裝置10可為計算機、伺服器、或其他具特定邏輯電路的獨特硬體裝置或具特定功能的設備來實作。輸入輸出單元13可為觸控式螢幕或是手寫板等裝置,但本案不以此為限。FIG. 1 is a block diagram of an automatic stroke adjustment device 10 according to a preferred embodiment of the present invention. The automatic stroke adjustment device 10 includes a memory 11, a processor 12, and an input/output unit 13. The above components can communicate with each other through, for example, but not limited to, a bus. The memory 11 is any storage device that can be used to store data, and can be, for example, but not limited to, a random access memory (RAM), a read only memory (ROM), a flash memory, a hard disk, or other storage devices that can be used to store data. The memory 11 is configured to store at least a plurality of computer-readable instructions. The processor 12 is electrically coupled to the memory 11 and is configured to access computer-readable instructions from the memory 11 to execute the function of automatically adjusting the stroke. The input-output unit 13 can be operated by the user to communicate with the processor 12 to input and output data. In some embodiments, the automatic stroke adjustment device 10 can be implemented as a computer, a server, or other unique hardware device with a specific logic circuit or a device with a specific function. The input-output unit 13 can be a touch screen or a handwriting board, but the present invention is not limited thereto.
第2圖所示為根據本案一些實施例產生一具新風格字體的方法流程圖。產生具新風格字體的方法200可應用第1圖所示的自動調整匹配筆劃的裝置10,來調整組成新風格字體的筆劃,而無須設計師手動執行,因此可節省大量時間。FIG. 2 is a flow chart of a method for generating a new style font according to some embodiments of the present invention. The method 200 for generating a new style font can apply the device 10 for automatically adjusting matching strokes shown in FIG. 1 to adjust the strokes constituting the new style font without the need for the designer to perform manual operation, thereby saving a lot of time.
產生具新風格字體的方法200,首先於步驟201,產生多種筆劃,其中該些筆劃中的每一者均具有一新風格字體的外觀。在一較佳實施例中,一字體設計師藉由構思欲呈現字體的風格外觀,設計出一新風格字體,並根據此新風格字體,繪製出組成此新風格字體所需的不同筆劃。在一較佳實施例中,字體設計師可於輸入輸出單元13上繪製新風格字體的筆劃資料,並儲存於記憶體11中,以形成一具新風格字體外觀的筆劃資料庫14。The method 200 for generating a font with a new style first generates a plurality of strokes in step 201, wherein each of the strokes has the appearance of a new style font. In a preferred embodiment, a font designer designs a new style font by conceiving the appearance of a font style, and draws different strokes required to form the new style font according to the new style font. In a preferred embodiment, the font designer can draw the stroke data of the new style font on the input-output unit 13 and store it in the memory 11 to form a stroke database 14 of the appearance of the new style font.
接著於步驟202,設置每一筆劃的外框以及關鍵參數組。在一實施例中,根據輸入的多種新風格筆劃,賦與該多種筆劃每一者的對應編號,並以數學式描述筆劃外框。在一些實施例中,所使用的數學式為貝茲曲線用來描述筆劃輪廓的外框。在一些實施例中,當字體設計師於電子裝置的輸入模組上繪製新風格字體的筆劃資料後,自動調整筆劃裝置10可據此筆劃資料,使用貝茲曲線描述此筆劃輪廓的外框,並設置每一筆劃的關鍵參數組,其中每個筆劃至少有兩個關鍵參數組。第3圖所示為根據本案一實施例對一「人」字的筆劃設置關鍵參數組之概略圖示。在此實施例中,自動調整筆劃裝置10設置包括由貝茲曲線所描述「人」字筆劃輪廓的外框。「人」字的第一筆劃,亦即左側筆劃,描述筆劃起始點位置及終點位置的至少二控制點參數A1以及A2,以及描述寬度的寬度參數W1。「人」字的第二筆劃,亦即右側筆劃,描述筆劃起始點位置及終點位置的至少二控制點參數B1以及B2,以及描述寬度的寬度參數W2。Then, in step 202, the outline and key parameter set of each stroke are set. In one embodiment, a corresponding number is assigned to each of the multiple strokes of the new style input, and the stroke outline is described by a mathematical formula. In some embodiments, the mathematical formula used is a Bezier curve to describe the outline of the stroke. In some embodiments, after the font designer draws the stroke data of the new style font on the input module of the electronic device, the automatic stroke adjustment device 10 can use the Bezier curve to describe the outline of the stroke according to the stroke data, and set the key parameter set of each stroke, wherein each stroke has at least two key parameter sets. FIG. 3 is a schematic diagram showing a key parameter set for a stroke of a character "人" according to an embodiment of the present invention. In this embodiment, the automatic stroke adjustment device 10 is provided with an outer frame of the stroke outline of the character "人" described by a Bezier curve. The first stroke of the character "人", i.e., the left stroke, describes at least two control point parameters A1 and A2 of the stroke starting point position and the end point position, and a width parameter W1 describing the width. The second stroke of the character "人", i.e., the right stroke, describes at least two control point parameters B1 and B2 of the stroke starting point position and the end point position, and a width parameter W2 describing the width.
接著於步驟203,形成一基礎字集。在一實施例中,利用步驟201及202產生的筆劃組成具有新風格字體的多個不同字,此些字都具有新風格字體,用以作為後續提取新風格特徵時使用的基礎字集,並儲存於記憶體11中。Then, in step 203, a basic character set is formed. In one embodiment, the strokes generated in steps 201 and 202 are used to form a plurality of different characters with a new style font. These characters all have a new style font and are used as a basic character set for subsequent extraction of new style features and are stored in the memory 11.
接著於步驟204,根據基礎字集產出具有新風格字體外觀的一新字,此新字為設計師未設計的字。在一實施例中,可透過輸入輸出單元13輸入一第一字以及一第二字。其中第一字具有已存在風格字體的外觀,非基礎字集中的字。第二字具有新風格字體的外觀,為基礎字集中的其中一字。第一字是用以作為後續渲染第一字產生融合新風格字體後第一字的字體架構參考來源,字體架構為文字的筆劃的穿插關係。在一些實施例中,所選擇具有的已存在風格字體外觀可為黑體,但本案不以黑體為限。使用第一字的字體架構特徵以及第二字的風格特徵進行融合,渲染第一字以產生融合新風格字體外觀的第一字。在一些實施例中,亦即提取第一字的字體架構特徵,以及提取第二字的風格特徵,以融合第一字的字體架構特徵以及第二字的風格特徵,來渲染第一字以產生具有新風格字體外觀的第一字。Then in step 204, a new character with a new style font appearance is generated based on the basic character set. This new character is a character that has not been designed by the designer. In one embodiment, a first character and a second character can be input through the input and output unit 13. The first character has the appearance of an existing style font and is not a character in the basic character set. The second character has the appearance of a new style font and is one of the characters in the basic character set. The first character is used as a font structure reference source for the first character after the subsequent rendering of the first character to generate a fusion of the new style font. The font structure is the interlaced relationship of the strokes of the text. In some embodiments, the selected existing style font appearance can be bold, but the present case is not limited to bold. The font structure characteristics of the first character and the style characteristics of the second character are used for fusion, and the first character is rendered to generate the first character with a fusion of the new style font appearance. In some embodiments, the font structure features of the first character are extracted, and the style features of the second character are extracted, so as to fuse the font structure features of the first character and the style features of the second character to render the first character to generate the first character with a new style font appearance.
接著於步驟205,選擇可組成新字所有可能匹配的筆劃。根據具新風格字體外觀的第一字,從記憶體11的筆劃資料庫14中選擇可組成第一字所有可能匹配的筆劃。因為,所形成的第一字為字體設計師在設計新風格字體時未設計過的字,而其中所使用之筆劃為筆劃資料庫14中形成基礎字集中的筆劃,因此筆劃的大小或是筆劃位置未必適用於步驟204產出的具新風格字體外觀的第一字。Then in step 205, all possible matching strokes that can form a new character are selected. Based on the first character with the new style font appearance, all possible matching strokes that can form the first character are selected from the stroke database 14 of the memory 11. Because the first character formed is a character that the font designer has not designed when designing the new style font, and the strokes used therein are the strokes in the stroke database 14 that form the basic character set, so the size of the strokes or the stroke position may not be applicable to the first character with the new style font appearance generated in step 204.
因此,於步驟206,自動調整匹配筆劃的參數。將匹配筆劃配置於步驟204所產出具有新風格字體外觀第一字的適配過程中,更自動調整匹配筆劃的參數。在一些實施例中,可對描述筆劃起始點位置及終點位置的至少二控制點參數,以及描述筆劃寬度的寬度參數進行調整,讓第一字字體外觀的整體風格更符合步驟204所產出的具有新風格字體外觀的第一字。其中調整匹配筆劃參數的過程另揭示在第4圖中。Therefore, in step 206, the parameters of the matching strokes are automatically adjusted. In the adaptation process of the first character with the new style font appearance generated in step 204, the parameters of the matching strokes are further automatically adjusted. In some embodiments, at least two control point parameters describing the stroke starting point position and the end point position, and the width parameter describing the stroke width can be adjusted to make the overall style of the first character font appearance more consistent with the first character with the new style font appearance generated in step 204. The process of adjusting the matching stroke parameters is further disclosed in FIG. 4.
最後於步驟207,由設計師進行人工檢視第一字字體外觀的整體風格是否符合新風格字體外觀。若有必要,設計師亦可再次進行第一字微調。Finally, in step 207, the designer manually checks whether the overall style of the first character font appearance conforms to the new style font appearance. If necessary, the designer can also fine-tune the first character again.
第4圖所示為根據本案一些實施例自動調整匹配筆劃的方法流程圖。自動調整匹配筆劃的方法300可應用於第1圖所示的自動調整筆劃裝置10中。處理器12可自記憶體11存取並執行至少一指令,以實施自動調整匹配筆劃的方法300,用以讓第一字字體外觀的整體風格更符合步驟204所產出的具有新風格字體外觀的第一字。FIG. 4 is a flow chart of a method for automatically adjusting matching strokes according to some embodiments of the present invention. The method 300 for automatically adjusting matching strokes can be applied to the automatic stroke adjustment device 10 shown in FIG. 1 . The processor 12 can access and execute at least one instruction from the memory 11 to implement the method 300 for automatically adjusting matching strokes, so as to make the overall style of the first character font appearance more consistent with the first character with the new style font appearance generated in step 204.
自動調整匹配筆劃的方法300,首先於步驟301,配置筆劃至新字的對應筆劃位置上。在一實施例中,將從筆劃資料庫14中選擇出可組成第一字的匹配筆劃,自動配置於步驟204所產出具有新風格字體外觀的第一字中的對應筆劃位置上。在一些實施例中,第5A圖所示為一具有新風格字體外觀的「予」字。第5B圖所示為匹配「予」字的6個筆劃。第5C圖所示為分別框定對應筆劃的位置。第5D圖所示自動配置筆劃於對應筆劃位置上。依此,若步驟204所產出具有新風格字體外觀的第一字為如第5A圖所示的「予」字401,本案根據「予」字401比對筆劃資料庫14中設計師設計的筆劃,選出如第5B圖所示匹配「予」字401的6個筆劃403B-408B,並對「予」字401的6個筆劃403B-408B,如第5C圖所示,分別框定6個筆劃403B-408B的對應筆劃位置403A-408A。在一些實施例中,第5B圖所示的筆劃「、」403B對應第5C圖所示框定位置403A。第5B圖所示的筆劃「ー」408B對應第5C圖所示框定位置408A。其餘之筆劃可依此類推。當選出如第5B圖所示匹配「予」字401的6個筆劃403B-408B,並如第5C圖所示,框定6個筆劃403B-408B的對應筆劃位置403A-408A後,如第5D圖所示,自動將6個筆劃403B-408B分別配置於6個對應筆劃位置403A-408A上。在一些實施例中,筆劃「、」403B被自動配置於對應筆劃位置403A上。其餘筆劃404B-408B可依此類推分別配置於對應筆劃位置404A-408A上。The method 300 for automatically adjusting matching strokes first configures the strokes to the corresponding stroke positions of the new character in step 301. In one embodiment, matching strokes that can form the first character are selected from the stroke database 14 and automatically configured to the corresponding stroke positions in the first character with the new style font appearance produced in step 204. In some embodiments, FIG. 5A shows a character "予" with the new style font appearance. FIG. 5B shows 6 matching strokes of the character "予". FIG. 5C shows the positions of the corresponding strokes framed respectively. FIG. 5D shows that the strokes are automatically configured at the corresponding stroke positions. Accordingly, if the first character with the appearance of the new style font generated in step 204 is the character "予" 401 as shown in FIG. 5A, the present case compares the strokes designed by the designer in the stroke database 14 with the character "予" 401, selects the six strokes 403B-408B that match the character "予" 401 as shown in FIG. 5B, and respectively frames the corresponding stroke positions 403A-408A of the six strokes 403B-408B of the character "予" 401 as shown in FIG. 5C. In some embodiments, the stroke "、" 403B shown in FIG. 5B corresponds to the framed position 403A shown in FIG. 5C. The stroke "ー" 408B shown in FIG. 5B corresponds to the framed position 408A shown in FIG. 5C. The rest of the strokes can be arranged in the same manner. When the six strokes 403B-408B matching the character "予" 401 are selected as shown in FIG. 5B, and the corresponding stroke positions 403A-408A of the six strokes 403B-408B are framed as shown in FIG. 5C, the six strokes 403B-408B are automatically arranged on the six corresponding stroke positions 403A-408A as shown in FIG. 5D. In some embodiments, the stroke "、" 403B is automatically arranged on the corresponding stroke position 403A. The rest of the strokes 404B-408B can be arranged on the corresponding stroke positions 404A-408A in the same manner.
在一些實施例中,也就是說,由步驟204所產出具有新風格字體外觀的「予」字401,每一筆劃均有一特定筆劃大小,亦即原圖筆劃大小。但因為步驟301是從筆劃資料庫14中選擇出可組成「予」字401的6個筆劃403B-408B,此6個筆劃403B-408B和對應原圖筆劃大小會有落差。因此本案於後續步驟中,會根據「予」字401每一筆劃之原圖筆劃大小對此6個筆劃403B-408B進行調整,以讓調整後6個筆劃403B-408B更貼近於原圖筆劃大小。In some embodiments, that is, each stroke of the character "予" 401 with the new style font appearance generated by step 204 has a specific stroke size, that is, the stroke size of the original image. However, because step 301 selects 6 strokes 403B-408B that can form the character "予" 401 from the stroke database 14, there is a difference between the size of these 6 strokes 403B-408B and the corresponding stroke size of the original image. Therefore, in the subsequent steps of this case, these 6 strokes 403B-408B will be adjusted according to the stroke size of each stroke of the character "予" 401 in the original image, so that the adjusted 6 strokes 403B-408B are closer to the stroke size of the original image.
在一些實施例中,自動調整筆劃裝置10可根據筆劃403B-408B資料,設置每一筆劃403B-408B的關鍵參數組,其中每個筆劃403B-408B,至少包括由貝茲曲線所描述筆劃輪廓的外框,描述筆劃起始點位置及終點位置的至少二控制點參數,以及描述寬度的寬度參數。本案即是藉由調整每一筆劃403B-408B的控制點參數和寬度參數,對筆劃403B-408B進行調整,以貼近於原圖筆劃大小。In some embodiments, the automatic stroke adjustment device 10 can set a key parameter set of each stroke 403B-408B according to the stroke 403B-408B data, wherein each stroke 403B-408B at least includes an outer frame of the stroke outline described by a Bezier curve, at least two control point parameters describing the stroke start point position and the end point position, and a width parameter describing the width. In this case, the stroke 403B-408B is adjusted by adjusting the control point parameters and the width parameter of each stroke 403B-408B to be close to the stroke size of the original image.
於步驟302,調整對應筆劃的控制點參數以修正筆劃外觀。在一些實施例中,如第6圖所示,在筆劃「、」403B被自動配置於對應筆劃位置403A後,調整筆劃「、」403B控制點參數。在一些實施例中,可依循一第一方向調整筆劃「、」403B之X方向值以及Y方向值,以拉伸修正筆劃「、」403B外觀。In step 302, the control point parameters of the corresponding stroke are adjusted to correct the stroke appearance. In some embodiments, as shown in FIG. 6, after the stroke "," 403B is automatically configured at the corresponding stroke position 403A, the control point parameters of the stroke "," 403B are adjusted. In some embodiments, the X-direction value and the Y-direction value of the stroke "," 403B can be adjusted in a first direction to stretch and correct the appearance of the stroke "," 403B.
於步驟303,比對修正後筆劃外觀與對應的原圖筆劃外觀的疊合比率。在一些實施例中,係將拉伸修正後的筆劃「、」403B的外觀和對應筆劃位置403A上的原圖筆劃403C的外觀疊合後進行比對,計算拉伸修正後筆劃「、」403B的外觀疊合於原圖筆劃403C的一疊合比率。在一些實施例中,在依循第一方向拉伸修正筆劃「、」403B之外觀後,在和原圖筆劃403C的外觀疊合比對後,若產生的疊合比率下降,表示所依循拉伸修正的第一方向為錯誤方向。在一些實施例中,於步驟303中更可記錄此次拉伸修正的第一方向為錯誤方向,避免再次依此方向進行拉伸修正。In step 303, the overlap ratio of the corrected stroke appearance is compared with the corresponding original stroke appearance. In some embodiments, the appearance of the corrected stroke "," 403B is overlapped with the appearance of the original stroke 403C at the corresponding stroke position 403A and then compared, and an overlap ratio of the corrected stroke "," 403B overlapped with the original stroke 403C is calculated. In some embodiments, after the appearance of the corrected stroke "," 403B is corrected by stretching in a first direction, after being overlapped and compared with the appearance of the original stroke 403C, if the generated overlap ratio decreases, it means that the first direction of the corrected stroke is an incorrect direction. In some embodiments, in step 303, the first direction of the stretch correction can be recorded as an incorrect direction to avoid stretch correction in this direction again.
於步驟304,調整對應筆劃的寬度參數以修正筆劃面積。在一些實施例中,如第6圖所示,在筆劃「、」403B被自動配置於對應筆劃位置403A後,調整筆劃「、」403B的寬度參數,以修正筆劃「、」403B面積。In step 304, the width parameter of the corresponding stroke is adjusted to correct the stroke area. In some embodiments, as shown in FIG. 6, after the stroke "," 403B is automatically configured at the corresponding stroke position 403A, the width parameter of the stroke "," 403B is adjusted to correct the stroke area "," 403B.
於步驟305,比對修正後筆劃面積與對應的原圖筆劃面積比值。在一些實施例中,係將修正後的筆劃「、」403B的面積和對應筆劃位置403A上的原圖筆劃403C的面積進行比對,計算面積比值,判定修正後的筆劃「、」403B的面積是否接近於對應筆劃位置403A上的原圖筆劃403C的面積。藉由步驟302-305,可讓修正後的筆劃「、」403B的外觀近於原圖筆劃403C。在一些實施例中,步驟302-305會被重複執行,直到疊合比率以及面積比值不再變化或變化小於一特定值為止。在另一些實施例中,亦可設置疊合比率以及面積比值的門檻值,達到此門檻值即不再進行筆劃調整。In step 305, the area ratio of the corrected stroke is compared with the area ratio of the corresponding original stroke. In some embodiments, the area of the corrected stroke "," 403B is compared with the area of the original stroke 403C at the corresponding stroke position 403A, and the area ratio is calculated to determine whether the area of the corrected stroke "," 403B is close to the area of the original stroke 403C at the corresponding stroke position 403A. Through steps 302-305, the appearance of the corrected stroke "," 403B can be close to the original stroke 403C. In some embodiments, steps 302-305 are repeatedly executed until the overlap ratio and the area ratio do not change or change less than a specific value. In other embodiments, a threshold value of the overlap ratio and the area ratio can also be set, and when the threshold value is reached, the stroke adjustment is no longer performed.
依此,於步驟306,判斷疊合比率以及面積比值是否不再變化或小於一特定值。若疊合比率以及面積比值於調整後不再變化或小於一特定值。執行步驟307,完成筆劃的調整以及進行調整後筆劃組字。在一實施例中,若筆劃「、」403B完成調整後,即可根據調整後的控制點參數以及寬度參數,進行筆劃「、」403B組字。反之,若疊合比率以及面積比值於調整後會再變化或不小於一特定值。則再次執行步驟302-305,再次調整對應筆劃的控制點參數和寬度參數修正筆劃外觀以及面積藉以趨近於原圖筆劃403C。「予」字401的其餘筆劃可依上述之流程進行調整,藉以完成「予」字401。而其他字的筆劃也可依上述流程進行調整。Accordingly, in step 306, determine whether the overlap ratio and the area ratio no longer change or are less than a specific value. If the overlap ratio and the area ratio no longer change or are less than a specific value after adjustment. Execute step 307 to complete the adjustment of the stroke and to form characters with the adjusted strokes. In one embodiment, if the stroke "," 403B is adjusted, the stroke "," 403B can be formed into characters based on the adjusted control point parameters and width parameters. On the contrary, if the overlap ratio and the area ratio will change again or be not less than a specific value after adjustment. Then, steps 302-305 are executed again, and the control point parameters and width parameters of the corresponding stroke are adjusted again to correct the stroke appearance and area so as to be close to the original stroke 403C. The remaining strokes of the character "予" 401 can be adjusted according to the above process to complete the character "予" 401. The strokes of other characters can also be adjusted according to the above process.
接著於步驟308,產生各筆劃調整過後的控制點參數以及寬度參數。據此即可依所產生各筆劃的控制點參數以及寬度參數組成具新風格字體的字。Then, in step 308, the control point parameters and width parameters of each stroke after adjustment are generated. According to this, a character with a new style font can be composed according to the generated control point parameters and width parameters of each stroke.
由上述本案之實施方式可知,其主要係用以改進以往在根據字體設計師設計之基礎字集生成一基礎字集外具有新風格字體外觀的新字後,仍需字體設計師對所生成新字的筆劃或位置進行微調以更符合新風格字體,相當耗費時間成本。因此,本案提出一種筆劃調整方法,在根據所生成的新字選擇出對應的筆劃後,本案筆劃調整方法會將所選擇出的筆劃疊合在所生成新字的對應筆劃的原圖筆劃上,並根據和所生成新字的對應筆劃的原圖筆劃間的疊合比率以及面積比值,調整選擇出筆劃的控制點參數和寬度參數,來修正選擇出筆劃的外觀以及選擇出筆劃的面積,藉以讓調整後的筆劃趨近於原圖筆劃。由於本案的筆劃調整方法,無須設計師手動調整選擇出的筆劃,因此可節省大量設計時間。From the implementation method of the present case described above, it can be seen that it is mainly used to improve the previous practice of generating a new character with a new style font appearance outside the basic character set designed by the font designer, and the font designer still needs to fine-tune the strokes or position of the generated new character to better conform to the new style font, which is quite time-consuming. Therefore, this case proposes a stroke adjustment method. After selecting the corresponding stroke according to the generated new character, the stroke adjustment method of this case will overlap the selected stroke on the original stroke of the corresponding stroke of the generated new character, and adjust the control point parameters and width parameters of the selected stroke according to the overlap ratio and area ratio between the original stroke of the corresponding stroke of the generated new character to correct the appearance of the selected stroke and the area of the selected stroke, so as to make the adjusted stroke close to the original stroke. Because the stroke adjustment method of this case does not require the designer to manually adjust the selected stroke, it can save a lot of design time.
另外,上述例示包含依序的示範步驟,但該些步驟不必依所顯示的順序被執行。以不同順序執行該些步驟皆在本揭示內容的考量範圍內。在本揭示內容之實施例的精神與範圍內,可視情況增加、取代、變更順序及/或省略該些步驟。In addition, the above examples include exemplary steps in sequence, but these steps do not have to be executed in the order shown. Executing these steps in different orders is within the scope of the present disclosure. Within the spirit and scope of the embodiments of the present disclosure, these steps can be added, replaced, changed in order and/or omitted as appropriate.
雖然本案已以實施方式揭示如上,然其並非用以限定本案,任何熟習此技藝者,在不脫離本案之精神和範圍內,當可作各種之更動與潤飾,因此本案之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the form of implementation as above, it is not intended to limit the present invention. Anyone skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of the patent application attached hereto.
10: 自動調整筆劃裝置 11: 記憶體 12: 處理器 13: 輸入輸出單元 14: 筆劃資料庫 200:產生具新風格字體的方法 201-207: 步驟 300:自動調整匹配筆劃的方法 301-308: 步驟 403B-408B:筆劃 403A-408A:筆劃位置 403C: 原圖筆劃 A1、A2、B1、B2: 控制點參數 W1、W2: 寬度參數 401: 「予」字10: Automatic stroke adjustment device11: Memory12: Processor13: Input and output unit14: Stroke database200: Method for generating a font with a new style201-207: Steps300: Method for automatically adjusting matching strokes301-308: Steps403B-408B: Strokes403A-408A: Stroke positions403C: Original strokesA1, A2, B1, B2: Control point parametersW1, W2: Width parameters401: The character "予"
此處的附圖被併入說明書中並構成本說明書的一部分,這些附圖示出了符合本發明的實施例,並與說明書一起用於說明本發明實施例的技術方案。 第1圖為根據本案一較佳實施例,一種自動調整筆劃的裝置的方塊圖。 第2圖所示為根據本案一些實施例產生一具新風格字體的方法流程圖。 第3圖所示為根據本案一實施例對一「人」字的筆劃設置關鍵參數組之概略圖示。 第4圖所示為根據本案一些實施例自動調整筆劃的方法流程圖。 第5A圖所示為一具有新風格字體外觀的「予」字。 第5B圖所示為匹配「予」字的6個筆劃。 第5C圖所示為分別框定對應筆劃的位置。 第5D圖所示自動配置筆劃於對應筆劃位置上 第6圖所示為根據本案一較佳實施例筆劃「、」和原圖筆劃比較之概略圖示。The drawings herein are incorporated into and constitute a part of the specification, and these drawings illustrate embodiments consistent with the present invention and are used together with the specification to illustrate the technical solutions of the embodiments of the present invention.Figure 1 is a block diagram of a device for automatically adjusting strokes according to a preferred embodiment of the present invention.Figure 2 is a flow chart of a method for generating a new style font according to some embodiments of the present invention.Figure 3 is a schematic diagram of setting a key parameter set for a stroke of a "人" character according to an embodiment of the present invention.Figure 4 is a flow chart of a method for automatically adjusting strokes according to some embodiments of the present invention.Figure 5A shows a "予" character with a new style font appearance.Figure 5B shows 6 strokes matching the "予" character.Figure 5C shows the positions of the corresponding strokes are framed respectively.Figure 5D shows the strokes are automatically configured at the corresponding stroke positionsFigure 6 shows a schematic diagram of the stroke ", " and the original stroke comparison according to a preferred embodiment of the present invention.
10:自動調整筆劃裝置10: Automatic stroke adjustment device
11:記憶體11: Memory
12:處理器12: Processor
13:輸入輸出單元13: Input and output unit
14:筆劃資料庫14: Stroke database
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113126482ATWI875632B (en) | 2024-07-15 | 2024-07-15 | Automatically adjusting strokes method, apparatus, and non-transitory computer-readable storage media |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| TW113126482ATWI875632B (en) | 2024-07-15 | 2024-07-15 | Automatically adjusting strokes method, apparatus, and non-transitory computer-readable storage media |
| Publication Number | Publication Date |
|---|---|
| TWI875632Btrue TWI875632B (en) | 2025-03-01 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW113126482ATWI875632B (en) | 2024-07-15 | 2024-07-15 | Automatically adjusting strokes method, apparatus, and non-transitory computer-readable storage media |
| Country | Link |
|---|---|
| TW (1) | TWI875632B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1936961A (en)* | 2005-09-23 | 2007-03-28 | 威锋数位开发股份有限公司 | Edge-Shading Guided Grayscale Font Generation Method |
| US20100238472A1 (en)* | 2009-03-19 | 2010-09-23 | Fuji Xerox Co., Ltd. | Character output apparatus, character output method and computer readable medium |
| CN102135836B (en)* | 2011-03-28 | 2013-06-19 | 安徽科大讯飞信息科技股份有限公司 | Superposition hand input method and system |
| TWI575389B (en)* | 2015-06-10 | 2017-03-21 | 文鼎科技開發股份有限公司 | A font deformation method |
| US20170169798A1 (en)* | 2015-12-15 | 2017-06-15 | Canon Kabushiki Kaisha | Method, System and Apparatus for Modifying a Font Character |
| TWI588711B (en)* | 2016-08-02 | 2017-06-21 | Univ Nat Taiwan Normal | Touch type learning method and touch type electronic device |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1936961A (en)* | 2005-09-23 | 2007-03-28 | 威锋数位开发股份有限公司 | Edge-Shading Guided Grayscale Font Generation Method |
| US20100238472A1 (en)* | 2009-03-19 | 2010-09-23 | Fuji Xerox Co., Ltd. | Character output apparatus, character output method and computer readable medium |
| CN102135836B (en)* | 2011-03-28 | 2013-06-19 | 安徽科大讯飞信息科技股份有限公司 | Superposition hand input method and system |
| TWI575389B (en)* | 2015-06-10 | 2017-03-21 | 文鼎科技開發股份有限公司 | A font deformation method |
| US20170169798A1 (en)* | 2015-12-15 | 2017-06-15 | Canon Kabushiki Kaisha | Method, System and Apparatus for Modifying a Font Character |
| TWI588711B (en)* | 2016-08-02 | 2017-06-21 | Univ Nat Taiwan Normal | Touch type learning method and touch type electronic device |
| Publication | Publication Date | Title |
|---|---|---|
| CN107025676B (en) | Picture template, picture generation method and related device | |
| JP2020027524A (en) | Character recognition device, character recognition method, and character recognition program | |
| CN105204860A (en) | Method and device for rapidly generating user-defined static Web page | |
| US8624900B2 (en) | Plug-in architecture for dynamic font rendering enablement | |
| US10061752B2 (en) | Method and apparatus for generating a font of which style is changeable | |
| US9201977B2 (en) | Automatic flowchart-based webpage generation for troubleshooting or task completion without manual programming | |
| CN112416331B (en) | Page adaptation method, device, electronic device and computer-readable storage medium | |
| US10366142B2 (en) | Identifier based glyph search | |
| TWI875632B (en) | Automatically adjusting strokes method, apparatus, and non-transitory computer-readable storage media | |
| US12164886B2 (en) | Method and apparatus for generating applications | |
| JP7383882B2 (en) | Information processing device and information processing program | |
| JP4470913B2 (en) | Character string search device and program | |
| CN102955765A (en) | Method for finely adjusting Chinese characters according to font sizes and Chinese character fine adjustment system | |
| KR102666665B1 (en) | Method, apparatus, computer-redable storage medium and computer program for recommending image | |
| KR102424342B1 (en) | Method and apparatus for generating thumbnail images | |
| CN117829101A (en) | Method, apparatus, device and medium for converting text style | |
| CN117829123A (en) | Method, apparatus, device and medium for processing text | |
| TWI887774B (en) | Automatically generating a character having new-style font method and system thereof | |
| US20230306767A1 (en) | Information processing apparatus, non-transitory computer readable medium, and method for processing information | |
| EP4409457A1 (en) | Design generator for synthesizing templates | |
| CN113743056A (en) | Document conversion method based on paragraph shrinkage amount, computing device and storage medium | |
| CN113886578A (en) | Form classification method and device | |
| CN114296726A (en) | Code generation method and device, computer equipment and storage medium | |
| US20140258302A1 (en) | Information retrieval device and information retrieval method | |
| CN114861621B (en) | Method, device, system and computer program product for generating object description copy |