老挝字体在 android 4.3 ionic 上呈现空白
Lao font render blank on android 4.3 ionic
我的应用程序需要两种语言,包括老挝语和英语,我使用 i18n 进行本地化。我已经为老挝语定制了字体系列样式如下:
@font-face {
font-family: 'customfont';
src: url('../lib/ionic/fonts/phetsarath.ttf') format("truetype");
}
body {
font-family: 'customfont';
font-size:30px;
}
它适用于 chrome 但不适用于 android 设备 (Nexus 3) 版本 4.3。能够在 android 设备中呈现老挝字体的任何解决方案。
我想出了解决办法。在 android 4.3 中工作的最佳字体格式是 svg。
@font-face {
font-family: 'phetsarath_otecorner';
src: url('font/phetsarath_ot.svg');
src: url('font/phetsarath_ot.svg#phetsarath_otregular') format('svg'),
url('font/phetsarath_ot.woff') format('woff'),
url('font/phetsarath_ot.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
并按如下方式应用字体系列。
body, .ionic-body {
font-family: 'phetsarath_otecorner', sans-serif;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: 'phetsarath_otecorner', sans-serif;
}
.tab-item {
font-family: 'phetsarath_otecorner', sans-serif;
}
input, button, select, textarea {
font-family: 'phetsarath_otecorner', sans-serif;
}
.roboto {
font-family: 'phetsarath_otecorner', sans-serif;
}
.roboto input {
font-family: 'phetsarath_otecorner', sans-serif;
}
我的应用程序需要两种语言,包括老挝语和英语,我使用 i18n 进行本地化。我已经为老挝语定制了字体系列样式如下:
@font-face {
font-family: 'customfont';
src: url('../lib/ionic/fonts/phetsarath.ttf') format("truetype");
}
body {
font-family: 'customfont';
font-size:30px;
}
它适用于 chrome 但不适用于 android 设备 (Nexus 3) 版本 4.3。能够在 android 设备中呈现老挝字体的任何解决方案。
我想出了解决办法。在 android 4.3 中工作的最佳字体格式是 svg。
@font-face {
font-family: 'phetsarath_otecorner';
src: url('font/phetsarath_ot.svg');
src: url('font/phetsarath_ot.svg#phetsarath_otregular') format('svg'),
url('font/phetsarath_ot.woff') format('woff'),
url('font/phetsarath_ot.eot?#iefix') format('embedded-opentype');
font-weight: normal;
font-style: normal;
}
并按如下方式应用字体系列。
body, .ionic-body {
font-family: 'phetsarath_otecorner', sans-serif;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
font-family: 'phetsarath_otecorner', sans-serif;
}
.tab-item {
font-family: 'phetsarath_otecorner', sans-serif;
}
input, button, select, textarea {
font-family: 'phetsarath_otecorner', sans-serif;
}
.roboto {
font-family: 'phetsarath_otecorner', sans-serif;
}
.roboto input {
font-family: 'phetsarath_otecorner', sans-serif;
}