* src/base/ftsynth.c (FT_GlyphSlot_Slant): Add vertical slant. * include/freetype/ftsynth.h (FT_GlyphSlot_Slant): Update it.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
diff --git a/include/freetype/ftsynth.h b/include/freetype/ftsynth.h
index feac6ac..a1277ca 100644
--- a/include/freetype/ftsynth.h
+++ b/include/freetype/ftsynth.h
@@ -72,10 +72,12 @@ FT_BEGIN_HEADER
FT_EXPORT( void )
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
- /* Slant an outline glyph by a given sine of an angle. */
+ /* Slant an outline glyph by a given sine of an angle. You can apply */
+ /* slant along either x- or y-axis. */
FT_EXPORT( void )
FT_GlyphSlot_Slant( FT_GlyphSlot slot,
- FT_Fixed slant );
+ FT_Fixed xslant,
+ FT_Fixed yslant );
/* */
diff --git a/src/base/ftsynth.c b/src/base/ftsynth.c
index ed17be4..6ec25e1 100644
--- a/src/base/ftsynth.c
+++ b/src/base/ftsynth.c
@@ -47,7 +47,7 @@
FT_GlyphSlot_Oblique( FT_GlyphSlot slot )
{
/* Value '0x0366A' corresponds to a shear angle of about 12 degrees. */
- FT_GlyphSlot_Slant( slot, 0x0366A );
+ FT_GlyphSlot_Slant( slot, 0x0366A, 0 );
}
@@ -55,7 +55,8 @@
FT_EXPORT_DEF( void )
FT_GlyphSlot_Slant( FT_GlyphSlot slot,
- FT_Fixed slant )
+ FT_Fixed xslant,
+ FT_Fixed yslant )
{
FT_Matrix transform;
FT_Outline* outline;
@@ -74,9 +75,9 @@
/* For italic, simply apply a shear transform */
transform.xx = 0x10000L;
- transform.yx = 0x00000L;
+ transform.yx = -yslant;
- transform.xy = slant;
+ transform.xy = xslant;
transform.yy = 0x10000L;
FT_Outline_Transform( outline, &transform );