2015-04-01 67 views
0

我已经尝试过很多例子,并且它们都不是work.Here是我想要做的。我有一个PhoneGap的日食project.here是项目结构PhoneGap自定义语言设置

enter image description here

我要添加自定义的语言为我的项目。这里是我的MainActivity.java

import org.apache.cordova.DroidGap; 

import android.os.Bundle; 

public class MainActivity extends DroidGap { 


@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
     super.loadUrl("file:///android_asset/www/index.html"); 

} 
} 

这里是我的index.html

<!DOCTYPE html> 
<html> 
    <head> 
    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum- scale=1, minimum-scale=1, width=device-width;" /> 
    <title>Directory Reader</title> 
    <link rel="stylesheet" href="jquery/jquery.mobile-1.1.1.min.css" /> 
    <script src="jquery/jquery-1.8.0.min.js"></script> 
    <script src="jquery/jquery.mobile-1.1.1.min.js"></script> 
    <script type="text/javascript" src="cordova-2.0.0.js"></script> 

    <style type="text/css"> 
    @font-face { 
    font-family: MyCustomFont; 
    src: url("NotoSansSinhala-Regular.eot") /* EOT file for IE */ 
    } 
    @font-face { 
    font-family: MyCustomFont; 
    src: url("NotoSansSinhala-Regular.ttf") /* TTF file for CSS3 browsers */ 
    } 

    body { 
    font-family: MyCustomFont, Verdana, Arial, sans-serif; 
    font-size: medium; 
    color: black 
    } 
    </style> 


</head> 
<body> 

<p> test goda </p> 
</div> 
</body> 
</html> 

还是字体,我想显示没有显示在移动device.its显示英文字符“测试乡田”。任何想法如何解决这个问题?

+0

任何想法来解决这个指令。 – san88 2015-04-01 08:32:20

+0

是否确实在broswer上运行index.html? – KOTIOS 2015-04-01 09:05:27

+0

不..但我怎么知道当应用程序安装在设备上的index.html的位置..我试图通过在浏览器上提供index.html位置。但浏览器也显示英文characters.Not字体我想要显示。 – san88 2015-04-01 09:06:44

回答

1

你会基本上需要根上Android 4.4的安装僧伽罗语文字的设备,但它适用于Android 5.0以上版本

你会基本上需要以下步骤:

  1. 复制字体文件到/ system/fonts下
  2. 下载从fallback_fonts.xml文件/ etc
  3. 打开fallback_fonts.xml文件,并通过添加字体 名.Copy的文件恢复到/ etc目录下修改。
  4. 更改您的fallback_fonts.xml文件的字体 文件的权限和644或-rw-R-R-

普莱舍看到读取screenhots here