Is there anyway to make different font for each language? There is the values-en, values-fr ...etc, but can we do something like font-fr, font-ar ...etc?
PS, i'm talking about res/font, not about assets/fonts, i would like to be able to set one font in XML, and then get the changes with each language, without setting the Typeface programmatically.
Taking its name from its goal to see 'no more tofu', Google Noto is a font which aims to 'support all languages with a harmonious look and feel'. The core Noto Sans font supports up to 582 languages across 237 regions, and even comes in 72 styles.
Open Settings. Tap Display. Tap Font and screen zoom. Select your choice of Font Style and you're done.
Roboto supports Latin, Greek (partial) and Cyrillic scripts. On Android, the Noto font is used for languages not supported by Roboto, including Chinese (simplified and traditional), Japanese, Korean, Thai and Hindi.
Try this:
res/font
style.xml
(create values/style.xml
&& values-ln/style.xml
)AppTheme
for every style.xml
add
<item name="android:fontFamily">@font/your_desired_font</item>
if you have more than one font for a language (let's say regular, bold, light, etc.) then add it to each style.xml, example:
<style name="FontLocalizedBold">
<item name="android:fontFamily">@font/your_desired_font</item>
</style>
usage:
<TextView
android:id="@+id/textViewId"
android:layout_width="100dp"
android:layout_height="100dp"
style="@style/FontLocalizedBold"
android:gravity="center"
tools:text="XX"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With