Skip to content

Windows Servo renders reddit text squished  #15698

Closed

Description

@sophiajt

As of #15681, the Windows build can now render reddit again (along with some other sites on the showcase that were failing). Yay!

There seems to be an issue rendering reddit with the current master, which displays reddit text like this:

reddit_with_patch

Activity

  1. added
    P-windows
    on Feb 23, 2017
  2. codec-abc commented on Mar 13, 2017

    @codec-abc

    I think I made some progress. The default font on Windows have a line gap of 0 which seems to be rather suspicious (at least to me). If I put this code

    fn metrics(&self) -> FontMetrics {
        //....
    
        // This is the "fix"
        let fixed_line_gap = match dm.lineGap {
                    0 => au_from_em(1 as f64),
                    x => au_from_du(dm.lineGap as i32),
                };
    
        //..
        let metrics = FontMetrics {
            //...
            line_gap:         fixed_line_gap,
        };
        debug!("Font metrics (@{} pt): {:?}", self.em_size * 12., metrics);
        metrics
    }

    in components/gfx/platform/windows/font.rs (specifically the fn metrics(&self) -> FontMetrics function) I have this result
    good_rendering

    Since I have zero experience with Servo and Web technologies I leave up to you to judge if this the underlying problem and the appropriate fix.

    PS : Sorry for the previous post.

  3. sophiajt commented on Mar 13, 2017

    @sophiajt
    Author

    @codec-abc - that looks a lot better. Want to send a PR? If there's a better fix, the reviewers might know, but at least it gets reddit working again.

  4. codec-abc commented on Mar 13, 2017

    @codec-abc

    After more thinking I am quite sure that my changes fix the effect and not the cause. I think the issue is that the lineGap value should be read while parsing the font file but ended at 0 for some not yet understood reason. So maybe it is better to get the opinion of people that know this stuff better than me before sending a PR. (Note that I don't mind sending a PR, it just seem not necessary in this case).

  5. sophiajt commented on Mar 13, 2017

    @sophiajt
    Author

    @codec-abc - right. that's why I was thinking a PR would help get the discussion going with a reviewer. It gives them something to look at and go "wait a sec, I think the actual issue is..."

  6. added a commit that references this issue on Mar 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-platform/fontsP-windows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions