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

Document italic usage #7

Open
rdela opened this issue Jun 8, 2020 · 1 comment
Open

Document italic usage #7

rdela opened this issue Jun 8, 2020 · 1 comment

Comments

@rdela
Copy link

rdela commented Jun 8, 2020

It would be nice to document how italic usage works, if you point me in the right direction I will make a PR.

Example from gatsby-plugin-google-fonts

So does this plugin work the same way? If I also want the italic versions of the Google Fonts example in the docs, do I specify:

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-webfonts`,
      options: {
        fonts: {
          google: [
            {
              family: "Roboto",
              variants: ["300", "300i", "400", "400i", "500", "500i"],
            },
            {
              family: "Open Sans Condensed",
              variants: ["300", "300i", "700", "700i"],
            },
          ],
        },
      },
    },
  ],
};

?

@rdela
Copy link
Author

rdela commented Jun 11, 2020

Small update, the pattern above seems to work, however when I tried this:

{
  family: "Karla",
  variants: ["400", "400i", "700", "700i"],
},

All of the italic text in blocks of 400 weight text is 700 weight italic, even if I specify the font-weight on the em element to 400 in CSS. Omitting 700i fixes the problem for 400 weight text but if I also leave out 400i then all of the 400 weight text renders at 700/bold weight even though 400 is specified as the font-weight on the body element. So there may be more than one possibly overlapping issues where:

  1. one cannot use multiple weights of italic with a single font
  2. or multiple weights in passages with italics
  3. or this may be an issue specific to the Karla font and/or the generated CSS for Karla.

For now I am going with:

{
  family: "Karla",
  variants: ["400", "400i", "700"], // , "700i" - causes confusion
},

As even if I am getting faux bold italic (this is a link to the DDG results page for "webfont faux bold italic", see below for more direct links to articles from these results) it seems the best tradeoff under the circumstances. It may be I am getting some other combination of faux bold or faux italic, though to my eyes everything but bold italic looks correct when compared to the Karla specimen. In the bold italic I see the lack of spacing in the lowercase A that this Smashing article says suggests faux italic:

Because faux italic is created by slanting the original font at an angle, the spaces in the letters get condensed. This is a particular problem in the lowercase “a,” which continues to have two counterforms. Ironically, while faux italic letters feel more squished and are more difficult to read, they often take up more room, and fewer characters fit on a line.

More on faux bold/italic:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant