Skip to content

improvements to the font preview #840

@Pomax

Description

@Pomax

It looks like right now the font previewer mixes up the italic/bold instructions,

screenshot 221

Also these instructions don't match what CSS does: if an @font-face rule is declared with an explicit font-style or font-weight then the bound resource for that rule will only be used there. Rather than using the font "in faux italic" or "in faux bold" mode, instead CSS will apply "the font you indicated" whenever it sees italic or bold, so this:

@font-face {
  font-family: myfont;
  src: url("myfont-regular.woff") format("WOFF");
  font-weight: bold;
}

paired with this:

<p style="font-family: myfont; font-weight:bold">This is bold</p>

will not style as bold text at all. It will instead go "I see tuple {family:myfont, weight:bold} and I have been told that this means I need to use the resource myfont-regular.woff to style that", and then it does. This paragraph will be regular text.

Additionally, the font previewer does not put the format("...") indicator in the CSS for loading the font, which can lead to a font not actually being loaded.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions