feat(erp): facturation KissMetrics en dollars, part différée M3 retrouvée, et le format de lettre commerciale (#97)
Co-authored-by: Gabriel Radureau <[email protected]>
This commit was merged in pull request #97.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
// Rend un emoji en PNG transparent via Chromium, qui sait lire Apple Color
|
||||
// Emoji là où weasyprint échoue (format bitmap sbix, non géré).
|
||||
import { chromium } from "playwright";
|
||||
const [outDir, ...emojis] = Deno.args;
|
||||
const b = await chromium.launch({ headless: true });
|
||||
const p = await (await b.newContext({ deviceScaleFactor: 8 })).newPage();
|
||||
for (const [i, e] of emojis.entries()) {
|
||||
await p.setContent(
|
||||
`<body style="margin:0"><span id="g" style="font-family:'Apple Color Emoji';` +
|
||||
`font-size:64px;line-height:1;display:inline-block">${e}</span></body>`);
|
||||
const el = p.locator("#g");
|
||||
const f = `${outDir}/emoji-${i + 1}.png`;
|
||||
await el.screenshot({ path: f, omitBackground: true });
|
||||
console.log(` ${e} -> ${f}`);
|
||||
}
|
||||
await b.close();
|
||||
Reference in New Issue
Block a user