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

Emoji modifiers are not combined #827

Open
aquaductape opened this issue May 7, 2024 · 0 comments
Open

Emoji modifiers are not combined #827

aquaductape opened this issue May 7, 2024 · 0 comments

Comments

@aquaductape
Copy link

aquaductape commented May 7, 2024

Emoji modifiers are not combined.

const { writeFileSync } = require("fs");
const { join } = require("path");

const { createCanvas, GlobalFonts } = require("@napi-rs/canvas");

console.log(__dirname);
GlobalFonts.registerFromPath(
  join(__dirname, "./public/fonts/Apple/[email protected]"),
  "Apple Emoji"
);
const canvas = createCanvas(760, 360);
const ctx = canvas.getContext("2d");

ctx.font = "50px Apple Emoji";
ctx.strokeText("💃🏿", 50, 100);
ctx.strokeText("👩🏿‍🦳", 50, 180);
ctx.strokeText("🫱🏻‍🫲🏾", 50, 260);

const b = canvas.toBuffer("image/png");

writeFileSync(join(__dirname, "draw-emoji.png"), b);

Expecting this outcome where the emoji combines with modifiers
Screenshot 2024-05-07 at 1 00 53 PM
Ended up with emojis and modifiers symbols
Screenshot 2024-05-07 at 12 59 09 PM

@aquaductape aquaductape changed the title Emoji modifiers are ignored Emoji modifiers are not combined May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant