Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect render of Thai characters when ascii characters are present in rendered text #300

Closed
4 tasks done
eangelov opened this issue Aug 11, 2022 · 1 comment · Fixed by #301
Closed
4 tasks done

Comments

@eangelov
Copy link

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp.Drawing
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

Description

When using DrawText on the test image to draw "ดวันโอวัน" everything is as expected
resultImage_1

When we draw "Test ดวันโอวัน" we get
image

Test Image:
testImage

Steps to Reproduce

using SixLabors.Fonts;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.Drawing.Processing;
using SixLabors.ImageSharp.Processing;

var fonts = new FontCollection();
fonts.AddSystemFonts();

string textToDraw = "ดวันโอวัน";

TextOptions textOpts = new TextOptions( fonts.Get( "Microsoft Sans Serif" ).CreateFont( 60, SixLabors.Fonts.FontStyle.Regular ) ){
    Origin = new SixLabors.ImageSharp.PointF( 10, 10 )
};

using Image image = Image.Load( "testImage.jpg" );
image.Mutate( 
    x => x.DrawText( 
        textOpts, textToDraw, Color.ParseHex( "#000000" ) 
    ) 
);
image.SaveAsJpeg( "resultImage_1.jpg" );


using Image image2 = Image.Load( "testImage.jpg" );
image2.Mutate( 
    x => x.DrawText( 
        textOpts, $"Test {textToDraw}", Color.ParseHex( "#000000" ) 
    ) 
);
image2.SaveAsJpeg( "resultImage_2.jpg" );

System Configuration

  • ImageSharp.Drawing version: 1.0.0-beta15
  • Other ImageSharp packages and versions: SixLabors.Fonts 1.0.0-beta18, SixLabors.ImageSharp 2.1.3
  • Environment (Operating system, version and so on): Windows 11 Pro Version: 21H2 OS build: 22000.856
  • .NET Framework version: .NET 6
  • Additional information:
@JimBobSquarePants
Copy link
Member

See #215 we don't have a shaper for it yet.

I'll have a look at why it changes when mixed with English though as that's odd.

@JimBobSquarePants JimBobSquarePants transferred this issue from SixLabors/ImageSharp.Drawing Sep 27, 2022
@JimBobSquarePants JimBobSquarePants added this to the 1.0.0-rc1 milestone Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants