@@ -439,6 +439,60 @@ public void CanDrawTextWithEmptyPath()
439439 Vector2 . Zero ) ) ;
440440 }
441441
442+ [ Theory ]
443+ [ WithSolidFilledImages ( 300 , 200 , nameof ( Color . White ) , PixelTypes . Rgba32 , TestFonts . OpenSans , 32 , 75F ) ]
444+ [ WithSolidFilledImages ( 300 , 200 , nameof ( Color . White ) , PixelTypes . Rgba32 , TestFonts . OpenSans , 40 , 90F ) ]
445+ public void CanRotateFilledFont_Issue175 < TPixel > (
446+ TestImageProvider < TPixel > provider ,
447+ string fontName ,
448+ int fontSize ,
449+ float angle )
450+ where TPixel : unmanaged, IPixel < TPixel >
451+ {
452+ Font font = CreateFont ( fontName , fontSize ) ;
453+ const string text = "QuickTYZ" ;
454+ AffineTransformBuilder builder = new AffineTransformBuilder ( ) . AppendRotationDegrees ( angle ) ;
455+
456+ TextOptions textOptions = new ( font ) ;
457+ FontRectangle bounds = TextMeasurer . Measure ( text , textOptions ) ;
458+ Matrix3x2 transform = builder . BuildMatrix ( Rectangle . Round ( new RectangleF ( bounds . X , bounds . Y , bounds . Width , bounds . Height ) ) ) ;
459+
460+ provider . RunValidatingProcessorTest (
461+ x => x . SetDrawingTransform ( transform ) . DrawText ( textOptions , text , Color . Black ) ,
462+ $ "F({ fontName } )-S({ fontSize } )-A({ angle } )-{ ToTestOutputDisplayText ( text ) } )",
463+ TextDrawingComparer ,
464+ appendPixelTypeToFileName : false ,
465+ appendSourceFileOrDescription : true ) ;
466+ }
467+
468+ [ Theory ]
469+ [ WithSolidFilledImages ( 300 , 200 , nameof ( Color . White ) , PixelTypes . Rgba32 , TestFonts . OpenSans , 32 , 75F , 1 ) ]
470+ [ WithSolidFilledImages ( 300 , 200 , nameof ( Color . White ) , PixelTypes . Rgba32 , TestFonts . OpenSans , 40 , 90F , 2 ) ]
471+ public void CanRotateOutlineFont_Issue175 < TPixel > (
472+ TestImageProvider < TPixel > provider ,
473+ string fontName ,
474+ int fontSize ,
475+ float angle ,
476+ int strokeWidth )
477+ where TPixel : unmanaged, IPixel < TPixel >
478+ {
479+ Font font = CreateFont ( fontName , fontSize ) ;
480+ const string text = "QuickTYZ" ;
481+ AffineTransformBuilder builder = new AffineTransformBuilder ( ) . AppendRotationDegrees ( angle ) ;
482+
483+ TextOptions textOptions = new ( font ) ;
484+ FontRectangle bounds = TextMeasurer . Measure ( text , textOptions ) ;
485+ Matrix3x2 transform = builder . BuildMatrix ( Rectangle . Round ( new RectangleF ( bounds . X , bounds . Y , bounds . Width , bounds . Height ) ) ) ;
486+
487+ provider . RunValidatingProcessorTest (
488+ x => x . SetDrawingTransform ( transform )
489+ . DrawText ( textOptions , text , Pens . Solid ( Color . Black , strokeWidth ) ) ,
490+ $ "F({ fontName } )-S({ fontSize } )-A({ angle } )-STR({ strokeWidth } )-{ ToTestOutputDisplayText ( text ) } )",
491+ TextDrawingComparer ,
492+ appendPixelTypeToFileName : false ,
493+ appendSourceFileOrDescription : true ) ;
494+ }
495+
442496 private static string Repeat ( string str , int times ) => string . Concat ( Enumerable . Repeat ( str , times ) ) ;
443497
444498 private static string ToTestOutputDisplayText ( string text )
0 commit comments