CN106897253A - A kind of font composition method based on improvement expansion algorithm - Google Patents
A kind of font composition method based on improvement expansion algorithm Download PDFInfo
- Publication number
- CN106897253A CN106897253A CN201710010833.XA CN201710010833A CN106897253A CN 106897253 A CN106897253 A CN 106897253A CN 201710010833 A CN201710010833 A CN 201710010833A CN 106897253 A CN106897253 A CN 106897253A
- Authority
- CN
- China
- Prior art keywords
- polygon
- expansion
- font
- convex
- mapping relations
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/103—Formatting, i.e. changing of presentation of documents
- G06F40/109—Font handling; Temporal or kinetic typography
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Health & Medical Sciences (AREA)
- Artificial Intelligence (AREA)
- Audiology, Speech & Language Pathology (AREA)
- Computational Linguistics (AREA)
- General Health & Medical Sciences (AREA)
- General Engineering & Computer Science (AREA)
- Controls And Circuits For Display Device (AREA)
- Image Generation (AREA)
Abstract
The invention discloses a kind of based on the font composition method for improving expansion algorithm, convex subdivision is carried out respectively by each part of two fonts first, set up the mapping relations between part, and the mapping relations of convex polygon are set up in corresponding part, then to the convex polygon that there are mapping relations using coincide side the characteristics of expand, and using coincide side the characteristics of expansion results are processed, finally expansion results are carried out curve fitting, realize the synthesis of Chinese character pattern.The inventive method has the advantages that font composition effect is good, it is high to synthesize quality.
Description
Technical field
The present invention relates to character and graphic process field, especially a kind of font composition method for improving expansion algorithm.
Background technology
Font composition is one kind of figure deformation technology, belongs to a new branch in graphics process field.To figure
For, it can realize generating new font by existing font, be an important research topic.Font composition is referred to
Based on existing two fonts, by certain algorithm, a series of middle font is produced, it is smooth between two fonts so as to realize
Transition.Existing font synthetic method is based on glyph image, i.e., font synthesis to be carried out based on image mostly.And it is based on figure
Font synthetic method process object it is mostly be identical topological structure font.
Prior art discloses various font composition methods, process object is the font of identical topological structure mostly.But it is right
When the font of tripe systems is synthesized, synthetic effect is not good, lesion result easily occurs, it is impossible to preferably solve font different
The problem of structure.And nearly all Chinese character pattern is all complicated concave polygon, font is ever-changing, and font knot between different fonts
Structure is different.
The content of the invention
Present invention aim at providing, a kind of synthetic effect is good, synthesis quality is high is closed based on the font for improving expansion algorithm
Into method, it is used to solve the problems, such as tripe systems between two-dimentional font, is that the font synthesis in later stage, graphic animations, area of computer aided set
Meter etc. does basis.
To achieve the above object, following technical scheme is employed:The method of the invention is comprised the following steps that:
Step 1, obtains font file, sets up the mapping relations between font part;
Step 2, convex subdivision is carried out in each font part respectively;
Step 3, mapping relations are set up to the convex polygon after subdivision;
Two polygons the characteristics of using identical side, are reduced certain proportion, to ensure expansion results font by step 4 respectively
In the same size with former font, the convex polygon to there are mapping relations expands;Mapping based on convex polygon between two fonts
Relation, selects the starting point on convex polygon certain side therein as the reference point in expansion process, and based on the reference
Point is translated the convex polygon along another polygonal each edge, then must according to the polygonal side of each edge end points two
So identical characteristic, calculates translation track, to obtain polygon expansion track, so as to realize expanding convex polygon, obtains
To continuous expansion results profile;
Expansion results are carried out curve fitting by step 5, make result profile smoother.
Further, in step 1, the connected region divided parts according to font, and using the similitude meter of font part
Matching degree is calculated, the mapping relations between font part are determined.
Further, in step 2, maximum convex subdivision is carried out to each part, i.e., is split into maximum convex polygon as far as possible, profit
Synthesize in the expansion in later stage;The convex polygon is vector polygon.
Further, in step 3, calculate the center of gravity of each convex polygon, and using the barycentric coodinates vector after normalization away from
From similarity is calculated, so that it is determined that the mapping relations between convex polygon.
Further, in step 4, the expansion process based on identical side is as follows, two convex polygons of correspondence is referred to as many
Side shape PA and PB, wherein PA is figure to be expanded, and PB is structural element;
Step 4.1, selects a summit of polygon PB as the reference point in expansion process, wherein selecting each convex polygon
Its consistency is kept during the reference point of shape, it is consistent with the direction for ensureing expansion, effectively improve expansion effect;
Step 4.2, keeps reference point to be overlapped with the two-end-point of polygon PA a lines, with a line of polygon PA
Left end point be motion starting point, translate polygon PB along a line of polygon PA, and coincide feature according to side, calculate current
Each quadrangle formed to the side that coincide, that is, obtain PB in the expansion track of PA a lines in translation.
Step 4.3, repeat step 4.2 obtains PB to PA's untill each edge to polygon PA expands
Expansion track;
Step 4.4, takes expansion track with the union of polygon PA as expansion results.
Further, it is the adjacent edge of profile to the main target that expansion results carry out curve fitting in step 5, first tastes
Examination fitting be in line, if cannot if attempt being fitted to curve, to generate new profile side, after fitting gained figure be font
Composite result.
The course of work approximately as:
Convex subdivision is carried out respectively by each part of two fonts first, sets up the mapping relations between part, and corresponding
The mapping relations of convex polygon are set up in part, then to the convex polygon that there are mapping relations using coincide side the characteristics of carry out
Expansion, finally expansion results are carried out curve fitting, realize the synthesis of Chinese character pattern.
Compared with prior art, the inventive method has the following advantages that:Preferable font composition effect can be obtained, it is ensured that
Font composition quality;And can be used to solve the problems, such as tripe systems between two-dimentional font, be the font synthesis in later stage, graphic animations,
Basis is done in CAD etc., with good adaptability.
Brief description of the drawings
Fig. 1 is program flow diagram of the invention.
Fig. 2 is that polygon of the invention expands flow chart.
Specific embodiment
The present invention will be further described below in conjunction with the accompanying drawings:
As shown in figure 1, the method for the invention is comprised the following steps that:
Step 1, the mapping relations setting up part to two fonts.
Font connected region is part, and the part of font, and center of gravity, area, space bit according to each part are divided with this
The matching degree of each part between the features such as putting, two fonts of calculating, a pair of parts of matching degree highest are the presence of mapping relations.
Step 2, maximum convex subdivision is carried out to each part.
Subdivision is carried out based on Delaunay Triangulation method in each part of font, and triangulation result is closed
And, to cause that each polygon after part subdivision reaches maximum subdivision.
Step 3, sets up convex polygon mapping relations.
Based on the centre coordinate of the convex polygon after normalization, Euclidean distance is calculated, wherein closest convex polygon
That is mapping relations each other.
Step 4, expands to convex polygon.Two polygons are reduced into certain proportion respectively first, to ensure expansion knot
Fruit font is in the same size with former font.Then according to polygonal mapping relations between two fonts, based on a polygonal summit,
The polygon is translated along another polygonal each edge, and is expanded using the identical side produced in translation motion
Track, so as to realize expanding convex polygon.
Expansion process based on identical side is as follows,
Assuming that the convex polygon that there are mapping relations between two fonts is PA and PB, the side of polygon PA is expressed as EAi(i=
0,1,2 ..., M), vertex representation is VAi(i=0,1,2 ..., M), wherein EAM+1And VAM+1EA is represented respectively0And VA0.Polygon
The side of PB is expressed as EBj(j=0,1,2 ..., N), vertex representation is VBj(j=0,1,2 ..., N), wherein EBN+1And VBN+1Respectively
Represent EB0And VB0.Expansion flow based on identical side as shown in Figure 2, is comprised the following steps that:
(1) each summit VB of polygon PB is judgedjThe abscissa and ordinate of (j=0,1,2 ..., N), selection are most gone up
(or most under, most left, most right, be consistent) summit VBkIt is as a reference point.M=0 is made, is transferred to (2).
(2) if m=M+1, the expansion of two polygons terminates, and takes TmThe union of (m=0,1,2 ..., M) is with polygon PA's
Union is two polygon expansion results.Otherwise it is transferred to (3).
(3) with the side EA of polygon PAmLeft end point VAmIt is motion starting point, right endpoint VAm+1It is exercise end, along side EAm
Translation polygon PB, wherein at beginning and end, reference point VB is kept respectivelykWith the side EA of polygon PAmTwo-end-point VAm
And VAm+1Overlap, so as in VAmAnd VAm+1Place forms new polygon PB_VA respectivelymAnd PB_VAm+1, n=0 is made, it is transferred to (4).
(4) if n=N+1, polygon PB is in side EAmOn expansion terminate, form the union T of parallelogrammAs
Its expansion results, is transferred to (7), is otherwise transferred to (5).
(5) if the side EA of polygon PAmWith the side EB of polygon PBnThere is parallel relation, then make n=n+1, return (4),
Otherwise it is transferred to (6).
(6) according to polygon PB_VAmAnd PB_VAm+1Middle correspondence EBnTwo side matches mutuallies, i.e. direction and length be complete
Identical the characteristics of, the starting point and ending point of the opposite side in two polygons is connected respectively, form a parallelogram and preserve.
N=n+1 is made, is returned (4).
(7) m=m+1 is made, is returned (2).
Step 5 carries out curve fitting to expansion results, makes result profile smoother.Curve matching is mainly adjacent to profile
While being processed, first determine whether whether adjacent edge can be fitted and be in line, if then directly preserving, point keeps not from beginning to end after fitting
Become.Otherwise carried out curve fitting using least square method, generate new profile side, gained figure is font composition knot after treatment
Really.
Embodiment described above is only that the preferred embodiment of the present invention is described, not to model of the invention
Enclose and be defined, on the premise of design spirit of the present invention is not departed from, those of ordinary skill in the art are to technical side of the invention
Various modifications and improvement that case is made, all should fall into the protection domain of claims of the present invention determination.
Claims (7)
1. it is a kind of based on the font composition method for improving expansion algorithm, it is characterised in that methods described is comprised the following steps that:
Step 1, obtains font file, sets up the mapping relations between font part;
Step 2, convex subdivision is carried out in each font part respectively;
Step 3, mapping relations are set up to the convex polygon after subdivision;
Two polygons the characteristics of using identical side, are reduced certain proportion by step 4 respectively, with ensure expansion results font with it is former
Font is in the same size, and the convex polygon to there are mapping relations expands;Based on the mapping relations of convex polygon between two fonts,
The starting point on convex polygon certain side therein is selected as the reference point in expansion process, and should based on the reference point
Convex polygon is translated along another polygonal each edge, is then necessarily coincide according to the polygonal side of each edge end points two
Characteristic, calculate translation track, to obtain polygon expansion track, so as to realize expanding convex polygon, obtain continuous
Expansion results profile;
Expansion results are carried out curve fitting by step 5, make result profile smoother.
2. according to claim 1 a kind of based on the font composition method for improving expansion algorithm, it is characterised in that:Step 1
In, the connected region divided parts according to font, and using the Similarity measures matching degree of font part, between determining font part
Mapping relations.
3. according to claim 1 a kind of based on the font composition method for improving expansion algorithm, it is characterised in that:Step 2
In, maximum convex subdivision is carried out to each part, i.e., maximum convex polygon is split into as far as possible, beneficial to the expansion synthesis in later stage;It is described
Convex polygon is vector polygon.
4. according to claim 1 a kind of based on the font composition method for improving expansion algorithm, it is characterised in that:Step 3
In, the center of gravity of each convex polygon is calculated, and similarity is calculated using the barycentric coodinates vector distance after normalization, so that it is determined that convex
Mapping relations between polygon.
5. according to claim 1 a kind of based on the font composition method for improving expansion algorithm, it is characterised in that:Step 4
In, the expansion process based on identical side is as follows, and two convex polygons of correspondence are referred to as into polygon PA and PB, and wherein PA is to treat swollen
Swollen figure, PB is structural element;
Step 4.1, selects a summit of polygon PB as the reference point in expansion process, wherein selecting each convex polygon
Its consistency is kept during reference point, it is consistent with the direction for ensureing expansion, effectively improve expansion effect;
Step 4.2, keeps reference point to be overlapped with the two-end-point of polygon PA a lines, with a left side for a line of polygon PA
End points is motion starting point, translates polygon PB along a line of polygon PA, and according to the identical feature in side, calculate current translation
In it is each to coincide side formed quadrangle, that is, obtain PB in the expansion track of PA a lines;
Step 4.3, repeat step 4.2 obtains expansions of the PB to PA untill each edge to polygon PA expands
Track;
Step 4.4, takes expansion track with the union of polygon PA as expansion results.
6. according to claim 5 a kind of based on the font composition method for improving expansion algorithm, it is characterised in that:In step
In 4.1, its consistency is kept during the reference point for selecting each convex polygon, to ensure the orientation consistency of expansion, effectively improved
Expansion effect.
7. according to claim 1 a kind of based on the font composition method for improving expansion algorithm, it is characterised in that:Step 5
In, be the adjacent edge of profile to the main target that expansion results carry out curve fitting, first attempt fitting be in line, if cannot if
Trial is fitted to curve, and to generate new profile side, gained figure is font composition result after fitting.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710010833.XA CN106897253B (en) | 2017-01-06 | 2017-01-06 | Font synthesis method based on improved expansion algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710010833.XA CN106897253B (en) | 2017-01-06 | 2017-01-06 | Font synthesis method based on improved expansion algorithm |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106897253A true CN106897253A (en) | 2017-06-27 |
CN106897253B CN106897253B (en) | 2020-05-29 |
Family
ID=59198558
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710010833.XA Active CN106897253B (en) | 2017-01-06 | 2017-01-06 | Font synthesis method based on improved expansion algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106897253B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101419715A (en) * | 2008-11-28 | 2009-04-29 | 深圳创维数字技术股份有限公司 | Method and device for generating character or graphic dot matrix |
CN102915550A (en) * | 2012-10-17 | 2013-02-06 | 华南理工大学 | Character joining detection method |
-
2017
- 2017-01-06 CN CN201710010833.XA patent/CN106897253B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101419715A (en) * | 2008-11-28 | 2009-04-29 | 深圳创维数字技术股份有限公司 | Method and device for generating character or graphic dot matrix |
CN102915550A (en) * | 2012-10-17 | 2013-02-06 | 华南理工大学 | Character joining detection method |
Non-Patent Citations (6)
Title |
---|
CHUN-QIONG GONG: "A New Method for the Morph of Planar Polygons Based on Shape Feature", 《2011 INTERNATIONAL CONFERENCE OF INFORMATION TECHNOLOGY, COMPUTER ENGINEERING AND MANAGEMENT SCIENCES》 * |
ZHIGENG PAN 等: "Chinese font composition method based on algebraic system of geometric shapes", 《COMPUTERS & GRAPHICS-UK》 * |
ZHOUHUI LIAN 等: "Automatic shape morphing for Chinese characters", 《SIGGRAPH ASIA 2012 TECHNICAL BRIEFS》 * |
刘文予 等: "基于形态学的新的汉字字形自动生成方法", 《计算机学报》 * |
刘文予 等: "汉字字形的凸剖分变形及合成", 《计算机研究与发展》 * |
杨丰 等: "一种实用的汉字字形合成方法", 《中国图象图形学报》 * |
Also Published As
Publication number | Publication date |
---|---|
CN106897253B (en) | 2020-05-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101515374B (en) | Individualized realistic virtual character modeling method based on images | |
CN105046735B (en) | A kind of three-dimensional surface texture synthetic method based on Primitive Element Distribution | |
CN109410334A (en) | A kind of three-dimensional grid model defect hole restorative procedure based on characteristic curve | |
CN103236077B (en) | The three-dimensional model line method for drafting that a kind of feature strengthens | |
CN107330903A (en) | A kind of framework extraction method of human body point cloud model | |
CN109034131A (en) | A kind of semi-automatic face key point mask method and storage medium | |
Zhang et al. | Design 3D garments for scanned human bodies | |
Chen et al. | Lattice-based skinning and deformation for real-time skeleton-driven animation | |
Xu et al. | Rapid 3D human modeling and animation based on sketch and motion database | |
CN111047684A (en) | Model simplification method based on three-dimensional model characteristics | |
CN108875720B (en) | Method and device for extracting skeleton line of vector font | |
CN106897253A (en) | A kind of font composition method based on improvement expansion algorithm | |
Huang et al. | Mesh simplification algorithm based on edge curvature metrics and local optimization | |
Shen et al. | An approach to feature moving of hexahedral mesh | |
CN113450441B (en) | Rendering method and device of three-dimensional virtual model and electronic equipment | |
Tang et al. | A repair method of point cloud with big hole | |
CN109887074A (en) | A kind of three-dimensional modeling method based on complex plane image | |
CN102426708B (en) | Texture design and synthesis method based on element reorganization | |
Huang et al. | A method of shadow puppet figure modeling and animation | |
Cheng et al. | Automatic skeleton generation and character skinning | |
Zhang et al. | Flatten Anything: Unsupervised Neural Surface Parameterization | |
CN114549795A (en) | Parameterization reconstruction method, parameterization reconstruction system, parameterization reconstruction medium and parameterization reconstruction equipment for shoe tree curved surface | |
Chen et al. | A data-driven approach to efficient character articulation | |
Du et al. | VTON-HF: High fidelity virtual try-on network via semantic adaptation | |
CN104537628A (en) | Animation image adaptation method with controllable redundancy |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |