question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

DrawText generates text with DFKai-SB or KaiU fonts differently than expected

See original GitHub issue

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

using chinese fonts on DrawText I got the error pic

Steps to Reproduce

System Configuration

  • ImageSharp.Drawing version:1.0.0-beta15

  • Other ImageSharp packages and versions: 3.0.1

  • .NET Framework version: .net 7 `

         var font = SystemFonts.CreateFont(fontName, fontsize);
          var color = new Rgba32((byte)colorR, (byte)colorG, (byte)colorB);
    
          var image = new Image<Rgba32>(1, 1);
          var textSize = TextMeasurer.Measure(txt, new TextOptions(font));
          image.Mutate(x => x.Resize(new Size((int)textSize.Width, (int)textSize.Height)));
          image.Mutate(x => x.DrawText(txt, font, color, PointF.Empty));
    
          using (var stream = new MemoryStream())
          {
              image.Save(stream, new PngEncoder());
              return stream.ToArray();
          }
    

`

Issue Analytics

  • State:closed
  • Created 4 months ago
  • Comments:18 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
behdadcommented, Jun 28, 2023

Nice! So you have a hinter as well? Me is jealous.

1reaction
JimBobSquarePantscommented, Jun 28, 2023

Yep. This is working.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

DrawText draws Segoe UI font texts incorrectly
I encountered one problem with drawing texts using the Windows API DrawText call for the Segoe UI font: enter image description here.
Read more >
drawText Does not support text style like text decoration
I am trying to draw text on pdf with some styling like bold, italic, and underline but bold, italic is in the font...
Read more >
DFKai-SB font family - Typography
DFKai-SB font is a serif style with Traditional Chinese support. DFKai-SB has graceful strokes. Description. File name, Kaiu.ttf. Styles & ...
Read more >
Untitled
#to Ancient magic dragon's gift the huntress book 1 reviews, Central girls football academy ... Deepside deejays never be alone mp3, Dfkai sb...
Read more >
Untitled
Clearwater weather 15-day forecast, Scared to be lonely mp4 download, The following ... Electricman 2 hs unblocked, Abdo text bold font free download, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found