Raster Graphics TextMeasure for SVG
维护者通常 1 天内回复
@Danielku15 已经在做这个了。
开始于 2025年12月4日。
评估
这个 Issue 还没有评估数据。
描述
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.
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 297
- 平均合并
- 9 小时 2 分钟
- 30 天内合并 PR
- 44
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
CoderLine/alphaTab 的其他 Issue
-
ai-authored
难度 2/5 1-3 小时 新手友好度 69/100
维护者通常 1 天内回复
-
ai-authored
难度 3/5 1-2 天 新手友好度 66/100
维护者通常 1 天内回复
-
Respect systems layout of MusicXML可能已有人在做 @Danielku15 于 18 天前认领。 未关闭
CoderLine/alphaTab#2909 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Expose Lyrics in public api可能已有人在做 @Danielku15 于 18 天前认领。 未关闭
CoderLine/alphaTab#2908 · 已指派 1 人 ·
维护者通常 1 天内回复
-
Show accentuations on tab-only staves可能已有人在做 @Danielku15 于 18 天前认领。 未关闭
CoderLine/alphaTab#2906 · 1 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
查看 CoderLine/alphaTab 的全部 Issue
相似的 Issue
-
area:desktop bug documentation
难度 2/5 1-3 小时 新手友好度 76/100
anthropics/claude-code#104801 ·
维护者通常 1 天内回复
-
check:passed streams:add
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
spudly/design-system#110 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
[Bug]: REST API URL starting with "http" but no scheme (e.g. httpbin.org/get) is not given an http:// prefix可能已有人在做 @ItsDeadlyProgrammer 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
appsmithorg/appsmith#42471 · 1 条评论 ·
维护者通常 2 天内回复