Raster Graphics TextMeasure for SVG
Mantenedores costumam responder em até 1 dia
@Danielku15 já está trabalhando nisso.
Desde 4/12/2025.
Avaliação
Esta issue ainda não foi avaliada.
Descrição
The SVG rendering currently uses a rather hacky text measurement engine where we pre-compute certain character sizes and then sum them up. for bold and italic we just add a factor.
This is error prone and often imprecise.
To eliminate this problem we should implement a new text-renderer for all platforms.
C#/Kotlin
For C# and Kotlin it's fairly easy: We simply use alphaSkia. Any potential custom-fonts should be registered there already.
JS Node
Same as for C#/Kotlin we can rely on alphaSkia.
JS Browser
Here it gets tricky. In Web Workers we do not have access to the web fonts loaded so we need to find something different:
- The general idea is to use a OffScreenCanvas and load all fonts into the worker context using the font loading APIs.
- To pass the web fonts to the worker context we do the following:
- We allow users to explicitly specify the font sources. If users specify the location we can pass the metadata to the worker and load the fonts there. The config would be similar to how we have it for the SMuFl Fonts. For one font, we might have multiple sources.
- We should align the options to the properties available for
FontFacedefinitions (family, style, weight, src, unicode-range). As this feature is web-only we can use the web type definitions directly.
- We should align the options to the properties available for
- If no font source is specified, we try to auto-detect it. Unfortunately
FontFacedoes not give us access to the original source.Array.from(document.styleSheets).flatMap(y => Array.from(y.rules).filter(z => z instanceof CSSFontFaceRule))gives us access to all custom web font definitions.- For every font needed in the rendering, we lookup the matching CSS font rules (matching can be rather loose, better have more fonts than less).
- We fill the remaining font definitions.
- We allow users to explicitly specify the font sources. If users specify the location we can pass the metadata to the worker and load the fonts there. The config would be similar to how we have it for the SMuFl Fonts. For one font, we might have multiple sources.
- Linguagem predominante
- TypeScript
- Estrelas
- 1.9k
- Forks
- 297
- Merge médio
- 9h 2min
- PRs com merge (30d)
- 44
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CoderLine/alphaTab
-
ai-authored
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
Mantenedores costumam responder em até 1 dia
-
ai-authored
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 66/100
Mantenedores costumam responder em até 1 dia
-
Respect systems layout of MusicXMLTalvez já em andamento @Danielku15 assumiu há 20 dias. Aberta
CoderLine/alphaTab#2909 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Expose Lyrics in public apiTalvez já em andamento @Danielku15 assumiu há 20 dias. Aberta
CoderLine/alphaTab#2908 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
Show accentuations on tab-only stavesTalvez já em andamento @Danielku15 assumiu há 20 dias. Aberta
CoderLine/alphaTab#2906 · 1 comentário · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de CoderLine/alphaTab
Issues semelhantes
-
bug require-triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
expressjs/expressjs.com#2549 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
umami-software/umami#4686 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
[Bug]: Device screenshot fails with 500 on iPhone Duo (Xcode 27.2): serve-sim calls simctl without --displayTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
pingdotgg/t3code#24900 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
inu-appcenter/UNIDorm-web#411 ·
Mantenedores costumam responder em até 1 dia
-
🐛 bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
Mantenedores costumam responder em até 2 dias