Skip to content

Unable to draw NotoColorEmoji font #462

@CptWesley

Description

@CptWesley

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

ImageSharp.Drawing version

3.1.11

Other ImageSharp packages and versions

SixLabors.ImageSharp.Drawing 2.1.7, SixLabors.Fonts 2.1.3

Environment (Operating system, version and so on)

Windows 11

.NET Framework version

NET 10

Description

I am unable to draw using the NotoColorEmoji font. Other fonts work fine, including other emoji fonts (such as Segoe UI loaded using SystemFonts.Get("Segoe UI Emoji") and NotoEmoji loaded from a .ttf file).

Steps to Reproduce

  1. Run the following code:
var text = "a😃a⭐️a🌟a😃a";
var fonts = new FontCollection();
var fontFamily = fonts.Add("NotoColorEmoji-Regular.ttf");
var font = fontFamily.CreateFont(12f);
var color = SixLabors.ImageSharp.Color.Black;
var pos = new PointF(10, 10);
using var img = new Image<Rgba32>(256, 64, new Rgba32(0));
img.Mutate(ctx =>
{
    ctx.Clear(SixLabors.ImageSharp.Color.White);
    ctx.DrawText(text, font, color, pos);
});
img.SaveAsPng("a.png");
  1. Observe a.png:
Image

Here the box-like glyphs are to be expected, since NotoColorEmoji doesn't contain any glyphs for the a character.
The advance/bounds of the emoji glyphs seem to be taken into account.

Images

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions