Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sans-serif font makes list item bullet render incorrectly #17321

Closed
duckinator opened this issue Jun 14, 2017 · 6 comments
Closed

sans-serif font makes list item bullet render incorrectly #17321

duckinator opened this issue Jun 14, 2017 · 6 comments

Comments

@duckinator
Copy link
Contributor

@duckinator duckinator commented Jun 14, 2017

List item fonts show up as font fallback box glyphs if you set the font family to sans-serif.

screenshot_2017-06-14_09-06-18

<!DOCTYPE html>
<style>
  li { font-family: sans-serif; }
</style>

<ul>
  <li>beep boop</li>
</ul>

Changing to font-family: sans-serif, serif; makes it work.

screenshot_2017-06-14_09-17-24

@duckinator
Copy link
Contributor Author

@duckinator duckinator commented Jun 14, 2017

Possibly related to #17267 and #10045, but I'm not sure.

fc-match output, since it seems potentially-relevant:

$ fc-match serif     
DejaVuSerif.ttf: "DejaVu Serif" "Book"
$ fc-match sans-serif
DejaVuSans.ttf: "DejaVu Sans" "Book"
@duckinator
Copy link
Contributor Author

@duckinator duckinator commented Jun 15, 2017

Here's a screenshot of that snippet:

screenshot_2017-06-15_19-22-26

@duckinator
Copy link
Contributor Author

@duckinator duckinator commented Jun 15, 2017

And yes, this is on Linux (specifically Manjaro Linux, which is based on ArchLinux).

@jonleighton
Copy link
Contributor

@jonleighton jonleighton commented Feb 1, 2018

I came across this issue too, and will try to come up with a fix.

It appears than on Linux, when you use sans-serif, Servo will choose the ExtraLight variant of DejaVu Sans, rather than the Book variant. This happens because Servo's code doesn't set the weight of the ExtraLight variant correctly (it sets it to normal = 400). The code which then chooses a variant sees the ExtraLight one first, deems it sufficient, and so goes with that. The ExtraLight variant doesn't seem to contain the bullet character, hence why it gets rendered as a square. Perhaps there are actually two issues really:

  1. The wrong variant gets chosen.
  2. If the chosen variant doesn't contain a certain character, maybe we should fall back to a variant which does, in order to render that one character.
@jonleighton
Copy link
Contributor

@jonleighton jonleighton commented Feb 1, 2018

Related: #190

jonleighton added a commit to jonleighton/servo that referenced this issue Feb 1, 2018
Issue servo#17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There
were two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.
jonleighton added a commit to jonleighton/servo that referenced this issue Feb 4, 2018
Issue servo#17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There
were two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.
jonleighton added a commit to jonleighton/servo that referenced this issue Feb 4, 2018
Issue servo#17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There
were two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.
jonleighton added a commit to jonleighton/servo that referenced this issue Feb 5, 2018
Issue servo#17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There
were two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.
bors-servo added a commit that referenced this issue Feb 6, 2018
Fix FontTemplateDescriptor under FreeType

Issue #17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There were
two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19928)
<!-- Reviewable:end -->
jonleighton added a commit to jonleighton/servo that referenced this issue Feb 7, 2018
Issue servo#17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There
were two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.
bors-servo added a commit that referenced this issue Feb 7, 2018
Fix FontTemplateDescriptor under FreeType

Issue #17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There were
two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19928)
<!-- Reviewable:end -->
jonleighton added a commit to jonleighton/servo that referenced this issue Feb 7, 2018
Issue servo#17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There
were two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.
bors-servo added a commit that referenced this issue Feb 8, 2018
Fix FontTemplateDescriptor under FreeType

Issue #17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There were
two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19928)
<!-- Reviewable:end -->
bors-servo added a commit that referenced this issue Feb 8, 2018
Fix FontTemplateDescriptor under FreeType

Issue #17321. Under Linux, using "font-family: sans-serif" previously
caused Servo to select the "UltraLight" face (of DejaVu Sans). There were
two reasons for this:

1. Font weight was only retrieved from the OS/2 table for bold faces.
   This neglected to retrieve the weight information for "lighter than
   normal" weight faces. This meant that the UltraLight face appeared as
   normal weight, and was selected.

2. Retrieval of font stretch information from the OS/2 table was not
   implemented at all.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19928)
<!-- Reviewable:end -->
@duckinator
Copy link
Contributor Author

@duckinator duckinator commented Oct 25, 2019

This appears to be fixed. 👍

@duckinator duckinator closed this Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.