38
Handwritten Fonts Modeling Based on Fat Lines of Variable Width Stanislav Klimenko Moscow Physicotechnical Institute Moscow, Russia [email protected] Leonid Mestetskiy Moscow State University Moscow, Russia [email protected] Andrey Semenov Tver State University Tver, Russia [email protected]

Handwritten Fonts Modeling Based on Fat Lines of Variable Width Stanislav Klimenko Moscow Physicotechnical Institute Moscow, Russia [email protected]

Embed Size (px)

Citation preview

Handwritten Fonts Modeling Based on Fat Lines of Variable Width

Stanislav KlimenkoMoscow Physicotechnical Institute

Moscow, [email protected]

Leonid MestetskiyMoscow State University

Moscow, [email protected]

Andrey SemenovTver State University

Tver, [email protected]

Fonts DescribingThe 16-th International Conference in Central Europe on

Computer Graphics, Visualization andComputer Vision'2008

Outline description is union of Bezier curves 2

Fonts DescribingDisadvantages of outline description:1. Implementation of “alive” handwriting is difficulty

2. Doesn’t allow implementing variations of stroke width of pen

3. The problem of preservation of contour smoothness

?

3

Handwritten Fonts

4

1. Representation of a font as a trace of pen «with a variable width»

2. Obtaining of a font in the form of curves with a width on the scanned image

Our approach

5

],[

})())(())((:),{( 2222

bat

trtvytuxRyxCt

- Fat curve with axis P(t)=(u(t),v(t)) and thickness r(t)

Fat Curve

tCaC

bC

is family of circles of variable radius with centers on smooth curve

6

Elementary Fat B-Spline Curve

33

232

231

30

)(

1333)(

463)(

)1()(

ttB

ttttB

tttB

ttB

3

0

*)(61

)(i

ii HtBtC

},,{ iriyixi HHHH

7

Composite Fat B-Spline Curve

8

The hand-written alphabet (Russian)

Personal hand-written font

Our task

9

Step 1• The person writes separate letters by ink pen on a

paper, for example, the alphabet

The method description

Step 2• The image is digitized by the scanner 10

The method description

Binary image Polygonal figure

Step 3• Construction of piecewise-linear boundary as a

polygon of minimal perimeter

11

The method description

Polygonal figure Continuous skeleton

Step 4• Construction of continuous skeleton as a set of

medial axes of polygonal figure

12

The method descriptionStep 5• Construction of a base skeleton

Continuous skeleton Base skeleton 13

The method descriptionStep 6• Decomposition branches of base skeleton

Base skeleton Base skeleton with circles 14

The method descriptionStep 7• Approximation of base skeleton by a circular figure

Circular figureBase skeleton with circles 15

Fat Curve Outline Smoothing• Recalculation radius value for each control circle:

riirriir HkHkHkH 13211'

16

Fat Curve Axis Smoothing• Recalculation center coordinates for each control circle:

.

,

13211'

13211'

yiiyyiiy

xiixxiix

HkHkHkH

HkHkHkH

17

Fat Curve Sewing

18

Kerning task

What is better ?

19

Alignment of letter spacing • Kerning - is a visual alignment of letter spacing in process

of text on raster devices .

How is near ?

20

Method of Automatic Kerning1. Rasterization of kerning pair of characters on a common base line of raster

21

Method of Automatic Kerning2. Scanning by a horizontal line "from top to bottom" with step of 1 pixel

22

Method of Automatic Kerning3. At each position of a scanning line

23

4. Defining position of a scanning line at which distance between the points is minimum

Method of Automatic Kerning

Minimal distance

24

5. Defining minimal kerning distance

Method of Automatic Kerning

Minimal kerning distance

Is negative kerning25

5. Defining minimal kerning distance

Method of Automatic Kerning

Minimal kerning distance

Is positive kerning26

Some examples

KERNING[я][б] = 15

KERNING[в][а] = -72

Method of Automatic Kerning

Minimal kerning distance is 20

27

Kerning table

а б в г .. .. э ю я

а 19 15 8 12 .. -3 11 19

б -13 -17 -5 -8 .. .. -7 -29 -21

в -72 1 -62 -67 .. .. -66 -88 -80

г 19 15 8 10 .. .. -9 10 19

.. .. .. .. .. .. .. .. .. ..

.. .. .. .. .. .. .. .. .. ..

э 4 0 19 19 .. .. 10 -13 -5

ю 16 12 6 3 .. .. 19 2 12

я 19 15 11 17 .. .. 9 19 19

Method of Automatic Kerning

28

Method of Automatic Kerning

KERNING[в][ю] = -88 What does it mean ?

Length of this segment is 88

It means how many pixels to the left it is necessary to move the right character

29

Some examples

Method of Automatic Kerning

It’s A.S. Pushkin

No kerning30

Some examples

Method of Automatic Kerning

It’s A.S. Pushkin

Kerning is 20 pixels31

Some examples

Method of Automatic Kerning

It’s A.S. Pushkin

Kerning is 40 pixels32

Thickness Pen Modeling

33

3D Modeling

34

• Modeling of 3D effect by layer painting

“Alive” Handwriting Modeling

iirir HH i - is noise

• Adding of small noise into values of radiuses

35

• Adding of small noise into values of radiuses

“Alive” Handwriting Modeling

36

• Converting fat curve representation to outline description

Export to famous description

37

Fat curves description PostScript description

Summary

• The method of fat curves is efficient tool for modeling of hand-written characters;

• There is possibility of letterspacings controlling (zoom in/out letterspacing);

• There is easy way to modeling “alive” handwriting;

• Our approach can be used as embedded module (plug-in) in font editors.

38