Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
bb59c3c9
by Liu Kunpeng(柳鲲鹏) at 2022-10-16T22:10:19-04:00
2 changed files:
Changes:
... | ... | @@ -68,10 +68,15 @@ FT_BEGIN_HEADER |
68 | 68 | FT_EXPORT( void )
|
69 | 69 | FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
70 | 70 | |
71 | - /* Slant an outline glyph to the right by about 12 degrees. */
|
|
71 | + /* Slant an outline glyph to the right by about 12 degrees. */
|
|
72 | 72 | FT_EXPORT( void )
|
73 | 73 | FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
|
74 | 74 | |
75 | + /* Slant an outline glyph by a given sine of an angle. */
|
|
76 | + FT_EXPORT( void )
|
|
77 | + FT_GlyphSlot_Slant( FT_GlyphSlot slot,
|
|
78 | + FT_Fixed slant );
|
|
79 | + |
|
75 | 80 | /* */
|
76 | 81 | |
77 | 82 |
... | ... | @@ -45,6 +45,16 @@ |
45 | 45 | |
46 | 46 | FT_EXPORT_DEF( void )
|
47 | 47 | FT_GlyphSlot_Oblique( FT_GlyphSlot slot )
|
48 | + {
|
|
49 | + FT_GlyphSlot_Slant( slot, 0x0366A );
|
|
50 | + }
|
|
51 | + |
|
52 | + |
|
53 | + /* documentation is in ftsynth.h */
|
|
54 | + |
|
55 | + FT_EXPORT_DEF( void )
|
|
56 | + FT_GlyphSlot_Slant( FT_GlyphSlot slot,
|
|
57 | + FT_Fixed slant )
|
|
48 | 58 | {
|
49 | 59 | FT_Matrix transform;
|
50 | 60 | FT_Outline* outline;
|
... | ... | @@ -61,13 +71,11 @@ |
61 | 71 | |
62 | 72 | /* we don't touch the advance width */
|
63 | 73 | |
64 | - /* For italic, simply apply a shear transform, with an angle */
|
|
65 | - /* of about 12 degrees. */
|
|
66 | - |
|
74 | + /* For italic, simply apply a shear transform */
|
|
67 | 75 | transform.xx = 0x10000L;
|
68 | 76 | transform.yx = 0x00000L;
|
69 | 77 | |
70 | - transform.xy = 0x0366AL;
|
|
78 | + transform.xy = slant;
|
|
71 | 79 | transform.yy = 0x10000L;
|
72 | 80 | |
73 | 81 | FT_Outline_Transform( outline, &transform );
|