FontFamily不适用于从Google字体导入的阿拉伯文字

时间:2018-06-23 13:13:28

标签: android fonts textview

因此,我尝试了在fonts.google.com上找到并通过android studio添加的多种阿拉伯字体,但这些字体对我的应用程序中的文本视图没有任何影响。另一方面,英文字体可以正常工作。我还尝试从一个也不起作用的文件中导入自己的字体。有什么想法吗?

enter image description here

用于阿拉伯语文本视图的XML

    <TextView
    android:id="@+id/card_title"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:fontFamily="@font/cairo_bold"
    android:padding="15dp"
    android:textColor="@android:color/black"
    android:textDirection="rtl"
    android:textSize="26sp"
    android:textStyle="bold" />

至于英语文本查看

    <TextView
    android:id="@+id/title"
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_marginLeft="10dp"
    android:layout_weight="1"
    android:fontFamily="@font/quicksand"
    android:gravity="center_vertical"
    android:text="@string/player_header"
    android:textColor="@color/white"
    android:textSize="14sp" />

0 个答案:

没有答案