Opened 4 years ago

Closed 3 years ago

#16212 closed bug (fixed)

Some Japanese text style missing in Webpositive

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

Description

Since hrev54299, some Japanese text style is missing in Webpositive.

Related: ticket#16189

To reproduce:

  1. Set Japanese fonts in Apparence.
  2. Set Japanese fonts in Webpositive settings.
  3. Open Japanese version of "Welcome to Haiku!" (or Quick tour, Userguide) in Webpositive.

Attachments (4)

hrev54299.png (195.7 KB ) - added by mt 4 years ago.
Webpositive opening Japanese version of "Welcome to Haiku!" in hrev54299.
hrev54302+patch.png (195.0 KB ) - added by mt 4 years ago.
Webpositive opening Japanese version of "Welcome to Haiku!" in hrev54302 + patch.
0003-Fontfallback-Add-Bold-style-check.patch (1.0 KB ) - added by mt 4 years ago.
0002-Fontfallback-Add-Bold-style-check.patch (2.7 KB ) - added by mt 4 years ago.
Patch 2

Download all attachments as: .zip

Change History (20)

by mt, 4 years ago

Attachment: hrev54299.png added

Webpositive opening Japanese version of "Welcome to Haiku!" in hrev54299.

comment:1 by nephele, 4 years ago

I'm working on this, underlying issue is that noto sans bold fallback does not fall back to the correct style and instead falls back to style 0, which appears to be noto sans cjk thin in this case

in reply to:  2 comment:3 by mt, 4 years ago

Replying to bitigchi:

https://review.haiku-os.org/c/haiku/+/2887

Thanks for patch, it looks better.

by mt, 4 years ago

Attachment: hrev54302+patch.png added

Webpositive opening Japanese version of "Welcome to Haiku!" in hrev54302 + patch.

comment:4 by nephele, 4 years ago

The patch makes it fall back to Noto Sans CJK Regular instead of Noto Sans CJK Thin now, it's not the complete solution though, ideally it should fall back to Noto Sans CJK Bold instead :)

comment:5 by mt, 4 years ago

I try to add bold check...

comment:6 by nephele, 4 years ago

fontStyle = font.Style(); is the iteration that should set bold already if bold is set before, you can see that the fallback works for Noto Sans Display Bold in stylededit for example, does your patch make it work for Noto Sans Bold? (there would be other styles to check aswell)

comment:7 by nephele, 4 years ago

Looks like this patch makes bold -> bold and bold italic -> bold work

Version 0, edited 4 years ago by nephele (next)

comment:8 by waddlesplash, 4 years ago

The "face" flag can be passed through to the fallback glyph selector, I believe, and perhaps this should be done as part of iterating.

comment:9 by nephele, 4 years ago

It looks like face and Style serve a similar purpose, what is the difference between them? I suppose we should use one or the other

in reply to:  6 comment:10 by mt, 4 years ago

Replying to nephele:

fontStyle = font.Style(); is the iteration that should set bold already if bold is set before, you can see that the fallback works for Noto Sans Display Bold in stylededit for example, does your patch make it work for Noto Sans Bold? (there would be other styles to check aswell)

I think we need check what font.Style() returns. If font.Style() returns simply "Bold", we could fallback "Noto Sans CJK JP Bold" already.

in reply to:  7 comment:11 by mt, 4 years ago

Replying to nephele:

Looks like this patch makes bold -> bold and bold italic -> bold work

edit: that patch as is would also set bold as style unconditionally if bold italic is present for fonts that do have bold italic so it's not a perfect solution

Fallback fonts Noto Sans Thai, CJK JP, and Symbol don't have "Italic". So I think we check "Bold" first, but for "Noto Sans display" fallback, we check "Bold Italic" first...

comment:12 by nephele, 4 years ago

I think we need check what font.Style() returns. If font.Style() returns simply "Bold", we could fallback "Noto Sans CJK JP Bold" already.

This already happens, I am just not sure why it does not work if it falls back from Noto sans bold as opposed to noto sans display bold (It might be a simple problem, but i have been really unsucsesfull to get debug output from thsi part of the code :/)

Fallback fonts Noto Sans Thai, CJK JP, and Symbol don't have "Italic". So I think we check "Bold" first, but for "Noto Sans display" fallback, we check "Bold Italic" first...

Problem is that this code should later use any user installed fonts to fallback to aswell, and we can't make many assumptions about which styles are available or not

I think the best way is to

  1. match style
  2. match style, strip italic part of style
  3. try "Regular" style
  4. try any style

the code currently does 1. and 4., with 1. not working correctly always (and 3. beeing the patch on gerrit)

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

comment:13 by mt, 4 years ago

I add Italic and Bold Italic support and stripping Italic from Noto Sans Thai, CJK JP, and Symbol.

comment:14 by nephele, 4 years ago

This does work on haiku master somewhat, fallback is broken for thin italic though, and likely other *thin variants aswell, surely there is a better aproach to strip italic that does not require a hardcoded has italics list?

I should investiage more whether i can't get noto sans bold to fallback normally in the first iteration :)

comment:15 by mt, 3 years ago

Fixed in hrev54747, thanks!!

comment:16 by diver, 3 years ago

Milestone: UnscheduledR1/beta3
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.