【问题标题】:Lao font render blank on android 4.3 ionic老挝字体在android 4.3 ionic上呈现空白
【发布时间】:2016-03-14 07:43:17
【问题描述】:

我的应用需要两种语言,包括老挝语和英语,我使用 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 设备中呈现老挝字体的解决方案。

【问题讨论】:

    标签: angularjs ionic-framework internationalization


    【解决方案1】:

    我已经找到了解决方案。在 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;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多