Help us understand the problem. What is going on with this article?

font-familyのgeneric font familyがiOSやAndroidで日本語フォントに効かない

More than 3 years have passed since last update.

こんなコンテンツ

<head>
  <style>
  .sansserif {
    font-family: sans-serif;
  }
  .serif {
    font-family: serif;
  }
  .cursive {
    font-family: cursive;
  }
  .fantasy {
    font-family: fantasy;
  }
  .monospace {
    font-family: monospace;
  }
  </style>
</head>
<body>
  <p><span class="sansserif">sans-serif<span/> <span class="sansserif">ゴシック体</span></p>
  <p><span class="serif">serif<span/> <span class="serif">明朝体</span></p>
  <p><span class="cursive">cursive<span/> <span class="cursive">筆記体</span></p>
  <p><span class="fantasy">fantasy<span/> <span class="fantasy">装飾体</span></p>
  <p><span class="monospace">monospace<span/>  <span class="monospace">等幅フォント</span></p>
</body>

で描画結果

font.png

左がPCのGoogle Chrome(version48) 右が iOS9.1(シュミレータ)のWebView

iOSのWebViewは日本語が等幅フォント以外はすべてゴシック体のフォントになってしまっている。
AndroidのWebView(Android5.0/Nexus9)も同様。

generic font familyが効かないと
明朝体(serif)で描画してほしいのに、ゴシック体などの意図しないフォントで描画されてしまう。。。

解決方法はないだろうか。

sassy_watson
Androidアプリやフロントエンドのエンジニア。
http://sassy.github.io/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした