Font generation method and device, electronic equipment and storage medium
By extracting and rewriting the feature points and boundary feature lines of traditional computer fonts, differentiated dot-shaped or planar auxiliary fonts are generated, which solves the limitations of traditional fonts in memorization and improves memory efficiency.
Patent Information
- Application Number
- CN202411541002.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-31
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional computer fonts have limitations in memorization and memory, and lack sufficient visual differences, which leads to insufficient impression of information in the brain and makes it difficult to form an effective memory anchor.
By obtaining the original font data, extracting the feature points and boundary feature lines of the font, performing rewriting processing, generating dot-shaped auxiliary fonts or planar auxiliary graphic fonts, and differentiating the display results of the font.
By missing and discrete processing of text information, the human brain reduces the inertial thinking and reading habits that rely on traditional fonts, improves memory efficiency, and makes the eyes more matched with the human brain processing information.
Smart Images

Figure CN119478135A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a font generation method, device, electronic equipment and storage medium. Background Art
[0002] The fonts on traditional computers are designed to improve reading comfort and clarity, ensuring that the text content on the screen is both clear and easy to read, and reducing visual fatigue caused by long-term reading. These fonts are carefully adjusted, with optimized spacing, line height, and font thickness to ensure smooth reading and effective communication of information.
[0003] However, although traditional computer fonts perform well in reading, when users try to use these fonts for memorization, they reveal obvious limitations. Studies have shown that such fonts often lack sufficient visual differences, making the information less impressive in the brain and difficult to form effective memory anchors. In addition, the standardized design of traditional computer fonts, while ensuring the uniformity of reading, also weakens the uniqueness of the text itself, further affecting memory efficiency. Therefore, although they have the effect of promoting reading comprehension, they do not play a role in assisting memory.
[0004] Specifically, when users read traditional computer text fonts, they look at computer text with their eyes, not scanning one word at a time, but scanning in areas. However, the input speed of the eyes can never catch up with the processing speed of the brain. After the brain compares and processes the input information of the eyes with the previously stored information of the brain, the brain ignores the input information of the eyes at that time, resulting in the inaccuracy of the current input information, and at the same time affecting the current information processing and memory of the human brain. For example, "The order of Chinese characters does not necessarily affect the reading", when you finish reading this sentence, you will find that the words in this sentence are all messed up. At the same time, for example, "The moon is bright in front of the bed, I wonder if it is frost on the ground", when people read, they have overlapped these two wrong poems with similar scenes in their memory, forming inertial reading, which is not conducive to human processing and memory of information.
[0005] In view of this, the present invention is proposed. Summary of the invention
[0006] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and to provide a font generation method, device, storage medium and electronic device, aiming to solve the problem that current computer fonts affect people's recitation and memory, and effectively reduce the negative impact of inertial thinking and reading habits caused by the human brain's reliance on traditional fonts on the memory effect.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] In a first aspect, the present invention provides a font generation method, comprising:
[0009] S1, obtaining original font data to form a target font library;
[0010] S2. Extract features from the original fonts in the target font library: obtain boundary feature lines corresponding to the fully enveloping rectangular area along the font outline, and obtain feature points corresponding to the writing order and strokes of each font through the font extraction feature model;
[0011] S3. Based on the feature extraction of the original font, the fonts in the target font library are rewritten.
[0012] Furthermore, the original font data in step S1 includes commercial font data or non-commercial font data composed of vector graphics converted from basic font forms outlined by a drawing tool.
[0013] Preferably, the drawing tools include but are not limited to using a pen, pencil, paper or other drawing tools to outline the basic form and structure of the font, digitizing it through a scanner, camera or other device, and converting the sketch into a vector graphic. Professional font design software (such as FontCreator, Fontographer, Glyphs, etc.) can also be used to convert the sketch into a vector graphic, and adjust the font's stroke thickness, curvature, angle and other details, and then generate a traditional font or font library.
[0014] Furthermore, in step S2, the boundary feature line corresponding to the completely enveloping rectangular area is obtained along the font contour line, specifically comprising: treating each font as a font graphic, performing a fitting operation on the font graphic contour line in a two-dimensional plane corresponding to the horizontal and vertical lines, and obtaining the horizontal tangent line corresponding to the highest or lowest contour point of the font graphic contour line and the vertical tangent line corresponding to the leftmost or rightmost contour point of the font graphic contour line, respectively;
[0015] The two horizontal tangent lines and the two vertical tangent lines are intersected to obtain the minimum rectangular area that can completely enclose a font graphic.
[0016] Furthermore, in step S2, the feature points corresponding to the writing order and strokes of each font are obtained through the font extraction feature model, which specifically includes: inputting the font in the target font library into the font extraction feature model, comparing and correcting the position of the font writing order and stroke data of the reference font preset in the font extraction feature model, and determining the font writing order or stroke font feature points of the original font.
[0017] The font feature points of the font writing sequence or the strokes include: the starting point, the end point, the inflection point, the arc point and the intersection point of the font writing sequence or the strokes.
[0018] Furthermore, the rewriting process of the fonts in the target font library in step S3 includes: rewriting process using point-shaped auxiliary fonts, rewriting process using surface-shaped auxiliary graphic fonts, and rewriting process using point-shaped and surface-shaped auxiliary fonts;
[0019] Each stroke of the original font corresponds to a plurality of characteristic points. The corresponding plurality of characteristic points are replaced by indicator symbols and then the outline of the original font is deleted, thus obtaining a dot-shaped auxiliary font.
[0020] Different dot feature densities correspond to different dot auxiliary fonts, which are replaced according to the writing order of the fonts or the starting point, end point, inflection point, arc point and intersection point of the strokes, and then the outline of the original font is deleted to obtain the basic dot font, which is saved for later use;
[0021] The surface auxiliary graphic font is obtained by taking the original font in the target font library as a font graphic, obtaining four characteristic lines that completely envelop a rectangular area corresponding to a font graphic, dividing the four characteristic lines into equal points, connecting all the equally divided points to form a grid-like graphic, arbitrarily filling any one or more grid blocks in the grid, and then deleting the glyph outline of the original font to obtain the surface auxiliary graphic font, and saving it for later use.
[0022] Furthermore, the specific steps of the dot-shaped auxiliary font rewriting process are as follows: when the system receives the instruction for generating the dot-shaped auxiliary font, a Boolean operation is performed on the original font and the corresponding dot-shaped auxiliary font, and different dot-shaped auxiliary font processing results are obtained by changing the density of the dot features corresponding to the font;
[0023] The specific steps of the planar auxiliary graphic font rewriting process are as follows: when the system receives the planar auxiliary graphic font generation instruction, Boolean operations are performed on the original font and the corresponding planar auxiliary graphic font, and different planar auxiliary graphic font processing results are obtained by changing the size of the filling area in each font graphic;
[0024] The specific steps of the point-shaped and surface-shaped auxiliary graphic font rewriting process are as follows: when the system receives the instruction to generate the point-shaped and surface-shaped auxiliary graphic font, Boolean operations are performed on the original font, the point-shaped auxiliary font and the corresponding surface-shaped auxiliary graphic font, and different point-shaped and surface-shaped auxiliary graphic font processing results are obtained by changing the size of the filling area in each font graphic and the point feature density corresponding to the font.
[0025] Furthermore, the font typesetting order corresponding to the rewriting process of the point-like and surface-like auxiliary fonts is: the first layer is the background layer, the second layer is the original font layer, the third layer is the surface-like auxiliary graphic font layer, and the last layer is the point-like auxiliary font layer. The surface-like auxiliary graphic font layer can also be used as a mask layer as the top layer of font typesetting.
[0026] In a second aspect, the present invention further provides a font generation device, comprising:
[0027] Original font module: used to obtain original font data;
[0028] Feature extraction module: Use the font extraction feature model to extract features from the original font to obtain point features and line features corresponding to the font graphics;
[0029] Rewriting generation module: rewrites the original font based on font features to generate a new auxiliary font or text font.
[0030] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor,
[0031] The memory is connected to the processor and is used to store programs.
[0032] The processor is used to implement the steps of the font generation method proposed in the first aspect by running the program in the memory.
[0033] In a fourth aspect, the present invention provides a storage medium, comprising: a computer program, when the storage medium is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the font generation method proposed in the first aspect.
[0034] Compared with the prior art, the technical solution provided by the present invention has the following beneficial effects:
[0035] The present application provides a font generation method, which generates text dot-shaped auxiliary fonts or surface-shaped auxiliary graphic fonts, etc., differentiates the glyph display results of the font, and processes the missing and discretized complete text information, so that part of the information required for memory or reading is missing. Under the condition of keeping the original acquisition speed of the human eye unchanged, the process of the human brain using the existing reserve information to supplement and improve the information is increased due to the lack of current information, the processing speed of the human brain information is artificially reduced, and the influence of the human brain's inertial thinking and inertial reading on the acquisition and memory of the human eye information is reduced, so as to achieve the matching of the information acquired by the eyes and the information processed by the human brain, and realize the traditional sense of reading "eyes", "heart" and "mouth", thereby improving the efficiency of memory. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The accompanying drawings are incorporated in and constitute a part of this specification and, together with the description, serve to explain the principles of the present invention.
[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0038] Figure 1 A schematic diagram of the flow of the font generation method of the present invention;
[0039] Figure 2 It is a schematic diagram of the flow of the font rewriting process of the present invention;
[0040] Figure 3 It is a schematic diagram of the process of dot-shaped auxiliary font processing in the present invention;
[0041] Figure 4 This is a preview of the effect of generating dot-shaped auxiliary fonts in the present invention. Figure 1 ;
[0042] Figure 5 This is a preview of the effect of generating dot-shaped auxiliary fonts in the present invention. Figure 2 ;
[0043] Figure 6 It is a schematic diagram of the process of processing the plane auxiliary graphic font in the present invention;
[0044] Figure 7 It is a font graphic schematic diagram of the planar auxiliary graphic font in the present invention;
[0045] Figure 8 This is a preview of the effect of generating the surface auxiliary graphic font in the present invention. Figure 1 ;
[0046] Fig. 9 This is a preview of the effect of generating the surface auxiliary graphic font in the present invention. Figure 2 ;
[0047] Fig.10 This is a preview of the effect of generating the surface auxiliary graphic font in the present invention. Figure 3 ;
[0048] Fig.11 This is a preview of the effect of generating the surface auxiliary graphic font in the present invention. Figure 4 ;
[0049] Fig.12 Schematic diagram A of the Boolean operation result of the intersection of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention;
[0050] Fig.13 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 1 ;
[0051] Fig.14 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 2 ;
[0052] Fig.15 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 3 ;
[0053] Fig.16 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 4 ;
[0054] Fig.17 Schematic diagram B of the result of Boolean operation of point-shaped auxiliary fonts and surface-shaped auxiliary graphic fonts in the present invention;
[0055] Fig.18 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 1 ;
[0056] Fig.19 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 2 ;
[0057] Fig. 20 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 3 ;
[0058] Fig.21 This is a preview of the effect of the Boolean operation result of the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 4 ;
[0059] Fig. 22 is a schematic diagram of a font file font sample preview of the original font of the present invention;
[0060] Fig.23 Schematic diagram A of the result of Boolean operation of the original font and the planar auxiliary graphic font in the present invention;
[0061] Fig.24 This is a preview of the effect of the Boolean operation result of the original font and the planar auxiliary graphic font in the present invention. Figure 1 ;
[0062] Fig.25 This is a preview of the effect of the Boolean operation result of the original font and the planar auxiliary graphic font in the present invention. Figure 2 ;
[0063] Fig.26 This is a preview of the effect of the Boolean operation result of the original font and the planar auxiliary graphic font in the present invention. Figure 3 ;
[0064] Fig. 27 This is a preview of the effect of the Boolean operation result of the original font and the planar auxiliary graphic font in the present invention. Figure 4 ;
[0065] Fig.28 Schematic diagram B of the result of Boolean operation of the original font and the planar auxiliary graphic font in the present invention;
[0066] Fig.29 This is a preview of the effect of the Boolean operation result diagram B of the original font and the planar auxiliary graphic font in the present invention. Figure 1 ;
[0067] Fig.30 This is a preview of the effect of the Boolean operation result diagram B of the original font and the planar auxiliary graphic font in the present invention. Figure 2 ;
[0068] Fig.31 This is a preview of the effect of the Boolean operation result diagram B of the original font and the planar auxiliary graphic font in the present invention. Figure 3 ;
[0069] Fig.32 This is a preview of the effect of the Boolean operation result diagram B of the original font and the planar auxiliary graphic font in the present invention. Figure 4 ;
[0070] Fig.33 Schematic diagram A of the result of Boolean operation of the original font, the point-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention;
[0071] Fig.34 This is a preview of the effect of the Boolean operation result of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 1 ;
[0072] Fig.35 This is a preview of the effect of the Boolean operation result of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 2 ;
[0073] Fig.36This is a preview of the effect of the Boolean operation result of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 3 ;
[0074] Fig.37 This is a preview of the effect of the Boolean operation result of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 4 ;
[0075] Fig.38 Schematic diagram B of the result of Boolean operation of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention;
[0076] Fig.39 This is a preview of the effect of the Boolean operation result diagram B of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 1 ;
[0077] Fig.40 This is a preview of the effect of the Boolean operation result diagram B of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 2 ;
[0078] Fig.41 This is a preview of the effect of the Boolean operation result diagram B of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 3 ;
[0079] Fig.42 This is a preview of the effect of the Boolean operation result diagram B of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font in the present invention. Figure 4 ;
[0080] Fig.43 It is a schematic diagram of processing of display typesetting effect of commercial fonts in the present invention;
[0081] Fig.44 It is a font schematic diagram with prompt information of the present invention;
[0082] Fig.45 is a schematic diagram of a font typesetting result with prompt information of the present invention;
[0083] Fig.46 It is a structural schematic diagram of the font generating device of the present invention. DETAILED DESCRIPTION
[0084] Here, exemplary embodiments will be described in detail, and examples thereof are shown in the accompanying drawings. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are only examples consistent with some aspects of the present invention as detailed in the appended claims.
[0085] First of all, most existing electronic devices use preset standard fonts for input and display. The original design intention is mainly focused on improving the comfort and clarity of reading, but when humans try to use these standard fonts for recitation and memorization, they expose obvious limitations. The technical solution in this application is used to differentiate the glyph display results of the original standard font, and the complete text information is missing and discretized, so that the required memory or reading information is partially missing, solving the problem that the current computer font affects people's recitation and memory, and effectively reducing the negative impact of the inertial thinking and reading habits of the human brain due to reliance on traditional fonts on the memory effect. The method in this application can be run and implemented on an electronic device. Specifically, the electronic device can be a server or a terminal, etc. The server can be any type of server, such as a physical server or a cloud server, and the terminal can be any type of terminal device, such as a computer, a handheld terminal, a wearable terminal device, etc.
[0086] In the computer field, a font is a graphical representation used to present text characters on the screen or in printed materials. It is a collection of characters, each of which has specific attributes such as shape, size, weight, style (such as italic, bold), and spacing. Fonts define the visual appearance of text, allowing text to be presented in different styles and forms to meet different design and reading needs. Font files usually contain a series of glyphs, which are the basic graphic elements that make up characters. When a computer system or application needs to display or print text, it calls the corresponding glyphs from the font file to render the characters. The choice of font has an important impact on the appearance, readability, and overall atmosphere of the document. In computer systems, fonts usually exist in the form of files, such as TrueType (.ttf), OpenType (.otf), WOFF (WebOpenFontFormat), and other formats. These font files can be loaded and used by operating systems, applications, or web browsers to display or print text in various styles on the screen.
[0087] In general, fonts in the computer field are a graphical representation of text characters. They provide a variety of visual expressions for text by defining the shape, size, thickness, style, and spacing of characters.
[0088] According to an embodiment of the present invention, Figure 1 As shown, the present invention provides a font generation method, which specifically includes the following steps:
[0089] 1. Obtain original font data to form a target font library.
[0090] The basic form and structure of the font sketched with a pen, pencil, paper or other drawing tools are digitized through a scanner, camera and other equipment, or, when the method is used as a functional module in a system, images transmitted from other modules can be received through a data interface and other means; then, professional font design software (such as FontCreator, Fontographer, Glyphs, etc.) is used to convert the sketch into a vector graphic, and the font's stroke thickness, curvature, angle and other details are adjusted, and then font data or font library is generated. This means that the user can directly refer to the missing font effect finally achieved by the patent of this invention at the very beginning, use traditional hand-drawn or software font production methods to sketch the missing font form, and then create the font through vectorization.
[0091] You can also directly open or import finished commercial or non-commercial fonts for further processing.
[0092] The font data obtained above are collectively referred to as original font data, that is, the target font library.
[0093] 2. Perform feature extraction on the original fonts in the target font library: obtain the boundary feature lines corresponding to the fully enclosed rectangular area along the font outline, and obtain the feature points corresponding to the writing order and strokes of each font through the font extraction feature model.
[0094] First, feature extraction of boundary feature lines of the original font includes:
[0095] Perform close fitting operations on the font glyph outline horizontally and vertically up, down, left and right to obtain the horizontal and vertical feature lines of the minimum rectangular area boundary that completely envelops (i.e., contains and fits closely to) a glyph (usually refers to the image representation of a single character or symbol), and determine the font feature value of the original font.
[0096] Specifically:
[0097] Perform close fitting operations on the font graphic contour line corresponding to the horizontal and vertical lines up, down, left and right to obtain the horizontal tangent of the highest contour point of the font graphic contour line, the horizontal tangent of the lowest contour point of the font graphic contour line, the vertical tangent of the leftmost contour point of the font graphic contour line, and the vertical tangent of the rightmost contour point of the font graphic contour line. The two horizontal tangents and the two vertical tangents intersect to obtain the minimum rectangular area that can completely envelop (i.e. contain and fit closely) a glyph (usually refers to the image representation of a single character or symbol). This rectangular area defines the spatial range of the glyph, including all its strokes, decorations and possible extensions (such as the ascenders or descenders of some characters). In this way, the feature line position and length data of the horizontal and vertical feature lines of the minimum rectangular area boundary of the font glyph file are obtained.
[0098] Secondly, the feature points corresponding to the writing order and strokes of each font are extracted through the font feature extraction model, including:
[0099] The fonts in the target font library are input into the font feature extraction model, and compared with the writing order and stroke data of the reference fonts preset in the font feature extraction model for position correction, so as to determine the font feature points of the writing order or strokes of the original font. The font feature points of the writing order or strokes include: the starting point, ending point, folding point, arc point, and intersection point of the writing order or strokes, and also include: multiple feature points corresponding to each stroke of the original font on the corresponding writing stroke. For example: for the font "一", there are not only the feature points of the starting point and ending point on its horizontal stroke, but also can include the midpoint, multiple feature points between the starting point and the midpoint, and multiple feature points between the midpoint and the ending point.
[0100] In Chinese character writing, a stroke is the smallest continuous writing unit that constitutes the shape of a Chinese character and is the basic element of a Chinese character. In syllabic writing systems such as Japanese kana, although there are certain requirements for connected writing and order in writing kana, it is usually not called a "stroke", but rather focuses more on the overall writing style and fluency. In pictographic writing systems such as ancient Egyptian hieroglyphics. These writing systems may have certain strokes or lines in writing, but their specific names and classifications may vary due to culture and are not necessarily all called "strokes". Although there are differences in writing methods and constituent elements among different writing systems, they all follow certain writing rules and orders. Whether it is the stroke order of Chinese characters or the writing order of alphabetic writing, it is to ensure the readability and beauty of the text.
[0101] To ensure the recognizability of the original font data during the later font rewriting process, by scanning the outline of the font glyph, the boundaries of the writing order or strokes at each position of the original font data glyph are determined, such as the horizontal (一), vertical (丨), left-falling stroke (丿), right-falling stroke dot (丶), rising stroke folding stroke (乛), hook stroke (亅), etc. By scanning from left to right or from top to bottom, the starting position and ending position of each stroke in the font glyph are determined, that is, the starting point and the ending point; and the self-changing feature points of the stroke, such as the folding point of the stroke or the radian change point of the conversion between the horizontal and vertical lines and arcs of the stroke. These basic strokes form thousands of Chinese characters through different combinations and changes. All strokes and stroke intersection points and other feature points in the glyph of the original font data are determined by the same method of scanning.
[0102] For fonts of any other language or text fonts without stroke features, such as English alphabetic characters, Japanese kana, pictographic characters, etc., the scanning direction of the original font data is determined according to the traditional writing order, so as to determine the starting point and end point of the writing order, the intersection points of each writing order in the writing order, and the characteristic points of the arc change in the writing order. For example, for the English letter O, the vertex characteristic points of the upper, lower, left and right arcs of the letter shape are determined by scanning, and one or more characteristic point positions of the arc change are determined within the upper vertex and right vertex and the outline of the letter O shape.
[0103] The font graphic is input into a font feature extraction model to generate a font feature value of the font graphic. The font feature extraction model determines the font feature value of the font graphic by comparing and position-correcting the font graphic with preset reference font data.
[0104] The font feature extraction model is a set of preset reference font glyph writing order or stroke data, font glyph writing order or stroke data feature point marking and processing rules for each character in a certain font library. That is, according to the processing rules and operations described in the previous paragraphs, the feature points of each character in a certain font library are marked one by one, the reference position of each character font glyph writing order or stroke feature value point is determined, and the preset reference font glyph writing order or stroke data is generated. The implementation case of the character set, that is, the font library, is a collection of visual characters specifically presented in the computer by the character set. The character set defines the encoding method of the characters, and the font library contains the specific visual form of these characters. For example: GB2312 is the Chinese national standard simplified Chinese character set, the full name of which is "Chinese Character Encoding Character Set for Information Exchange Basic Set", which contains 6763 commonly used Chinese characters and 682 non-Chinese characters (including Latin letters, Greek letters, Japanese Hiragana and Katakana letters, Russian Cyrillic letters, etc.). Many traditional Chinese fonts, such as "Songti" and "Kaiti", provide fonts of the GB2312 character set. Generate a preset reference font glyph writing order or stroke data, that is, the position of the glyph writing order or stroke feature value point in the glyph of each character in "Songti" or "Kaiti". The specific position of the feature point in the character can be symbolized using graphics such as points and circles, or the specific position of each feature point in the reference coordinate system of each character can be represented by an array form (such as: x, y), thereby determining the relative position relationship of all feature points.
[0105] The font graphic is compared with the preset reference font data and the position is corrected to determine the font feature value of the font graphic. That is, the character of the feature point to be determined is compared with the preset reference font data to determine the alignment of the two characters, such as aligning the origin of the reference coordinate system of the two data. Then compare whether each stroke feature point data in the preset reference font data is inside the stroke graphic corresponding to the character of the feature point to be determined, and whether the distance between the feature point position and the midline, end point, etc. of the character glyph stroke of the feature point to be determined meets the error requirements. If the error requirements are met, the coordinate position of the original feature point is the position of the character feature point of the feature point to be determined. If the preset feature point position, specifically the midline, end point, etc. of the character glyph stroke of the feature point to be determined exceeds the allowable error, then move the feature point to the midline and end point of the glyph stroke again. After the new position is moved to meet the error requirements, the new coordinate position is the position of the character feature point of the feature point to be determined. The error is the maximum distance allowed for the feature point coordinates to be from the corresponding glyph stroke center line, stroke outline, writing order or stroke endpoint. The allowable error for each font may be different. The general allowable error is one-fourth of the width of the glyph horizontal and vertical strokes.
[0106] According to an embodiment of the present invention, for the above-mentioned allowable error, in font design, the glyph is represented by an outline, and the outline is composed of points on virtual coordinates, and the position of the point is measured by the font unit FUnit. FUnit is the smallest unit of measurement in the em square, and the em square is a virtual square used to measure the size and alignment of the glyph. The size of FUnit changes with the em square, but it is always kept as the smallest unit of measurement to ensure the accuracy of the glyph outline. In the present invention, the allowable error is controlled within a quarter of FUnit to ensure the clarity and consistency of the glyph.
[0107] At the same time, different fonts have different numbers of characters due to the different character sets they implement. The implementation case of a character set, that is, a font, is a collection of visual characters that the character set specifically presents in a computer. The character set defines how characters are encoded, while the font contains the specific visual form of these characters. GB2312 "Basic Set of Chinese Coded Character Set for Information Interchange" includes a total of 6,763 Chinese characters and 682 full-width non-Chinese characters. GB13000 "Information Technology Universal Multi-Octet Coded Character Set (UCS) Part 1: Architecture and Basic Multilingual Plane" ISO / IEC10646:2020 continues to expand on this basis, including 93,888 Chinese characters. When comparing and correcting the position of the font graphic with the preset reference font data, if the characters in the font library with the feature points to be determined exceed the preset reference font data, that is, the characters in the font library with some feature points to be determined do not have the reference font data of the corresponding characters, the characters in the font library with the feature points to be determined without comparison data are linearly processed, that is, the glyph contour line of the character is contracted to the inside of the contour, so as to determine the center line of each writing sequence or stroke. The intersection of the center line of each writing sequence or stroke and the center line are the intersection feature points of more than two glyph writing sequences or strokes, and the two endpoints of the center line of each writing sequence or stroke are the starting point or end point of the glyph writing sequence or stroke.
[0108] In summary, the font graphic is scanned and analyzed to determine the stroke or writing order feature points of any language font, the font graphic is input into the font feature extraction model, and the font feature value of the font graphic is determined by comparing and position-correcting the font graphic with the preset reference font data. That is, feature points such as the starting point of the glyph writing order or stroke, the end point of the glyph writing order or stroke, the inflection point of the glyph writing order or stroke, the arc point of the glyph writing order or stroke, and the intersection of two or more glyph writing orders or strokes are obtained.
[0109] 3. Based on the feature extraction of the original font, the fonts in the target font library are rewritten.
[0110] like Figure 2 As shown, the flowchart of the font rewriting process provided by the present invention is shown. After the preparation work of the original font rewriting process is completed, the point-shaped auxiliary font and the surface-shaped auxiliary graphic font are obtained, and the original font can be rewritten according to different instructions to generate a new text font. This includes: performing Boolean operations between the original font and the point-shaped auxiliary font to generate different fonts; performing Boolean operations between the original font and the surface-shaped auxiliary graphic font to generate different fonts; performing Boolean operations between the original font, the point-shaped auxiliary font, and the surface-shaped auxiliary graphic font to generate different fonts, etc.
[0111] The Boolean operation is also called the logical operation of the set, that is, the font glyph outline and internal filling are regarded as sets. The Boolean operation of the set mainly uses the following symbols to represent different operation types: Union symbol: ∪; Intersection symbol: ∩; Difference symbol: - or \; Symmetric Difference: symbol: or △; complement symbol: ' (usually single quotes or overscores are used, but the specific symbol may vary depending on the context), etc. The present invention mainly performs Boolean operations on the point-shaped auxiliary font outline, surface-shaped auxiliary graphic font outline, and original font outline information in the minimum rectangular area of the complete enveloping glyph outline formed by the intersection of two horizontal feature lines and two vertical feature lines in each character to generate a new font outline. That is, the minimum rectangular area of the complete enveloping glyph outline formed by the intersection of two horizontal feature lines and two vertical feature lines in each character is the full set of set Boolean operations in the present invention, and any set operation is performed within the scope of the full set of each character.
[0112] The number of results of Boolean operations on multiple collection objects is uncertain. It is affected by factors such as the number of objects involved in the operation, the type and number of Boolean operators used, the distribution of truth values of the operation objects, the complexity and nestedness of the operation, etc. Although there may be a large number of potential results, in the actual application of the present invention, users can only care about those results that meet specific conditions as needed. In the embodiment, only some of the operation results are used to perform Boolean operations to explain the results of the embodiment.
[0113] First, the original font is processed into a dot-shaped auxiliary font and a corresponding surface-shaped auxiliary graphic font and saved for later use.
[0114] Specifically, each stroke of the original font corresponds to multiple feature points. The corresponding multiple feature points are replaced by indicator symbols and then the glyph outline of the original font is deleted, so that a dot-shaped auxiliary font is obtained. Different point feature densities correspond to different dot-shaped auxiliary fonts. The basic dot-shaped font is obtained by replacing the font writing order or the starting point, end point, inflection point, arc point and intersection point of the strokes and then deleting the glyph outline of the original font, and saving it for later use.
[0115] Specifically, the surface auxiliary graphic font is obtained by taking the original font in the target font library as a font graphic, obtaining four feature lines that completely envelop a rectangular area corresponding to a font graphic, dividing the four feature lines into equal points, connecting all the equally divided points to form a grid-like graphic, arbitrarily filling any one or more grid blocks in the grid, deleting the glyph outline of the original font to obtain the surface auxiliary font, and saving it for later use.
[0116] According to an embodiment of the present invention, the specific steps of obtaining the dot-shaped auxiliary font are: when the system receives an instruction to generate a dot-shaped auxiliary font, Figure 3 As shown in the flowchart of dot-assisted font processing, first, determine the font writing order or stroke indicator icon. The indicator icon mainly explicitly marks the font's glyph writing order or the starting point of the stroke, the end point of the glyph writing order or the stroke, the inflection point of the glyph writing order or the stroke, the arc point of the glyph writing order or the stroke, the intersection point of two or more glyph writing orders or strokes, and other feature points. The indicator icon is not fixed to a certain icon and can be adjusted according to the font application scenario. Figure 3 In the embodiment, □ is used to represent the intersection feature point of two glyph writing orders or strokes, ▽ and △ are used to represent the feature points of the starting point or end point of the glyph writing order or stroke, and ○ is used to represent the glyph writing order or stroke with curvature or glyph change or alteration. Next, according to the obtained coordinate data of the position of the glyph writing order or stroke writing feature point of the original font, different font writing order or stroke indicator icons are placed at appropriate positions according to the coordinate data. Figure 3 After that, if Figure 3 As indicated by c in the figure, the operation result of the previous step is imported into the glyph file of the original font for matching, so that the font writing order or the stroke indicator icon obtains the relevant attributes of the corresponding font; Figure 3 Indicated by d in the figure, the indicator icon that exceeds the glyph outline of the original font is fine-tuned to make the indicator icon completely inside the glyph outline. Finally, the glyph outline of the original font is deleted, and only the relevant attribute information of the original font and the font writing order or the graphic outline information of the stroke indicator icon are retained. The indicator icon and the glyph outline of the original font can also be directly used for Boolean operation to only retain the glyph outline inside the indicator icon, and the glyph outline outside the indicator icon is no longer retained. Finally, the result of the previous step, that is, the adjusted or processed indicator icon, is shown in Figure 3 The e in the above figure is stored and saved separately in the form of a font file to generate a dot-shaped auxiliary font. Figure 4 and Figure 5 As shown, these font files can be loaded and used by an operating system, an application, or a web browser, etc., and can also be further processed.
[0117] like Figure 4 Dotted auxiliary font font file preview effect diagram and Figure 5 As shown in the preview effect diagram of the dot-shaped auxiliary font font file, the original font shape outline is simplified into a dot-shaped font indicator symbol through the font writing order or stroke indicator symbols such as ○, □, ▽ and △. Figure 4 and Figure 5By reducing or increasing the number or density of indicator icons in each glyph in the font file, the original font's recognizability is reduced or increased. Figure 4 The writing order or number of stroke indicator icons of the dot-shaped auxiliary fonts in Figure 5 The writing order of the Chinese font or the number of strokes indicating the icons. Figure 5 The font recognizability is significantly better than Figure 4 The font shown. When using the patent of the present invention, as the proficiency of memory increases or decreases, the user can select fonts with different recognition to realize information prompts, such as: selecting a high-recognition font when the memory proficiency is low, and selecting a low-recognition font when the memory proficiency is high, or selecting a font with a specified recognition according to one's own preference, so as to avoid the complete text information providing too much information image memory during the memory process.
[0118] According to an embodiment of the present invention, the specific steps of obtaining the planar auxiliary graphic font are as follows: when the system receives an instruction to generate a planar auxiliary graphic font, Figure 6 As shown, a Boolean operation is performed on the original font and the corresponding plane auxiliary graphic font, and different plane auxiliary font processing results are obtained by changing the size of the filling area in each font graphic.
[0119] First, based on the outline of the font glyph, horizontal and vertical lines are fitted up and down and left and right, and the characteristic lines of the horizontal and vertical characteristic lines that completely envelop (i.e., contain and fit closely) a glyph (usually refers to the image representation of a single character or symbol) are obtained and the original font is processed according to the preset rules. The preset rules include, but are not limited to, operations such as determining the number of equally divided points of the characteristic lines, the midpoint of the geometric center of the graphic, and the shape of the surface auxiliary graphic. Figure 6 As shown in the embodiment, the two horizontal and two vertical feature lines of the original font are divided into five equal parts, and each feature line has four equal points, such as Figure 6 As shown in the third figure from left to right in area A, there are 6 corresponding characteristic lines on each characteristic line, including the intersection of the horizontal and vertical characteristic lines.
[0120] Next, different feature points are connected as needed to form different surface auxiliary graphics. Figure 6 The first column in the middle B area connects the 2nd, 3rd, 4th and 5th feature points of the vertical feature line from top to bottom. Figure 6 The second column of area B in the middle connects the 2nd, 3rd, 4th, and 5th feature points of the horizontal feature line from left to right. Figure 6 The third column of area B connects the intersection points of the horizontal characteristic line and the vertical characteristic line. Figure 6The fourth column in the middle B area is a circle with the geometric center point of the plane geometric figure surrounded by the horizontal characteristic line and the vertical characteristic line as the center and the shortest distance to the horizontal characteristic line or the vertical characteristic line as the radius, and the circle is divided into 4 equal parts. Figure 6 The fifth column of the middle B area connects the horizontal or vertical feature points except the intersection feature points of the horizontal feature lines and the vertical feature lines, and divides the area closed by the horizontal feature lines and the vertical feature lines into different grids. At the same time, the lines connecting the dividing points of the horizontal feature lines and the vertical feature lines intersect each other in the closed area to form new intersection feature points. The intersection feature points can also be connected in a certain order to form closed areas of various shapes and patterns.
[0121] Next, a planar auxiliary graphic is generated based on the horizontal and vertical feature lines of the original font, the connecting lines of each feature line, etc., and the area within the closed graphic is filled, such as Figure 7 shown. Figure 7 The first column corresponds to Figure 6 The rectangular surface auxiliary figure formed by the characteristic lines and the characteristic point connecting lines in the first column of the middle B area gradually increases in area from top to bottom; Figure 7 The second column corresponds to Figure 6 The rectangular surface auxiliary figure formed by the characteristic lines and the characteristic point connecting lines in the second column of the middle B area gradually increases in area from left to right; Figure 7 The third column corresponds to Figure 6 A triangular surface auxiliary graphic formed by the characteristic lines and characteristic point connecting lines in the third column of the middle B area, the triangular surface auxiliary graphic divides the area surrounded by the horizontal and vertical characteristic lines of the original font into two equal parts; Figure 7 The fourth column corresponds to Figure 6 The circular surface auxiliary figure formed by the circle in the fourth column of the middle B area and the horizontal and vertical dividing lines is divided by the horizontal and vertical dividing lines to form four semicircles at the upper, lower, left and right sides. Figure 7 The fifth column corresponds to Figure 6 In the fifth column of the middle B area, the grid surface auxiliary figure formed by the horizontal and vertical feature lines and the feature point connection lines is selected to fill one or more small grid surface blocks in the grid surface auxiliary figure to obtain a random grid surface auxiliary figure. At the same time, various figures formed by the connection of cross feature points can also be filled. Figure 7 As shown, a group of surface auxiliary graphic font graphics can be regarded as the same surface graphic, and the position and size of the graphic in the character can be changed by enlarging, reducing, shifting and rotating. Figure 7 The first column of four surface-shaped auxiliary graphics can be seen as a rectangle enlarged in the vertical direction according to a certain ratio. Figure 7 The 4 surface-shaped auxiliary graphics in the second column can be seen as a rectangle enlarged horizontally at a certain ratio. Figure 7The 4 types of surface auxiliary graphics in the third column can be seen as a surface triangle rotated at a certain angle to achieve different surface auxiliary graphics font graphics. Surface auxiliary graphics can be generated in real time according to the user's selection. Users can also directly import the selected graphics and place the surface auxiliary graphics in the appropriate position by zooming in, out, shifting and rotating.
[0122] Finally, the plane auxiliary graphic font graphic obtained in the previous step is imported into the corresponding original font, so that the plane auxiliary graphic font graphic obtains the attribute information of the corresponding original font, and the glyph outline information of the original font is deleted, and only the plane auxiliary graphic font graphic outline is retained. It is stored and saved separately in the form of a font file to generate a plane auxiliary graphic font.
[0123] According to an embodiment of the present invention, Figures 8 to 11 In accordance with Figure 7 The first column shows the font file preview effects of different surface auxiliary graphic fonts generated by each surface auxiliary graphic font graphic rule from top to bottom. The original font example content of the preview effect in the Windows operating system is "Innovation in China, Chinese wisdom, and global wisdom". Each character in the font demonstration content is processed through the above steps to obtain surface auxiliary graphic font files of different proportional widths.
[0124] in, Figure 8 In accordance with Figure 7 The font file preview effect diagram of the planar auxiliary graphic font generated by the planar auxiliary graphic font graphic rule in the first column and the first row, the planar auxiliary graphic font graphic rule of each character in the preview effect diagram is the same, that is, the rectangular height of the planar auxiliary graphic font of each character in the preview effect diagram is the same as the height of the vertical characteristic line of the original font of the corresponding character obtained, both of which are the height of the vertical characteristic line of each character; the rectangle width is 20% of the length of the horizontal characteristic line of the original font of each character. Fig. 9 In accordance with Figure 7 The preview effect diagram of the planar auxiliary graphic font file generated by the planar auxiliary graphic font graphic rule in the first column and the second row has the same planar auxiliary graphic font graphic rule for each character in the preview effect diagram, that is, the rectangular height of the planar auxiliary graphic font of each character in the preview effect diagram is the same as the height of the vertical characteristic line of the original font of the corresponding character obtained, both of which are the height of the vertical characteristic line of each character; the rectangle width is 40% of the length of the horizontal characteristic line of the original font of each character. Fig.10 In accordance with Figure 7The preview effect diagram of the font file of the planar auxiliary graphic font generated by the planar auxiliary graphic font graphic rule in the first column and the third row has the same planar auxiliary graphic font graphic rule for each character in the preview effect diagram, that is, the rectangular height of the planar auxiliary graphic font of each character in the preview effect diagram is the same as the height of the vertical characteristic line of the original font of the corresponding character obtained, both of which are the height of the vertical characteristic line of each character; the rectangle width is 60% of the length of the horizontal characteristic line of the original font of each character. Fig.11 In accordance with Figure 7 The font file preview effect diagram of the planar auxiliary graphic font generated by the planar auxiliary graphic font graphic rule in the first column and the fourth row, the planar auxiliary graphic font graphic rule of each character in the preview effect diagram is the same, that is, the rectangular height of the planar auxiliary graphic font of each character in the preview effect diagram is the same as the height of the vertical feature line of the original font of the corresponding character obtained, both of which are the height of the vertical feature line of each character; the rectangle width is 80% of the length of the horizontal feature line of the original font of each character.
[0125] In summary, according to the graphic rules of the surface auxiliary graphic fonts of different characters, each character in the original font library can generate a corresponding surface auxiliary graphic font, and form a font library with the same surface auxiliary graphic font graphic rules. Figures 8 to 11 As shown in the figure, all of them are newly generated fonts based on vertical rectangular surface auxiliary graphics. The difference between the font files is mainly the difference in the size and coverage area of the vertical rectangular surface auxiliary graphics. However, the other properties of the surface auxiliary graphics font are consistent with the original font information.
[0126] After the original font rewriting preparation work is completed, a dot-shaped auxiliary font and a surface-shaped auxiliary graphic font are obtained. Each character in the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font is derived from the corresponding character rewriting preparation work in the original font, and has the same attribute value as the original font. The same attributes are present in various tables in the font format file, including multiple key attributes of the glyph, which together define the appearance range of the glyph and its position in the text. For example: the attributes in the GPOS glyph positioning table in the font format file: its main function is to provide adjustment information for the position relationship between glyphs, including horizontal or vertical spacing adjustment (such as word spacing adjustment), position offset, etc. And other attributes in other file tables, such as the name of each glyph, which may be based on Unicode code points, glyph indexes or other internal encoding systems; Unicode code points; Leftsidebearing (LSB) left margin; Rightsidebearing (RSB) right margin; Advancewidth step width; Offset offset and other attributes. These attributes together define the appearance range, size and position of glyphs in the point-assisted fonts, surface-assisted graphic fonts and original fonts, and are an integral part of the font design and typesetting process. The original font and the point-assisted fonts of each font have the same attributes, laying the foundation for Boolean operations based on the positional relationship between the original font and the point-assisted fonts.
[0127] Based on whether the font file allows users to freely modify, customize and distribute. Fonts can be divided into two categories: commercial fonts and non-commercial fonts. Non-commercial fonts: have the characteristics of open source code, allowing users to freely obtain, use, modify and distribute without copyright restrictions or fees. This openness promotes the sharing and innovation of fonts, allowing designers, developers, etc. to use and customize fonts flexibly. Due to the openness of the source code, developers or designers can modify and customize fonts as needed to create new font styles that meet specific needs. Commercial fonts: are usually protected by copyright, and users need to obtain authorization or pay fees to use them legally. Users usually cannot directly modify their source code or design elements. If customization or adjustments are required, you may need to contact the font designer or copyright owner for negotiation.
[0128] In order to achieve the same font effect and accurately describe the processing methods of the present invention for different types of fonts, the following describes them in categories according to different font types.
[0129] According to an embodiment of the present invention, when an instruction to generate a dot-shaped auxiliary font and a corresponding surface-shaped auxiliary graphic font is received, the original font is replaced with an indicator symbol for multiple feature points according to the font writing order or strokes to obtain a dot-shaped auxiliary font. Different dot feature densities correspond to different dot-shaped auxiliary fonts. The original font in the target font library is deleted and the glyph outline of the original font is replaced with other graphics to obtain a surface-shaped auxiliary graphic font. Users can directly distinguish and identify the original information of the dot-shaped auxiliary font to assist memory and reading, that is, the font rewriting process is completed once, such as Figure 3-5 The surface auxiliary font only has font attribute information, but loses the information identification and prompting functions, and can only wait for further processing and use.
[0130] According to an embodiment of the present invention, when receiving a point-shaped auxiliary font and a plane-shaped auxiliary graphic font generation instruction, the Boolean operation result of the point-shaped auxiliary font and the plane-shaped auxiliary graphic font generated is as follows: Fig.12 As shown, the specific operation is Figure 3 The dot-shaped auxiliary font processing flow finally obtains the "source" word dot-shaped auxiliary font (i.e. Figure 4 , Figure 5 The dotted auxiliary fonts shown are based on Figure 7 The first column shows the surface auxiliary graphic font diagram generated by the surface auxiliary graphic font diagram (i.e. 8, Fig. 9 , Fig.10 , Fig.11 The Boolean operation is performed on the plane auxiliary graphic font shown in the figure. Only the plane auxiliary graphic and the font writing order or stroke indicator icon in the plane auxiliary graphic are retained in the operation result. The font writing order or stroke indicator icon outside the plane auxiliary graphic is no longer retained. As above, each character uses the same rules to form fonts, files and libraries with the same rules. For the convenience of description, a schematic diagram is used from here to the end of this paragraph to represent the collection of information such as the glyph outline or filling of each character in the font file, that is: Fig.13 equal Figure 5 and Figure 8 The intersection of; Fig.14 equal Figure 5 and Fig. 9 The intersection of; Fig.15 equal Figure 5 and Fig.10 The intersection of; Fig.16 equal Figure 5 and Fig.11 The symbolic representation is: Fig.13 = Figure 5 ∩ Figure 8 ; Fig.14 = Figure 5 ∩ Fig. 9 ; Fig.15= Figure 5 ∩ Fig.10 ; Fig.16 = Figure 5 ∩ Fig.11 .
[0131] According to an embodiment of the present invention, the Boolean operation result of the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font is as follows: Fig.17 As shown, the specific operation is Figure 3 The dot-shaped auxiliary font processing flow finally obtains the "source" word dot-shaped auxiliary font (i.e. Figure 4 , Figure 5 The dotted auxiliary fonts shown are based on Figure 7 The first column shows the surface auxiliary graphic font diagram generated by the surface auxiliary graphic font diagram (i.e. 8, Fig. 9 , Fig.10 , Fig.11 The Boolean operation is performed on the auxiliary graphic fonts shown in the planar auxiliary graphics. In the operation result, only the planar auxiliary graphics and the font writing order or stroke indicator icons in the planar auxiliary graphics are retained. The font writing order or stroke indicator icons outside the planar auxiliary graphics are no longer retained. The above processing results are compared with the auxiliary graphic fonts (i.e. 8, Fig. 9 , Fig.10 , Fig.11 As above, each character uses the same rules to form fonts, files and libraries with the same rules. For the convenience of description, from here to the end of this paragraph, a schematic diagram is used to represent the set of information such as the glyph outline or filling of each character in the font file, that is: Fig.18 equal Figure 5 and Figure 8 The result of the intersection of Figure 8 Find the union; Fig.19 equal Figure 5 and Fig. 9 The result of the intersection of Fig. 9 Find the union; Fig. 20 equal Figure 5 and Fig.10 The result of the intersection of Fig.10 Find the union; Fig.21 equal Figure 5 and Fig.11 The result of the intersection of Fig.11 Find the union. Symbolically expressed as: Fig.18 =( Figure 5 ∩ Figure 8 )∪ Figure 8 ; Fig.19 =( Figure 5 ∩ Fig. 9 )∪ Fig. 9 ; Fig. 20 =( Figure 5 ∩ Fig.10 )∪ Fig.10; Fig.21 =( Figure 5 ∩ Fig.11 )∪ Fig.11 .
[0132] The above shows the result of the secondary rewriting process.
[0133] Similarly, the Boolean operation results of other point-shaped auxiliary fonts and surface-shaped auxiliary graphic fonts are no longer described and displayed in sequence.
[0134] According to an embodiment of the present invention, when an instruction to rewrite and generate a planar auxiliary graphic font and an original font is received, all characters in the font library are rewritten, the original font library and the planar auxiliary graphic font font library are merged, and the original font of each character in the original font library is subjected to Boolean operations with the corresponding characters in the corresponding planar auxiliary graphic font font library obtained by the initial rewriting process. Based on the results of the Boolean operations, new fonts with different missing parts of the original fonts are generated, or new fonts with parts of the original fonts covered are generated, etc., to form a font library after three rewriting processes.
[0135] According to an embodiment of the present invention, the original font and the planar auxiliary graphic font are subjected to a Boolean operation, and the result is as follows: Fig.23 As shown, the specific operation is to use the "source" character in the original font (i.e. Fig.23 The "source" characters contained in the original font file shown are limited in the number of characters in the font sample content and are not shown in the picture) Graphics information such as graphic outlines and fills are based on Figure 7 The first column shows the surface auxiliary graphic font diagram generated by the surface auxiliary graphic font diagram (i.e. 8, Fig. 9 , Fig.10 , Fig.11 The Boolean operation is performed on the graphic information such as the graphic outline and fill of the "source" character in the original font, and the graphic outline and fill of the graphic information that is not covered by the surface auxiliary graphics, as well as the font graphic outline and fill of all surface auxiliary graphics, are retained in the operation result. As above, each character uses the same rules to form fonts, files and libraries with the same rules. For the convenience of description, a schematic diagram is used from here to the end of this paragraph to represent the collection of the glyph outline or fill information of each character in the font file, that is: Fig.24 equal Fig. 22 and Figure 8 The union of; Fig.25 equal Fig. 22 and Fig. 9 The union of; Fig.26 equal Fig. 22 and Fig.10 The union of; Fig. 27 equal Fig. 22 and Fig.11 The symbolic representation is: Fig.24 = Fig. 22 ∪ Figure 8 ; Fig.25 = Fig. 22 ∪ Fig. 9 ; Fig.26 = Fig. 22 ∪ Fig.10 ; Fig. 27 = Fig. 22 ∪ Fig.11 .
[0136] According to an embodiment of the present invention, the Boolean operation result of the original font and the plane auxiliary graphic font is as follows: Fig.28 As shown, the specific operation is to use the "source" character in the original font (i.e. Fig.28 The "source" characters contained in the original font file shown are limited in the number of characters in the font sample content and are not shown in the picture) Graphics information such as graphic outlines and fills are based on Figure 7 The first column shows the surface auxiliary graphic font diagram generated by the surface auxiliary graphic font diagram (i.e. 8, Fig. 9 , Fig.10 , Fig.11 Boolean operation is performed on the graphic information such as the outline and fill of the "source" character in the original font, and the result of the operation only retains the graphic information such as the outline and fill of the "source" character in the original font that is not covered by the surface auxiliary graphic. As above, each character uses the same rules to form fonts, files and libraries with the same rules. For the convenience of description, a schematic diagram is used from here to the end of this paragraph to represent the collection of information such as the glyph outline or fill of each character in the font file, that is: Fig.29 equal Fig. 22 and Figure 8 The result of the intersection of Fig. 22 The difference of Fig.30 equal Fig. 22 and Fig. 9 The result of the intersection of Fig. 22 The difference of Fig.31 equal Fig. 22 and Fig.10 The result of the intersection of Fig. 22 The difference of Fig.32 equal Fig. 22 and Fig.11 The result of the intersection of Fig. 22 The symbolic representation is: Fig.29 = Fig. 22 –( Fig. 22 ∩ Figure 8 ); Fig.30 = Fig. 22 –( Fig. 22 ∩ Fig. 9 ); Fig.31= Fig. 22 –( Fig. 22 ∩ Fig.10 ); Fig.32 = Fig. 22 –( Fig. 22 ∩ Fig.11 ).
[0137] Similarly, the Boolean operation results of other original fonts and face-shaped auxiliary graphic fonts are no longer described and displayed in sequence.
[0138] According to an embodiment of the present invention, when instructions for generating a dot-shaped auxiliary font, a surface-shaped auxiliary graphic font and an original font are received, all characters in the character library are rewritten, and the font character library, the dot-shaped auxiliary font character library and the surface-shaped auxiliary graphic font character library are merged. Each character in the character library is subjected to a Boolean operation with the corresponding character in the dot-shaped auxiliary font character library and the surface-shaped auxiliary graphic font character library of the corresponding point, and according to the result of the Boolean operation, a new font is generated by merging different font character libraries, dot-shaped auxiliary font character libraries and surface-shaped auxiliary graphic font character libraries to form a character library after four rewriting processes.
[0139] According to an embodiment of the present invention, the Boolean operation result of the original font, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font is as follows: Fig.33 As shown, the specific operation is to use the "source" character in the original font (i.e. Fig.33 The "source" font contained in the original font file shown is not shown in the picture because the font sample content has a limited number of characters. Graphic information such as graphic outlines and fills is based on Figure 7 The first column shows the surface auxiliary graphic font diagram generated by the surface auxiliary graphic font diagram (i.e. 8, Fig. 9 , Fig.10 , Fig.11 Graphic information such as the outline and fill of the surface auxiliary graphics shown Figure 3 The dot-shaped auxiliary font processing flow finally obtains the "source" word dot-shaped auxiliary font (i.e. Figure 4 , Figure 5 The graphic outline and fill information of the dot-shaped auxiliary graphic font shown in the figure are Boolean operation, and the graphic outline and fill information of the "source" character in the original font that are not covered by the graphic outline and fill information of the surface-shaped auxiliary graphic font are retained in the operation result, and then the graphic outline and fill information of the "source" character in the original font that are covered by the graphic outline and fill information of the surface-shaped auxiliary graphic font are supplemented by the graphic outline and fill information of the dot-shaped auxiliary font. The final effect Fig.33As shown above, each character uses the same rules to form fonts, files and libraries with the same rules. For the convenience of description, from here to the end of this paragraph, a schematic diagram is used to represent the collection of information such as the glyph outline or filling of each character in the font file, that is: Fig.34 equal Fig. 22 and Figure 8 The union of Figure 5 and Figure 8 The intersection of; Fig.35 equal Fig. 22 and Fig. 9 The union of Figure 5 and Fig. 9 The intersection of; Fig.36 equal Fig. 22 and Fig.10 The union of Figure 5 and Fig.10 The intersection of; Fig.37 equal Fig. 22 and Fig.11 The union of Figure 5 and Fig.11 The symbolic representation is: Fig.34 =( Fig. 22 ∪ Figure 8 )∪( Figure 5 ∩ Figure 8 ); Fig.35 =( Fig. 22 ∪ Fig. 9 )∪( Figure 5 ∩ Fig. 9 ); Fig.36 =( Fig. 22 ∪ Fig.10 )∪( Figure 5 ∩ Fig.10 ); Fig.37 =( Fig. 22 ∪ Fig.11 )∪( Figure 5 ∩ Fig.11 ).
[0140] According to an embodiment of the present invention, the Boolean operation result of the original font, the dot-shaped auxiliary font, and the surface-shaped auxiliary graphic font is as follows: Fig.38 As shown, the specific operation is to use the "source" character in the original font (i.e. Fig.38 The "source" font contained in the original font file shown is not shown in the picture because the font sample content has a limited number of characters. Graphic information such as graphic outlines and fills is based on Figure 7 The first column shows the surface auxiliary graphic font diagram generated by the surface auxiliary graphic font diagram (i.e. 8, Fig. 9 , Fig.10 , Fig.11 Graphic information such as the outline and fill of the surface auxiliary graphics shown Figure 3The dot-shaped auxiliary font processing flow finally obtains the "source" word dot-shaped auxiliary font (i.e. Figure 4 , Figure 5 The graphic outline and fill information of the dot-shaped auxiliary font shown in the figure are Boolean operation. The graphic outline and fill information of the word "source" in the original font that are not covered by the graphic outline and fill information of the surface-shaped auxiliary graphic font are retained in the operation result. The graphic outline and fill information of the word "source" in the original font that are covered by the graphic outline and fill information of the surface-shaped auxiliary graphic font are supplemented by the graphic outline and fill information of the dot-shaped auxiliary font. The final effect Fig.38 As shown above, each character uses the same rules to form fonts, files and libraries with the same rules. For the convenience of description, from here to the end of this paragraph, a schematic diagram is used to represent the collection of information such as the glyph outline or filling of each character in the font file, that is: Fig.39 equal Fig. 22 and Figure 8 The result of the intersection of the complement of Figure 5 and Figure 8 The intersection of; Fig.40 equal Fig. 22 and Fig. 9 The result of the intersection of the complement of Figure 5 and Fig. 9 The intersection of; Fig.41 equal Fig. 22 and Fig.10 The result of the intersection of the complement of Figure 5 and Fig.10 The intersection of; Fig.42 equal Fig.23 and Fig.11 The result of the intersection of the complement of Figure 5 and Fig.11 The symbolic representation is: Fig.39 =( Fig. 22 ∩( Figure 8 '))∪( Figure 5 ∩ Figure 8 ); Fig.40 =( Fig. 22 ∩( Fig. 9 '))∪( Figure 5 ∩ Fig. 9 ); Fig.41 =( Fig. 22 ∩( Fig.10 '))∪( Figure 5 ∩ Fig.10 ); Fig.42 =( Fig. 22 ∩( Fig.11 '))∪( Figure 5 ∩ Fig.11 );
[0141] Similarly, the Boolean operation results of other original fonts, point-shaped auxiliary fonts, and surface-shaped auxiliary graphic fonts are no longer described and displayed in sequence.
[0142] According to logical deductions such as De Morgan's laws and the distribution relationship between the intersection and union of sets, the result of the fourth font rewriting can also be logically deduced from the result of the second font rewriting and the result of the third font rewriting, such as: A∩(B∪C)=(A∩B)∪(A∩C), which will not be described and displayed in sequence in the embodiments.
[0143] According to the above methods and steps, the secondary, tertiary and quadruple rewriting processing of non-commercial fonts, self-designed fonts and other fonts with source code or filling information are completed. The glyph outlines and filling information in the original fonts, point-shaped auxiliary fonts and surface-shaped auxiliary graphic fonts are cut, merged and fused with new glyph outlines and filling information based on the results of Boolean operations, and different fonts and character libraries are generated according to user needs.
[0144] However, since non-open source fonts (or commercial fonts) are protected by copyright, users are usually unable to directly modify their source code or design elements. Since the dot-shaped auxiliary fonts and surface-shaped auxiliary graphic fonts, secondary rewriting processing, and tertiary rewriting processing result fonts and character libraries of non-open source fonts do not fall within the scope of copyright protection of non-open source fonts, you can directly refer to the processing and rewriting process of related fonts of open source fonts to generate dot-shaped auxiliary font character libraries and surface-shaped auxiliary graphic font character libraries, secondary rewriting processing result character libraries, and tertiary rewriting processing result character libraries. However, we cannot directly manipulate the outline and filling information of non-open source fonts to achieve Figure 23 to Figure 42 font effect.
[0145] According to an embodiment of the present invention, the font typesetting order corresponding to the rewriting process of the dot-shaped auxiliary fonts and the surface-shaped auxiliary graphic fonts is: the first layer is the background layer, the second layer is the original font layer, the third layer is the surface-shaped auxiliary graphic font layer, and the last layer is the dot-shaped auxiliary font layer.
[0146] According to an embodiment of the present invention, the planar auxiliary graphic font layer can also be used as a mask layer as the top layer of font typesetting. The mask layer can be used for each character individually or for the entire line or paragraph in the typesetting result, so as to achieve the following: Fig.45 The missing information layout results shown assist users in achieving memory prompts.
[0147] For commercial fonts Figure 23 to Figure 42 Font effects such as Fig.43 As shown, commercial fonts, dot-shaped auxiliary fonts, surface-shaped auxiliary graphic fonts, secondary rewriting processing, and tertiary rewriting processing result fonts can be presented on different layers. Fig.43From top to bottom, they are the background layer; commercial font text or image layer; dot-shaped auxiliary font, surface-shaped auxiliary graphic font, secondary rewriting processing, and tertiary rewriting processing result font layer. The background layer can be of various colors or transparent, usually white. The commercial font text or image layer is mainly the layer for non-open source font text or image typesetting output. The original text or image is presented on this layer. The next layer is mainly for placing the surface-shaped auxiliary graphics in the surface-shaped auxiliary graphic font. The color of the surface-shaped auxiliary graphic font can be changed according to the background color or the color of the original text or image in the previous layer, such as Fig.43 The third layer from top to bottom is shown on the left. This layer can also be used to directly place the fonts of the secondary rewriting process and the tertiary rewriting process. The color of the font can also be changed according to the background color or the color of the original text or image on the previous layer, such as Fig.43 The third layer from top to bottom is shown on the right. The last layer is placed with dotted auxiliary fonts, such as Fig.43 The fourth layer from top to bottom is shown on the left. All layer sizes, preset coordinate system directions, unit lengths and origins are the same. Each character in each layer determines its position according to the preset coordinate system directions, unit lengths and origins, so that the font shapes of dot-shaped auxiliary fonts, surface-shaped auxiliary graphic fonts, secondary rewriting processing and tertiary rewriting processing results overlap with the corresponding character positions in the non-open source font files. Fig.43 The origin of all layers in the image is located at the upper left corner of the layer; the horizontal direction is the x-axis, and the right direction is positive; the vertical direction is the y-axis, and the downward direction is positive. Different layers overlap each other, and the final display effect is achieved as follows Figure 23 to Figure 42 Any effect of the font.
[0148] If the user is satisfied with the fonts generated by various processing methods, the user can operate the font generation instruction to migrate the processing results of each character in the point-shaped auxiliary font, surface-shaped auxiliary graphic font, secondary, triple, and quadruple rewriting processing results of the original font after processing to the font library to obtain a new font library. After the font library is generated, the user will be notified that various fonts have been generated and prompted to use them. The format of the font library can be the OTF (OpenTypeFont) or TTF (TrueTypeFont) font library commonly used in the field. Based on existing technologies, such as Figures 4 to 5 , Figures 8 to 11 , Figures 13 to 16As shown in the above, each processing result can be stored separately in a font or character library file, and the user can directly use each separate font or character library file, which is easy to operate. All new character graphic information can also be stored inside each character, that is, inside the glyf table (GlyphDataTable, i.e., the font data table). The glyf table is composed of a series of font data blocks, and each data block describes a separate font (font information such as point-shaped auxiliary fonts, surface-shaped auxiliary graphic fonts, secondary, triple, and quadruple rewriting processing results in the present invention). These font data blocks are accessed through the index in the loca (Location) table. When using, the user calls a series of rules in the GSUB table (GlyphSubstitutionTable) in the font or character library file, which define how to replace one or more fonts under specific conditions, thereby realizing the display of different fonts.
[0149] According to an embodiment of the present invention, each TTF font library based on the dot-shaped auxiliary font, surface-shaped auxiliary graphic font, secondary, triple, and quadruple rewriting processing results of non-commercial fonts includes 31,036 characters. The generated font can be directly enabled on the input method keyboard, and you can also choose to convert the relevant character information into pictures or image information for the rewriting process of non-open source fonts. If the user wants to apply it on other terminals, such as computer Word, you can export TTF or OTF font files. The number of files depends on the storage method selected by the user. It can be exported as multiple files or as one file.
[0150] According to an embodiment of the present invention, after the original font is processed to form a dot-shaped auxiliary font, a surface-shaped auxiliary graphic font, a secondary, a tertiary, or a quaternary rewriting processing result, the outline information of many characters is rewritten, replaced, or missing, and the user cannot identify the character information according to the traditional character blank spacing. To overcome this problem, the present invention provides a solution, that is, to provide an information prompt mark according to the processing method of each character information. Fig.44 As shown, in the embodiment, the information prompt mark is a triangular arrow, and the direction of the arrow points to the positions of various connection lines connecting the feature points. Fig.44 The first column indicates the location of the horizontal connection, the second column indicates the location of the vertical connection, and so on. The shape and location of the information prompt mark vary depending on the graphic position in the planar auxiliary graphic font. The information prompt mark can be saved in the planar auxiliary graphic font information as part of the glyph outline of the planar auxiliary graphic font, or it can be saved as a separate font file. When saved as a separate font file, the attribute information of each character is consistent with the character information of the original font, except that the original graphic outline and filling are deleted, and the information mark outline is used to replace the deleted outline information at appropriate locations such as the character feature point connection line.
[0151] The following uses the well-known "Quiet Night Thoughts" and "Spring Dawn" as examples to fully demonstrate the application effect of the present invention through computer terminal display or print output. Fig.45 As shown, Fig.45 a is based on the Tang Dynasty poem Chunxiao Fig.28 The schematic diagram B of the Boolean operation result of the original font and the surface auxiliary graphic font shown is the font file typesetting result generated by the rules in the first row of the third column, wherein the information prompt mark is directly used as a part of the font information of the Boolean operation result font of the original font and the surface auxiliary graphic font. Fig.45 b is based on the Tang Dynasty poem Quiet Night Thoughts Fig.28 The Boolean operation result diagram B of the original font and the surface auxiliary graphic font shown is the font file typesetting result generated by the rules in the third column and second row, wherein the font information itself does not carry an information prompt mark. If the font change position needs to be marked, a separate information prompt mark font is required. Fig.45 c is the above two variant fonts, such as Fig.43 The result of the cascading layout is shown below. Fig.45 a and Fig.45 When reading or memorizing the typesetting results of b, due to the lack of font outline information, the user is forced to call upon the stored information in the brain for secondary processing to complete the font outline, which reduces the browsing speed of reading or memorizing and ensures the effectiveness of reading or memorizing. Fig.45 c Comprehensive Fig.45 a and Fig.45 b information, the typesetting result is maintained Fig.45 a and Fig.45 bInformation identifiability Fig.45 a and Fig.45 b are interference factors, forcing users to fill in missing information while eliminating interference factors during reading, avoiding the inertial thinking of traditional reading or memorizing. Fig.45 a and Fig.45 b. Fig.45 c, etc., and different typeset results are selected for reading or memorization at different proficiency levels, so that the brain can maintain a high level of vigilance for the same character due to different missing or prompt information, ensuring the effectiveness of reading or memorization. At the same time, users can also choose according to their preferences, such as Figures 4 to 5 , Figures 8 to 11 , Figures 13 to 16 , Figures 18 to 21 , Figure 24 to Figure 27 , Figure 29 to Figure 32 , Figure 34 to Figure 37 , Figure 39 to Figure 42The fonts shown are used for reading and memory. Different display effects are achieved each time the text selected by the user is different. Missing or replaced information requires the brain to supplement and improve it again to ensure concentration, thereby improving the memory effect.
[0152] The basic form and structure of the font can be derived from a traditional font or the missing font of the present invention. That is, the user can refer to the final text effect of the present invention, use various drawing tools or software to outline the missing font form structure of the present invention, and then digitize it by scanning or photographing to generate font data or library.
[0153] It should be noted that the font in the present invention refers to the font effect displayed by the characters in the character library according to the font. The font can be a certain font specified by the user, such as the common Songti, Kaiti and other fonts. The character library can be a universal font library, such as Songti or Kaiti. The preview characters are some characters in the character library, and which characters the preview characters specifically include can be customized by the user.
[0154] According to an embodiment of the present invention, the present invention further provides a font generation device, comprising:
[0155] Original font module: used to obtain original font data.
[0156] Get the original font data, including: use pen, pencil, paper or other drawing tools to outline the basic form and structure of the font, digitize it through scanners, cameras and other devices, and convert the sketch into vector graphics. You can also use professional font design software (such as FontCreator, Fontographer, Glyphs, etc.) to convert the sketch into vector graphics. And adjust the font's stroke thickness, curvature, angle and other details, and then generate a traditional font or font library for further processing. You can also directly import finished commercial fonts or non-commercial fonts for further processing.
[0157] Feature extraction module: Use the font extraction feature model to extract features from the original font to obtain point features and line features corresponding to the font graphic. Including: fitting the font graphic with horizontal or vertical lines up, down, left, and right to determine the font feature value of the original font. Obtain the horizontal tangent of the highest contour point of the font graphic contour, the horizontal tangent of the lowest contour point of the font graphic contour, the vertical tangent of the leftmost contour point of the font graphic contour, and the vertical tangent of the rightmost contour point of the font graphic contour. The two horizontal tangents and the two vertical tangents intersect to obtain the minimum rectangular area that can completely envelop (i.e., contain and fit closely) a glyph (usually refers to the image representation of a single character or symbol). Optionally, feature extraction is performed on the font graphic to obtain the features of the original font, including: comparing the font graphic with the preset reference font glyph writing order or stroke data to determine the font feature value of the original font. That is: the font graphic is input into the font glyph writing order or stroke feature extraction model to generate the font glyph writing order or stroke feature value, and the font feature extraction model determines the font glyph writing order or stroke font feature value by comparing and position-correcting the font graphic with the preset reference font glyph writing order or stroke data. The starting point of the glyph writing order or stroke of each character, the end point of the glyph writing order or stroke, the inflection point of the glyph writing order or stroke, the arc point of the glyph writing order or stroke, the intersection point of two or more glyph writing orders or strokes and other feature point positions are obtained.
[0158] Rewriting generation module: rewrites the original font based on font features to generate a new auxiliary font or text font. It includes: when receiving a (point-shaped auxiliary) font generation instruction, based on the font glyph writing order or stroke feature value, determining the glyph writing order or stroke starting point, glyph writing order or stroke end point, glyph writing order or stroke inflection point, glyph writing order or stroke arc point, intersection point of two or more glyph writing orders or strokes and other feature point positions of each original font. All characters in the character library are subjected to an initial rewriting process, and each character in the character library is compared with the corresponding preset font writing order or stroke feature point, and the positions of all feature points on the original font glyph are marked. In addition, the font writing order or stroke indicator icon is used to replace the original font glyph outline and filling information at the position of each character font writing order or stroke feature point, that is, the original font glyph outline and filling information is deleted, and other font attribute information is retained. The font writing order or stroke indicator icon graphic information mark is placed at the position of the original font writing order or stroke feature point, so as to obtain a dot-shaped auxiliary font that only retains the font writing stroke order feature point, referred to as dot-shaped auxiliary font. After all characters are processed according to the same rules, a dot-shaped auxiliary font character library after the initial rewriting process is formed. The dot-shaped auxiliary font generation instruction is used to instruct the generation of a dot-shaped auxiliary font with the same characteristics as the preset font writing order or stroke, and form a character library.
[0159] In the case of receiving a planar auxiliary graphic font generation instruction, a horizontal and vertical line fitting operation is performed based on the font glyph contour line to obtain the horizontal and vertical feature lines of the minimum rectangular area boundary that completely envelops (i.e., contains and fits closely) a glyph (usually refers to the image representation of a single character or symbol). According to the preset rules, the horizontal and vertical feature lines are divided into multiple points, and the segmentation points are the segmentation feature points of the feature lines. Different segmentation feature points are connected by straight lines or curves, and the intersection of the lines connecting these segmentation feature points is called the segmentation intersection feature point. Different polygons, circles and other types of graphics are formed by connecting different segmentation feature points and segmentation intersection feature points by straight lines or curves, and the internal area of the graphics is filled to form a planar graphic. At the same time, the glyph contour and filling information of the original font are deleted, other font attribute information is retained, and the newly generated planar graphic is imported to replace the glyph contour and filling information of the original font, thereby obtaining a planar auxiliary graphic font. After all characters are processed according to the same rules, a planar auxiliary graphic font font library after the initial rewriting process is formed. The planar auxiliary graphic font generation instruction is used to instruct the generation of a planar auxiliary graphic font that connects any number of points such as horizontal and vertical feature lines, feature points, and intersection feature points of the font graphic outline, and forms a font library.
[0160] In the case of receiving a dot-shaped auxiliary font and a surface-shaped auxiliary graphic font for rewriting, the characters in the dot-shaped auxiliary font are rewritten for a second time, the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font are merged, and the dot-shaped auxiliary font of each character in the dot-shaped auxiliary font library is respectively Boolean-operated with the corresponding character in the corresponding surface-shaped auxiliary graphic font library obtained by the initial rewriting process, and according to the result of the Boolean operation, a new font with different dot-shaped auxiliary font parts missing or a new font with dot-shaped auxiliary font parts covered is generated, and all characters are processed according to the same rules to form a font library after the second rewriting process. The font (secondary rewriting) generation instruction is used to instruct the fusion of the dot-shaped auxiliary font and the surface-shaped auxiliary graphic font to generate a new font and form a font library.
[0161] In the case of receiving a planar auxiliary graphic font and an original font for rewriting, three rewriting processes are performed on all characters in the original font, the original font and the planar auxiliary graphic font are merged, and the original font of each character in the original font library is respectively subjected to Boolean operation with the corresponding character in the corresponding planar auxiliary graphic font obtained by the initial rewriting process, and according to the result of the Boolean operation, a new font with different missing parts of the original font is generated, or a new font with part of the original font covered is generated, etc. After all characters are processed according to the same rules, a font library after three rewriting processes is formed. The font (three rewriting) generation instruction is used to instruct the original font and the planar auxiliary graphic font to be merged to generate a new font and form a font library.
[0162] When receiving instructions for rewriting the original font, dot-shaped auxiliary font, and plane-shaped auxiliary graphic font, all characters in the original font library are rewritten four times, the original font, dot-shaped auxiliary font, and plane-shaped auxiliary graphic font are merged, and each character in the font library is Boolean-operated with the corresponding character in the dot-shaped auxiliary font and plane-shaped auxiliary graphic font of the corresponding point, and a new font is generated by merging different original fonts, dot-shaped auxiliary fonts, and plane-shaped auxiliary graphic fonts according to the result of the Boolean operation. After all characters are processed according to the same rules, a font library after four rewriting is formed. The font (four rewriting) generation instruction is used to instruct the original font, dot-shaped auxiliary font, and plane-shaped auxiliary graphic font to merge to generate a new font and form a font library.
[0163] The functions implemented by the above original font module, feature extraction module and rewriting generation module can be implemented by the same or different processors respectively, and the embodiments of the present application are not limited thereto.
[0164] According to an embodiment of the present invention, the modules in the above device can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the unit in the device can be implemented in the form of a hardware circuit, and the functions of some or all units can be realized by designing the hardware circuit. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all units above are realized by designing the logical relationship of components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by a configuration file, so as to realize the functions of some or all units above. All units of the above device can be implemented in the form of a processor calling software, or in the form of a hardware circuit, or in part by a processor calling software, and the remaining part is implemented in the form of a hardware circuit.
[0165] A processor is a circuit with the ability to process signals. In one implementation, the processor can be a circuit with the ability to read and run instructions, such as a CPU, microprocessor, GPU, or DSP. In another implementation, the processor can implement certain functions through the logical relationship of the hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0166] It can be seen that each module unit in the above device can be configured to implement one or more processors (or processing circuits) of the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0167] In addition, the various module units in the above device can be fully or partially integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0168] According to an embodiment of the present invention, the present invention further provides an electronic device, which includes: a memory and a processor, wherein the memory is connected to the processor and is used to store a program; the processor is used to implement the font generation method disclosed in any of the above embodiments by running the program stored in the memory. The electronic device may also include: a bus, a communication interface, an input device, and an output device. The processor, the memory, the communication interface, the input device, and the output device are interconnected through a bus. Among them: the bus may include a path to transmit information between various components of the computer system. The processor may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present application. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The processor may include a main processor, and may also include a baseband chip, a modem, etc. The memory stores a program for executing the technical solution of the present application, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes computer operation instructions. More specifically, the memory 4700 may include a read-only memory (ROM), a static storage device that can store static information and instructions and other types, a random access memory (RAM), a dynamic storage device that can store information and instructions and other types, a disk storage, a flash, and the like. The input device may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor, and the like. The output device may include a device that allows information to be output to the user, such as a display screen, a printer, a speaker, and the like. The communication interface may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN), and the like. The processor executes the program stored in the memory and calls other devices, which can be used to implement the various steps of any font generation method provided in the above embodiments of the present application.
[0169] According to an embodiment of the present invention, the present invention provides a storage medium, comprising: a computer program, when the storage medium is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the font generation method proposed in the first aspect.
[0170] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention.
[0171] It should be understood that the present invention is not limited to what has been described above and that various modifications and changes may be made without departing from its scope. The scope of the present invention is limited only by the appended claims.
Claims
1. A font generation method, characterized in that: include: S1, obtaining original font data to form a target font library; S2. Extract features from the original fonts in the target font library: obtain boundary feature lines corresponding to the fully enveloping rectangular area along the font outline, and obtain feature points corresponding to the writing order and strokes of each font through the font extraction feature model; S3. Based on the feature extraction of the original font, the fonts in the target font library are rewritten.
2. The font generation method according to claim 1, characterized in that: The original font data in step S1 includes commercial font data or non-commercial font data composed of vector graphics converted from basic font forms outlined by a drawing tool.
3. The font generation method according to claim 1, characterized in that: In step S2, the boundary feature line corresponding to the completely enveloping rectangular area is obtained along the font contour line, specifically comprising: taking each font as a font graphic, performing a fitting operation on the font graphic contour line in a two-dimensional plane corresponding to the horizontal and vertical lines, and obtaining the horizontal tangent line corresponding to the highest or lowest contour point of the font graphic contour line and the vertical tangent line corresponding to the leftmost or rightmost contour point of the font graphic contour line, respectively; The two horizontal tangent lines and the two vertical tangent lines are intersected to obtain the minimum rectangular area that can completely enclose a font graphic.
4. The font generation method according to claim 1, characterized in that: In step S2, the feature points corresponding to the writing order and strokes of each font are obtained by using the font extraction feature model, which specifically includes: inputting the font in the target font library into the font extraction feature model, comparing and correcting the position of the font writing order and stroke data of the reference font preset in the font extraction feature model, and determining the font writing order or stroke font feature points of the original font. The font feature points of the font writing sequence or the strokes include: the starting point, the end point, the inflection point, the arc point and the intersection point of the font writing sequence or the strokes.
5. The font generation method according to claim 1, characterized in that: In step S3, rewriting the fonts in the target font library includes: rewriting using point-shaped auxiliary fonts, rewriting using surface-shaped auxiliary graphic fonts, and rewriting using point-shaped and surface-shaped auxiliary fonts. Each stroke of the original font corresponds to a plurality of characteristic points. The corresponding plurality of characteristic points are replaced by indicator symbols and then the outline of the original font is deleted, thus obtaining a dot-shaped auxiliary font. Different dot feature densities correspond to different dot auxiliary fonts, which are replaced according to the writing order of the fonts or the starting point, end point, inflection point, arc point and intersection point of the strokes, and then the outline of the original font is deleted to obtain the basic dot font, which is saved for later use; The surface auxiliary graphic font is obtained by taking the original font in the target font library as a font graphic, obtaining four characteristic lines that completely envelop a rectangular area corresponding to a font graphic, dividing the four characteristic lines into equal points, connecting all the equally divided points to form a grid-like graphic, arbitrarily filling any one or more grid blocks in the grid, and then deleting the glyph outline of the original font to obtain the surface auxiliary graphic font, and saving it for later use.
6. The font generation method according to claim 5, characterized in that: The specific steps of the dot-shaped auxiliary font rewriting process are as follows: when the system receives an instruction to generate a dot-shaped auxiliary font, a Boolean operation is performed on the original font and the corresponding dot-shaped auxiliary font, and different dot-shaped auxiliary font processing results are obtained by changing the dot feature density corresponding to the font; The specific steps of the planar auxiliary graphic font rewriting process are as follows: when the system receives the planar auxiliary graphic font generation instruction, Boolean operations are performed on the original font and the corresponding planar auxiliary graphic font, and different planar auxiliary graphic font processing results are obtained by changing the size of the filling area in each font graphic; The specific steps of the point-shaped and surface-shaped auxiliary graphic font rewriting process are as follows: when the system receives the instruction to generate the point-shaped and surface-shaped auxiliary graphic font, Boolean operations are performed on the original font, the point-shaped auxiliary font and the corresponding surface-shaped auxiliary graphic font, and different point-shaped and surface-shaped auxiliary graphic font processing results are obtained by changing the size of the filling area in each font graphic and the point feature density corresponding to the font.
7. The font generation method according to claim 5, characterized in that: The font typesetting order corresponding to the dot-shaped and surface-shaped auxiliary graphic font rewriting process is: the first layer is the background layer, the second layer is the original font layer, the third layer is the surface-shaped auxiliary font layer, and the last layer is the dot-shaped auxiliary font layer. The surface auxiliary graphic font layer can also be used as a mask layer as the top layer of font typesetting.
8. A font generation device, characterized in that: include: Original font module: used to obtain original font data; Feature extraction module: Use the font extraction feature model to extract features from the original font to obtain point features and line features corresponding to the font graphics; Rewriting generation module: rewrites the original font based on font features to generate a new auxiliary font or text font.
9. An electronic device, characterized in that: include: Memory and processor, The memory is connected to the processor and is used to store programs. The processor is used to implement the steps of the font generation method according to any one of claims 1 to 7 by running the program in the memory.
10. A storage medium, characterized in that: include: A computer program, when the storage medium is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the font generation method according to any one of claims 1 to 7.
Citation Information
Cited By
Self-adaptive text display method and system for assisting memory
CN122133610A