本文介绍了Android上的CSS字体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用 @ font-face
在网站上显示League Gothic,但它不会显示在Android 1.6上。这是我的代码,生成与
@ font-face {
font-family:'LeagueGothicRegular';
src:url('/ fonts / League_Gothic-webfont.eot');
src:local('☺'),url('/ fonts / League_Gothic-webfont.woff')format('woff'),url('/ fonts / League_Gothic-webfont.ttf')format('truetype '),url('/ fonts / League_Gothic-webfont.svg#webfont')format('svg');
font-weight:normal;
font-style:normal;
}
font-family:'LeagueGothicRegular',Impact,Charcoal,sans-serif;
如果 @ font-face
不支持(我读到 @ font-face
支持在Android 2中完全失效)。但是哥特式联赛相当精简,所以我想为Android指定一个比默认sans-serif更好的后备字体,所以设计不会完全破坏。
像这样是完美的:
但我找不到Android的默认字体的明确列表,
编辑
到目前为止的答案都错过了这一点问题不好) - 我后面是一个系统字体的列表与Android。某些 for Android。
$ b
Clockopia.ttf DroidSans-Bold.ttf DroidSans.ttf DroidSansArabic .ttf DroidSansFallback.ttf DroidSansHebrew.ttf DroidSansMono.ttf DroidSansThai.ttf DroidSerif-Bold.ttf DroidSerif-BoldItalic.ttf DroidSerif-Italic.ttf DroidSerif-Regular.ttf I'm using @font-face
to display League Gothic on a website, but it's not showing up on Android 1.6. Here's my code, generated with Font Squirrel's @font-face generator
@font-face {
font-family: 'LeagueGothicRegular';
src: url('/fonts/League_Gothic-webfont.eot');
src: local('☺'), url('/fonts/League_Gothic-webfont.woff') format('woff'), url('/fonts/League_Gothic-webfont.ttf') format('truetype'), url('/fonts/League_Gothic-webfont.svg#webfont') format('svg');
font-weight: normal;
font-style: normal;
}
font-family:'LeagueGothicRegular',Impact,Charcoal,sans-serif;
It's not a big deal if @font-face
isn't supported (I read that @font-face
support is gone completely in Android 2). But League Gothic is quite condensed, so I would like to specify a better fallback font for Android than the default sans-serif so the design doesn't completely break.
Something like this would be perfect:http://www.droidfonts.com/info/droid-sans-condensed-fonts/
But I can't find a definitive list of the default fonts that come with Android, and the name I should use to reference them in CSS.
EDITThe answers so far missed the point (or I worded the question badly) - what I'm after is a list of system fonts that ship with Android. Something like this for Android.
解决方案
The fonts that I see installed in my Android (2.2) system files are:
- Clockopia.ttf
- DroidSans-Bold.ttf
- DroidSans.ttf
- DroidSansArabic.ttf
- DroidSansFallback.ttf
- DroidSansHebrew.ttf
- DroidSansMono.ttf
- DroidSansThai.ttf
- DroidSerif-Bold.ttf
- DroidSerif-BoldItalic.ttf
- DroidSerif-Italic.ttf
- DroidSerif-Regular.ttf
这篇关于Android上的CSS字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!