Forum Bugs

@font-face not respecting unicode-range when 'underspecified' (regression from Prince 15)

pieter.lamers
When testing with Prince 16 we saw fonts being substituted where we would not expect this. This occurred for bold and italic, where we had an override in place for the em-dash:
so we had
@font-face {
font-family: "Minion 3";
font-style:italic;
src: url("OurSpecialCharactersFont.otf");
unicode-range:U+2014;
}
which worked fine in Prince 15, substituting this single character. In Prince 16 it applies the font to *all* italics, but as it had no defined glyphs for regular characters it was itself substituted with a slanted Minion 3.

The solution was to add a specification for font-weight to the above. We saw the same with font-weight being specified without font-style.
pieter.lamers
actually there is also a problem the other way around, i.e. when font-style:normal and font-weight:normal *are* supplied the unicode-range seems also problematic. getting rid of both solves that problem:
@font-face {
font-family: "Minion 3";
src: url("notonaskharabic-regular.ttf");
unicode-range: U+0600-06FF, U+FB50-FDFF, U+FE70-FEFE;
}
works correctly, and
@font-face {
font-family: "Minion 3";
font-weight:normal;
font-style:normal;
src: url("http://bis/Prod$/sys/prince/fonts/notonaskharabic-regular.ttf");
unicode-range: U+0600-06FF, U+FB50-FDFF, U+FE70-FEFE;
}
would not return glyphs in Noto Sans but rather in Times where they are needed.
wezm
Hi Pieter,

I've had a go at reproducing the scenario described in your initial post, but so far the output seems to be as expected (only the em-dash is rendered in bold).

This is the test case I created:

<html>
<head>
<!-- Test for: https://www.princexml.com/forum/topic/5156/font-face-not-respecting-unicode-range-when-underspecified -->
<style>

@font-face {
    font-family: TestFont;
    src: url("../data/fonts/DejaVuSans-Oblique.ttf");
    font-style: italic;
}
@font-face {
    font-family: TestFont;
    font-style: italic;
    src: url("../data/fonts/DejaVuSans-Bold.ttf");
    unicode-range: U+2014;
}

body { font-family: TestFont }
</style>
</head>
<body>
<p>
  <!-- should use only use bold for the em-dash -->
  <em>unicode&mdash;range</em>
</p>
</body>
</html>


Are you able to modify this test case, or create one such that it reproduces the problem in your environment?
wezm
Actually we've got a test case that does seem to produce it now. I'll investigate:

<html>
<head>
<!-- Test for: https://www.princexml.com/forum/topic/5156/font-face-not-respecting-unicode-range-when-underspecified -->
<style>

@font-face {
    font-family: TestFont;
    src: url("../data/fonts/DejaVuSans-Oblique.ttf");
    font-style: italic;
    font-weight: normal;
}
@font-face {
    font-family: TestFont;
    font-style: italic;
    src: url("../data/fonts/DejaVuSans-Bold.ttf");
    unicode-range: U+2014;
}

body { font-family: TestFont }
</style>
</head>
<body>
<p>
  <!-- should use only use bold for the em-dash -->
  <em>unicode&mdash;range</em>
</p>
</body>
</html>