Browse Source

Merge pull request #18430 from abpframework/fix/cmsKit

CmsKit: Fix UnableToReadFont Error
pull/18437/head
Engincan VESKE 3 years ago
committed by GitHub
parent
commit
64c3136f01
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs

4
modules/cms-kit/src/Volo.CmsKit.Public.Web/Security/Captcha/SimpleMathsCaptchaGenerator.cs

@ -101,10 +101,10 @@ public class SimpleMathsCaptchaGenerator : ITransientDependency
private byte[] GenerateInternal(string stringText, CaptchaOptions options)
{
var random = new Random();
var fontName = MagickNET.FontNames.First();
var family = MagickNET.FontFamilies.First();
var drawables = new Drawables()
.Font(fontName, options.FontStyle, FontWeight.Normal, FontStretch.Normal)
.Font(family, options.FontStyle, FontWeight.Normal, FontStretch.Normal)
.FontPointSize(options.FontSize)
.StrokeColor(MagickColors.Transparent);

Loading…
Cancel
Save