W3C home > Mailing lists > Public > public-css-archive@w3.org > March 2018

Re: [csswg-drafts] [css-fonts] Default angle for font-style:oblique should conform to host platform

From: jfkthame via GitHub <sysbot+gh@w3.org>
Date: Mon, 26 Mar 2018 17:46:50 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-376252376-1522086409-sysbot+gh@w3.org>
>> Current Firefox behavior -- which was designed to harmonize with host platform behavior -- uses an angle between 11.3deg and 16.7deg

> Could you clarify which angle is used on which platform?

Gecko implements synthetic-oblique using a "skew factor" defined in https://searchfox.org/mozilla-central/rev/003262ae12ce937950ffb8d3b0fa520d1cc38bff/gfx/thebes/gfxFont.h#61-69:
```
// The skew factor used for synthetic-italic [oblique] fonts;
// we use a platform-dependent value to harmonize with the platform's own APIs.
#ifdef XP_WIN
#define OBLIQUE_SKEW_FACTOR  0.3f
#elif defined(MOZ_WIDGET_GTK)
#define OBLIQUE_SKEW_FACTOR  0.2f
#else
#define OBLIQUE_SKEW_FACTOR  0.25f
#endif
```
where this "skew" is the tangent of the resulting oblique angle. So we have (approximately) 16.7° on Windows, 11.3° on Linux, and 14° on macOS.


-- 
GitHub Notification of comment by jfkthame
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2295#issuecomment-376252376 using your GitHub account
Received on Monday, 26 March 2018 17:46:53 UTC

This archive was generated by hypermail 2.3.1 : Monday, 26 March 2018 17:46:53 UTC