0

Maybe it is not supposed to. But bear with me. I am using Google Web Fonts, and I am including PT Sans font like so:

<link href="https://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">

and I even have .htaccess set like so:

<IfModule mod_headers.c>
  <FilesMatch "\.woff$">
    Header set Content-Type "application/octet-stream"
  </FilesMatch>

  <FilesMatch "\.ttf$">
    Header set Content-Type application/octet-stream
  </FilesMatch>
</IfModule>

Now PT Sans font does not include Baltic (ąčęėįšųūž) characters, which I am using. But Chrome, Firefox, IE render them all perfectly - not even using another font. Opera just skips them and leaves an empty space.

Just realized that it only does it with bold fonts. Check this example:

<!doctype html>
<html lang="en" class="no-js">
  <head>
    <title>Font test</title>
    <meta charset="UTF-8">
    <link href="https://fonts.googleapis.com/css?family=PT+Sans:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css">
  </head>

  <body style="font-family:'PT Sans';">
    aceeisuuz<br />
    ąčęėįšųūž
    <p style="font-weight:bold">ąčęėįšųūž</p>
  </body>
</html>

Now how do I fix it?

donk
  • 1,540
  • 4
  • 23
  • 46

3 Answers3

0

I've encountered same problem.

solution was:

  1. Google Web Fonts page | Chose your cirilic Font | Quick usage | Verify your settings... -> add Cyrilic set to selection.

  2. Clear Opera cache;

grigson
  • 3,458
  • 29
  • 20
0

Looks alright to me, I just threw your example code into a jsfiddle. Maybe there's something else going on with your CSS/page?

http://jsfiddle.net/MetalFrog/gHhGv/

screenshot of jsfiddle

MetalFrog
  • 9,943
  • 1
  • 22
  • 24
  • It doesn't show for me through jsfiddle. Exactly the same Opera build. The bold string is not rendered. What the hell is going on? – donk Mar 19 '12 at 14:16
  • I cleared opera cache and reloaded your jsfiddle example. The bold string appeared for a second while the page was loading and then disappeared. – donk Mar 19 '12 at 14:19
  • Very funky. HRM. I always despise when I come across things that appear random. There's got to be a root cause for this, how do we narrow it down? – MetalFrog Mar 19 '12 at 14:42
  • In Opera 11.61 on Linux (Debian KDE) it displays perfectly. – Mr Lister Mar 19 '12 at 18:00
0

Since the PT Sans font does not contain the Baltic characters, browsers will use some fallback fonts. In the absence of declarations for this in the page style sheet, they will use their default methods, so browser differences are to be expected.

It is not clear why Opera sometimes fails here, but it is more important to provide some planned fallback. Either select a completely different font, or at least specify some alternate fonts in your font list, e.g. font-family: 'PT Sans', Arial, sans-serif. This prevents odd mixtures, like PT Sans and Times New Roman (the common default font) and may well circumvent the Opera bug too.

Jukka K. Korpela
  • 195,524
  • 37
  • 270
  • 390
  • In my actual project, font-family is defined exactly as you've shown. Baltic characters still don't appear, when they're bold. – donk Mar 19 '12 at 19:30
  • @donkapone, if you provide the URL of the actual page, we could check what it looks like on other people’s browsers—it could be an installation-specific problem. – Jukka K. Korpela Mar 19 '12 at 21:01
  • MetalFrog has provided an example link here http://jsfiddle.net/MetalFrog/gHhGv/ where I cannot see the bold string. – donk Mar 20 '12 at 10:32
  • @donkapone, on my Opera 11.61, build 1250, Windows 7, the bold string is visible, in a serif font. What’s more surprising is that if I modify the `font-family` value to `'PT Sans', Arial, sans-serif`, then Opera still renders it in a serif font. My primary practical advice stands: find a font that covers all the characters you need. – Jukka K. Korpela Mar 20 '12 at 10:51