私は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>
P.S.私は、同じフォントでタイ語を使ってWebページを開くと、この種の問題はないと言いたいと思います。
ここに詳細を追加する必要があります - どのSDKがあなたのアプリを構築するために使用していますどちらの機能もあなたが利用できる機能を大いに決定します。使用しようとしている機能(この場合は 'otf'風味のOpenTypeフォント)がプラットフォームによってサポートされているかどうかを確かめてくださいターゲットとしているSDKと、コードをコンパイルするために使用しているSDKです。 –
Androidバージョン4.4.4、Samsung Galaxy S4 compileSdkVersion 23 Android版4.4.4の別のデバイスでアプリをテストすると、この問題も発生しますか? –
と思われます。 4. *はまだotfのサポートには不完全なので、このフォントがどれほど適切であるかによって、Android 4を実行しているすべてのデバイスに問題が発生する可能性があります。* –