You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
fnmetrics(&self) -> FontMetrics{//....// This is the "fix"let fixed_line_gap = match dm.lineGap{0 => au_from_em(1asf64),
x => au_from_du(dm.lineGapasi32),};//..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
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.
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).
@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..."
Activity
codec-abc commentedon Mar 13, 2017
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
in components/gfx/platform/windows/font.rs (specifically the fn metrics(&self) -> FontMetrics function) I have this result

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.
sophiajt commentedon Mar 13, 2017
@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.
codec-abc commentedon Mar 13, 2017
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).
sophiajt commentedon Mar 13, 2017
@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..."
Auto merge of #16034 - jonathandturner:fix_font, r=metajack
servo: Merge #16034 - Fix Windows UI and font squishing (from jonatha…
servo: Merge #16034 - Fix Windows UI and font squishing (from jonatha…
servo: Merge #16034 - Fix Windows UI and font squishing (from jonatha…
servo: Merge #16034 - Fix Windows UI and font squishing (from jonatha…
servo: Merge #16034 - Fix Windows UI and font squishing (from jonatha…