Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#15751 closed bug (fixed)

Font fallback wrong for non-regular font variant (noto sans display)

Reported by: nephele Owned by: axeld
Priority: normal Milestone: R1/beta2
Component: Servers/app_server Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Reproduce: copy 'noの' into Font Demo

Switch between noto sans display regular and noto sans display bold (or any non-regular variant) The の char will disapear from the rendered text if it's not set to regular

Not quite sure if this problem is related to only this specific font or not, other noto sans variants don't display の even with the regular variant.

Change History (5)

comment:1 by nephele, 5 years ago

I have a fix that fixes this assuming the fallback font has the variant requested too (bold etc)

Unsure of how to handle if the font doesn't have that though, the error case seems to be that it doesn't render at all if the variant is different (maybe switch it to a assumed same variant in another part of the stack, but i am a bit lost there)

i.e noto cjk has no "extrabold" variant

comment:2 by nephele, 5 years ago

diff --git a/src/servers/app/font/GlyphLayoutEngine.h b/src/servers/app/font/GlyphLayoutEngine.h
index 71d026cb3e..e488eb9604 100644
--- a/src/servers/app/font/GlyphLayoutEngine.h
+++ b/src/servers/app/font/GlyphLayoutEngine.h
@@ -335,8 +335,9 @@ GlyphLayoutEngine::_WriteLockAndAcquireFallbackEntry(
        // Try to get the glyph from the fallback fonts
        while (fallbacks[i] != NULL) {
                if (gFontManager->Lock()) {
-                       FontStyle* fallbackStyle = gFontManager->GetStyleByIndex(
-                               fallbacks[i], 0);
+                       FontStyle* fallbackStyle = gFontManager->GetStyle(
+                               fallbacks[i], font.Style());
+
                        if (fallbackStyle != NULL) {
                                ServerFont fallbackFont(*fallbackStyle, font.Size());
                                gFontManager->Unlock();

Version 1, edited 5 years ago by nephele (previous) (next) (diff)

comment:3 by nephele, 5 years ago

This patch should atleast fix the default window decorator text to display symbols and cjk text. It does not affect applications/Terminal, there the fallback is still broken for all variants of all fonts i tested, might be a different issue.

edit: as pulkomandy noted on irc, the monospace fonts aren't guranteed to have consistent glyph sizes between each other, so that would heva to be adressed too for font fallbacks there

Last edited 5 years ago by nephele (previous) (diff)

comment:4 by waddlesplash, 5 years ago

Resolution: fixed
Status: newclosed

Patch merged in hrev53928. Thanks!

comment:5 by nielx, 5 years ago

Milestone: UnscheduledR1/beta2

Assign tickets with status=closed and resolution=fixed within the R1/beta2 development window to the R1/beta2 Milestone

Note: See TracTickets for help on using tickets.