Raster Graphics TextMeasure for SVG
Maintainer thường phản hồi trong vòng 1 ngày
@Danielku15 đang làm issue này rồi.
Từ ngày 4/12/2025.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 1.9k
- Fork
- 297
- Merge trung bình
- 9 giờ 2 phút
- Pull request đã merge (30 ngày)
- 44
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CoderLine/alphaTab
-
ai-authored
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-authored
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 66/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Respect systems layout of MusicXMLCó thể đã có người làm @Danielku15 đã nhận 18 ngày trước. Đang mở
CoderLine/alphaTab#2909 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Expose Lyrics in public apiCó thể đã có người làm @Danielku15 đã nhận 18 ngày trước. Đang mở
CoderLine/alphaTab#2908 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Show accentuations on tab-only stavesCó thể đã có người làm @Danielku15 đã nhận 18 ngày trước. Đang mở
CoderLine/alphaTab#2906 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của CoderLine/alphaTab
Issue tương tự
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
openclaw/openclaw#182077 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
aikido high security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
dequelabs/axe-linter-action#161 ·
-
[Feature Request] Update the DimCode agent icon to the 45:32 brand markCó thể đã có người làm @eric8810 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: 建议导入源后,自动切换到新导入的源Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
lyswhut/lx-music-desktop#3026 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
abhigyanpatwari/GitNexus#3704 ·
Maintainer thường phản hồi trong vòng 1 ngày