v4.0.0-rc3: SVG text rendering not working
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, node.js
- Ambito
- computer-graphics
Direzione di ricerca
Inizia con la riproduzione minima usando createCanvas, loadImage e drawImage, quindi segui il percorso del testo SVG di lunasvg e confronta i relativi callback con le funzioni fillText esistenti. Il lavoro è completato quando il testo SVG viene renderizzato invece di produrre un’immagine vuota e viene aggiunta la copertura per SVG e per il rendering del testo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Minimal reproduction:
import { createCanvas, loadImage } from 'canvas'
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="200" height="100">
<text x="10" y="60" font-family="sans-serif" font-size="40" fill="red">Hello</text>
</svg>`
const img = await loadImage(Buffer.from(svg))
const canvas = createCanvas(200, 100)
const ctx = canvas.getContext('2d')
ctx.drawImage(img, 0, 0)
Resulting in a blank output image.
The issue is that the retriever/measurer/painter callbacks are not set when using lunasvg. So it gets no font data, and even if it did, the text would not be measured or painted. There are also no SVG + text tests.
I have a fix ready as well, two PRs: one here and one in the lunasvg fork. Basically it hooks these callbacks up and pipes them to the existing functions used in fillText. Just want to make sure this is a real issue before proceeding.
See forks here: node-canvas and lunasvg.
- Lingua principale
- JavaScript
- Stelle
- 10.7k
- Fork
- 1.2k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Automattic/node-canvas
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Automattic/node-canvas#2633 ·
-
Feature Text & Fonts
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
Automattic/node-canvas#2364 · 3 commenti · 2 reazioni ·
-
Feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
Automattic/node-canvas#2621 ·
-
actualBoundingBoxLeft has the sign inverted relative to canvas's own rasteriser (3.2.0, 3.2.3)Forse già presa @florianaltendorfer l’ha presa 13 giorni fa. ApertaBug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
Automattic/node-canvas#2620 · 1 commento ·
-
The PDF file created by createPDFStream becomes larger in size, and createWriteStream is very slowApertaBug performance
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
Automattic/node-canvas#2615 · 2 commenti ·
Tutte le issue di Automattic/node-canvas
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
capricorn86/happy-dom#2594 ·
I maintainer di solito rispondono entro 1 giorno
-
Decoding tag 1 (epoch date) with an 8-byte integer throws "Cannot mix BigInt and other types"Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microsoft/monaco-editor#5575 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Shrinking an array with `length =` and growing it back loses the patches for the truncated indicesForse già presa @RClaudiuM l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 4 giorni