[Bug 59252] New: FL STUDIO piano roll - generate chord progressions: DirectWrite Font Fallback Not Working for Unicode Music Symbols
http://bugs.winehq.org/show_bug.cgi?id=59252 Bug ID: 59252 Summary: FL STUDIO piano roll - generate chord progressions: DirectWrite Font Fallback Not Working for Unicode Music Symbols Product: Wine Version: 11.0 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: dwrite Assignee: wine-bugs@list.winehq.org Reporter: nen24t@gmail.com Distribution: --- Created attachment 80169 --> http://bugs.winehq.org/attachment.cgi?id=80169 fl studio piano roll - generate chord progressions # Wine Bug Report: DirectWrite Font Fallback Not Working for Unicode Music Symbols ## Summary DirectWrite font fallback (FontLink) does not work for Unicode music symbols (U+266D ♭, U+266E ♮, U+266F ♯) in FL Studio 2025. These symbols render as empty rectangles (tofu) instead of the correct glyphs, even though Segoe UI Symbol font is installed and FontLink is configured. ## Environment - **Wine Version:** wine-11.0 - **OS:** Ubuntu 24.04.3 LTS (Noble Numbat) - **Architecture:** 64-bit (WINEARCH=win64, wow64 mode) - **Application:** FL Studio 2025 (FL64.exe) ## Steps to Reproduce 1. Install FL Studio 2025 under Wine 2. Install Segoe UI Symbol font (`seguisym.ttf`) to `~/.wine/drive_c/windows/Fonts/` 3. Register font in registry under `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Fonts` 4. Configure FontLink for fonts used by FL Studio (Open Sans, Roboto Condensed, Ubuntu Condensed, etc.) 5. Open FL Studio → Piano Roll → Tools → Generate Chord Progression 6. Observe chord names with accidentals (e.g., C#m, Bbm, F#m) ## Expected Behavior Chord names should display with proper music symbols: - C♯m (C sharp minor) - B♭m (B flat minor) - F♯m (F sharp minor) This works correctly on native Windows. ## Actual Behavior Chord names display with empty rectangles (tofu boxes) instead of ♯ and ♭ symbols: - C□m - G□m - F□m ## Analysis FL Studio uses DirectWrite for text rendering (confirmed via `WINEDEBUG=+dwrite`). The application uses condensed fonts (Open Sans Condensed, Roboto Condensed, Ubuntu Condensed) that do not contain the Unicode music symbols (U+266D, U+266E, U+266F). Under Windows, DirectWrite's font fallback mechanism (FontLink) automatically substitutes missing glyphs from Segoe UI Symbol. Under Wine, this fallback does not occur. ### Verified Configuration FontLink registry entries were added: ``` HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink "Open Sans Condensed"="SEGUISYM.TTF,Segoe UI Symbol" "Roboto Condensed"="SEGUISYM.TTF,Segoe UI Symbol" "Ubuntu Condensed"="SEGUISYM.TTF,Segoe UI Symbol" ``` Segoe UI Symbol font is correctly loaded by Wine (confirmed via `WINEDEBUG=+font`): ``` trace:font:unix_face_create parsed font names family_name L"Segoe UI Symbol" trace:font:insert_face_in_family_list Adding face L"Segoe UI Symbol" in family L"Segoe UI Symbol" ``` ### Workarounds Attempted (All Failed) 1. ✗ Installing Segoe UI Symbol to Wine fonts folder 2. ✗ Registering font in Windows registry 3. ✗ Configuring FontLink for all relevant fonts 4. ✗ Patching FL Studio fonts with fontforge to include music symbols (breaks QuickFontCache) 5. ✗ Font substitution via `HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements` 6. ✗ Setting Windows version to Windows 11 7. ✗ Enabling DirectWrite GdiInterop ## Technical Details ### Relevant Wine Debug Output ``` WINEDEBUG=+dwrite wine FL64.exe 2>&1 | grep glyph 0380:trace:dwrite:dwritefontface_GetGlyphIndices ... 0380:trace:dwrite:dwritefontface_GetDesignGlyphMetrics ... ``` Wine's DirectWrite receives glyph requests but does not perform fallback to FontLink fonts for missing glyphs. ### Unicode Code Points - U+266D: MUSIC FLAT SIGN (♭) - U+266E: MUSIC NATURAL SIGN (♮) - U+266F: MUSIC SHARP SIGN (♯) ### FL Studio Font Configuration FL Studio bundles its own FreeType DLL (`freetype_x64.dll`) and QuickFontCache system. However, the actual text rendering goes through Windows DirectWrite API, which Wine should handle. ## Suggested Component `dlls/dwrite` - DirectWrite font fallback / FontLink implementation ## Related Wine Bugs **Bug #53739** - "Text does not show in QQ UI and Enterprise WeChat UI" https://bugs.winehq.org/show_bug.cgi?id=53739 This bug describes the same root cause - DirectWrite font fallback not working correctly. The problematic commit was identified as: - `dwrite: Remove old system fallback logic.` - Commit ID: `26e717c5653d2c6fcb29846e7d22aa97e37048e1` Problematic code in `dlls/dwrite/analyzer.c`: ```c data = fallback->data.count == ~0u ? &system_fallback : &fallback->data; ``` The `system_fallback` does not correctly provide fallback fonts for missing glyphs. ## References - Wine Bugzilla: Related to Bug #53739 - FL Studio runs under Wine: https://appdb.winehq.org/objectManager.php?sClass=application&iId=178 ## Attachments Screenshot showing the issue is available in the project folder. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #1 from Nikolay Sivov <bunglehead@gmail.com> --- Unfortunately Noto Sans Symbols 2 (and *Symbols2 as well) do not support this range. I'll have to look for a better candidate on Linux. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 gng <nen24t@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|11.0 |10.0 --- Comment #2 from gng <nen24t@gmail.com> --- Thanks for looking into this! In case it helps, these fonts on my Ubuntu 24.04 system support U+266D-266F: ``` fc-list :charset=266d family | head -5 ``` - DejaVu Sans - Noto Music - FreeSans/FreeSerif DejaVu Sans is commonly installed on most Linux distributions. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #3 from Nikolay Sivov <bunglehead@gmail.com> --- Created attachment 80175 --> http://bugs.winehq.org/attachment.cgi?id=80175 patch Could you try this patch? Turns out "Noto Sans Symbols" has this range. It would be great if it was merged to "Symbols 2" as well. If you have problems installing this font, adjust the name accordingly. Right now it's important to verify that this change helps at all. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #4 from gng <nen24t@gmail.com> --- Tested the patch - partial success! **Results:** - ✅ Sharp (♯) symbols work correctly and consistently - ❌ Flat symbols always show as tofu boxes I suspect FL Studio uses different Unicode code points: | Symbol | Working? | Unicode | Name | Range | |--------|----------|---------|------|-------| | Sharp ♯ | ✅ Yes | U+266F | MUSIC SHARP SIGN | 2600-26FF (patched) | | Flat | ❌ No | U+1D12C | MUSICAL SYMBOL FLAT | 1D100-1D1FF (NOT patched) | The patch covers the Miscellaneous Symbols range (2600-26FF), but FL Studio likely uses U+1D12C from the Musical Symbols range (1D100-1D1FF) for flat signs. Fonts supporting U+1D12C: $ fc-list :charset=1d12c family Noto Music Symbola FreeSerif Perhaps adding the Musical Symbols range would fix flats: /* Musical Symbols 1D100-1D1FF */ { "1D100-1D1FF", L"Noto Music" }, -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #5 from gng <nen24t@gmail.com> --- Created attachment 80180 --> http://bugs.winehq.org/attachment.cgi?id=80180 FL STUDIO piano roll - generate chord progressions FL Studio 2025 [build 5171] - ✅ Sharp (♯) symbols work correctly and consistently - ❌ Flat symbols always show as tofu boxes -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #6 from Nikolay Sivov <bunglehead@gmail.com> --- Could you please attach a full +dwrite log? It should show which character it's using. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #7 from gng <nen24t@gmail.com> --- Created attachment 80182 --> http://bugs.winehq.org/attachment.cgi?id=80182 Complete WINEDEBUG=+dwrite log (12MB uncompressed) -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #8 from gng <nen24t@gmail.com> --- Created attachment 80183 --> http://bugs.winehq.org/attachment.cgi?id=80183 Filtered relevant entries -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #9 from gng <nen24t@gmail.com> --- Created attachment 80184 --> http://bugs.winehq.org/attachment.cgi?id=80184 Updated patch proposal -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #10 from gng <nen24t@gmail.com> --- Hi Nikolay, Thank you for looking into this. I've captured a full +dwrite log and discovered the root cause. ROOT CAUSE: The main font used by FL Studio (Segoe UI / segoeui.ttf) contains U+266F (♯ sharp) but does NOT contain U+266D (♭ flat). Font analysis results: Segoe UI (segoeui.ttf): U+266D MISSING, U+266F PRESENT Segoe UI Symbol (seguisym.ttf): U+266D PRESENT, U+266F PRESENT Symbola: U+266D PRESENT, U+266F PRESENT This explains the behavior: - Sharp (♯) renders correctly because it exists in Segoe UI directly - Flat (♭) shows as tofu because it's NOT in Segoe UI, and the font fallback to Segoe UI Symbol is not happening The dwrite log shows that Wine loads seguisym.ttf (Segoe UI Symbol) at startup, but when FL Studio requests text rendering with "Segoe UI", the fallback for missing glyphs in the 2600-26FF range doesn't seem to trigger. PROPOSED FIX: Add "Segoe UI Symbol" as the primary fallback for the Miscellaneous Symbols range in dlls/dwrite/analyzer.c: /* Miscellaneous Symbols 2600-26FF (includes musical flat/sharp/natural) */ { "2600-26FF", L"Segoe UI Symbol, Symbola, Noto Sans Symbols" }, I've attached: 1. fl-dwrite-full.log.gz - Complete WINEDEBUG=+dwrite log (12MB uncompressed) 2. fl-dwrite-relevant.log - Filtered relevant entries 3. patch-v3.diff - Updated patch proposal Let me know if you need any additional information or traces. Best regards -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #11 from gng <nen24t@gmail.com> --- Hi Nikolay, Thank you for looking into this. I've captured a full +dwrite log and discovered the root cause. ROOT CAUSE: The main font used by FL Studio (Segoe UI / segoeui.ttf) contains U+266F (♯ sharp) but does NOT contain U+266D (♭ flat). Font analysis results: Segoe UI (segoeui.ttf): U+266D MISSING, U+266F PRESENT Segoe UI Symbol (seguisym.ttf): U+266D PRESENT, U+266F PRESENT Symbola: U+266D PRESENT, U+266F PRESENT This explains the behavior: - Sharp (♯) renders correctly because it exists in Segoe UI directly - Flat (♭) shows as tofu because it's NOT in Segoe UI, and the font fallback to Segoe UI Symbol is not happening The dwrite log shows that Wine loads seguisym.ttf (Segoe UI Symbol) at startup, but when FL Studio requests text rendering with "Segoe UI", the fallback for missing glyphs in the 2600-26FF range doesn't seem to trigger. PROPOSED FIX: Add "Segoe UI Symbol" as the primary fallback for the Miscellaneous Symbols range in dlls/dwrite/analyzer.c: /* Miscellaneous Symbols 2600-26FF (includes musical flat/sharp/natural) */ { "2600-26FF", L"Segoe UI Symbol, Symbola, Noto Sans Symbols" }, I've attached: 1. fl-dwrite-full.log.gz - Complete WINEDEBUG=+dwrite log (12MB uncompressed) 2. fl-dwrite-relevant.log - Filtered relevant entries 3. patch-v3.diff - Updated patch proposal Let me know if you need any additional information or traces. Best regards -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #12 from gng <nen24t@gmail.com> --- Sorry for the duplicate post - Bugzilla glitch. Feel free to delete one of them. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #13 from gng <nen24t@gmail.com> --- Update: Root Cause Found and Workaround Available After extensive debugging with WINEDEBUG=+dwrite, I've discovered the actual root cause of this issue. === ROOT CAUSE === The problem is NOT with Wine's font fallback configuration. The issue is: 1. Segoe UI (segoeui.ttf) contains U+266F (♯ sharp) but does NOT contain U+266D (♭ flat) 2. FL Studio uses low-level DirectWrite APIs that bypass font fallback entirely FL Studio calls: - IDWriteFontFace::GetGlyphIndices (139 calls observed) - IDWriteFactory::CreateGlyphRunAnalysis (588 calls observed) FL Studio does NOT call: - IDWriteTextLayout (never used) - IDWriteFontFallback::MapCharacters (never used) This means FL Studio asks Segoe UI directly for the flat glyph, gets nothing (glyph index 0), and renders tofu - without ever triggering Wine's font fallback mechanism. The patches to system_fallback_config[] in dlls/dwrite/analyzer.c are correct but have no effect for this application because the fallback code path is never executed. === WORKAROUND === Since FL Studio bypasses font fallback, the solution is to add the missing glyph directly to Segoe UI. I've created a fix script and published it on GitHub: https://github.com/giang17/flstudio-wine-font-fix The repository contains: - fix-flat-symbol.sh - All-in-one bash script - patch-segoeui.py - Python script using fonttools - Screenshots (before/after) - Full documentation Usage: git clone https://github.com/giang17/flstudio-wine-font-fix.git cd flstudio-wine-font-fix ./fix-flat-symbol.sh ~/.wine This patches segoeui.ttf in the WINEPREFIX (creates a backup automatically). After applying this workaround, all flat symbols display correctly in FL Studio. === IMPLICATIONS FOR WINE === This raises a question: Should Wine's DirectWrite implementation provide automatic font fallback in GetGlyphIndices when a glyph is not found? On native Windows, I'm not certain whether GetGlyphIndices triggers automatic fallback or if applications are expected to use IDWriteFontFallback::MapCharacters explicitly. If automatic fallback in GetGlyphIndices is expected Windows behavior, that would be a separate bug worth investigating. Thanks for looking into this! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #14 from Nikolay Sivov <bunglehead@gmail.com> --- (In reply to gng from comment #13)
This raises a question: Should Wine's DirectWrite implementation provide automatic font fallback in GetGlyphIndices when a glyph is not found?
No, it can't work like that. The question is whether it's using Segoe UI at all on Windows. I'd suggest starting with clean prefix, no addition font configuration, no addition font files copied over (you won't get Segoe UI on Linux systems, it's not distributed separately). -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #15 from gng <nen24t@gmail.com> --- Hi Nikolay, Thank you for your guidance on testing with a clean WINEPREFIX - that was exactly the right approach and helped us find a clean solution! == What We Found == Following your suggestion, we tested FL Studio in a fresh WINEPREFIX with no Windows fonts: Clean WINEPREFIX (no fonts): - Wine maps "Segoe UI" → Cantarell (via fontconfig) - Cantarell lacks BOTH ♭ (U+266D) AND ♯ (U+266F) - Result: Both symbols render as tofu boxes With original Segoe UI: - Segoe UI has ♯ but NOT ♭ - Result: Only ♭ renders as tofu This confirmed your point - the issue is purely about which font is available and what glyphs it contains, not about Wine's fallback mechanisms. == Clean Solution == We found a solution using only open-source fonts - no Wine changes needed: Use DejaVu Sans (SIL License) renamed to "Segoe UI": 1. Copy DejaVu Sans to WINEPREFIX Fonts folder as segoeui.ttf 2. Rename the internal font family name to "Segoe UI" using fonttools DejaVu Sans natively contains both ♭ and ♯ symbols - no glyph patching required. == What We Tested (That Didn't Work) == For completeness, we also tested these approaches: 1. Fontconfig aliases (Segoe UI → DejaVu Sans) - doesn't work 2. Wine Registry FontSubstitutes - doesn't work Both fail because FL Studio uses DirectWrite which bypasses these mechanisms. This confirms your earlier explanation about GetGlyphIndices. == Resources == GitHub repo with automated fix script: https://github.com/giang17/flstudio-wine-font-fix Debug log from clean WINEPREFIX test attached: fl-font-debug-clean-wineprefix.log.gz Screenshots showing the fix works are attached to this report. Thanks again for pointing us in the right direction! -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #16 from gng <nen24t@gmail.com> --- Created attachment 80190 --> http://bugs.winehq.org/attachment.cgi?id=80190 Debug log from clean WINEPREFIX -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #17 from gng <nen24t@gmail.com> --- Created attachment 80191 --> http://bugs.winehq.org/attachment.cgi?id=80191 Clean WINEPREFIX Font Analysis - FL Studio Wine Bug #59252 -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=59252 --- Comment #18 from gng <nen24t@gmail.com> --- Created attachment 80192 --> http://bugs.winehq.org/attachment.cgi?id=80192 Screenshots showing the fix works -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla