我正在使用Montserrat-Bold.otf字體在我的應用程序中是泰語。有些設備上的字符部分可見。我的意思是一些字符的頂部不可見(如剪切)。請參閱圖片。隨機設備上的字體不同
而且Java代碼
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
((TextView) findViewById(R.id.tv)).setTypeface(Typeface.createFromAsset(getAssets(),
"Montserrat-Bold.otf"));
}
和XML
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.example.hayk.temp.MainActivity">
<TextView
android:id="@+id/tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="รายการนี้ถูกแลกแล้ว"
android:layout_centerInParent="true"
android:textSize="30sp"/>
</RelativeLayout>
附:我想提一下,當我用相同的字體打開帶有泰文單詞的網頁時,我沒有這種問題。
你需要在這裏添加更多的信息 - 哪些版本的Android,你看到這個,你用哪個SDK來建立你的應用程序等等。這兩者都很大程度上決定了您可以使用哪些功能,並且您應該查看平臺是否支持您嘗試使用的功能(本例中爲'otf' flavored OpenType字體)「你的目標,以及你用來編譯你的代碼的SDK。 –
Android版本是4.4.4,三星Galaxy S4 compileSdkVersion 23 你的意思是如果我將在Android 4.4.4版本的其他設備上測試應用程序,我也會遇到這個問題嗎? –
似乎很有可能。 4. *在支持'otf'時仍然沒有完成,所以根據這個字體的「正確」,這可能會導致運行Android 4的任何設備出現問題。* –