gpt4 book ai didi

英文单词之间的安卓泰米尔字体

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:42:05 25 4
gpt4 key购买 nike

我有一个 TextView,中间有一个巨大的文本,我有一个泰米尔语单词,我知道如何在单独的 TextView 中嵌入泰米尔语字体。但我需要英语单词之间的泰米尔语单词,请提前帮助谢谢

我在 TextView 中的部分文本:

Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's

最佳答案

尝试设置这个 Akshar.ttf通过 setTypeface 将字体添加到您的 TextView,它支持英语和泰米尔语。


结果如下:

enter image description here

或者,寻找支持两种语言的类似字体。


您的第二个解决方案是使用 SpannableStringBuilder 为这个小的泰米尔语文本部分使用图像。


为TextView设置自定义字体的代码:

假设您在 assets 文件夹下的 fonts 文件夹中有 Akshar.ttf 字体:

 Typeface tf = Typeface.createFromAsset(getAssets(), "fonts/Akshar.ttf");               
TextView tv = (TextView) findViewById(R.id.CustomFontText);
tv.setTypeface(tf);
tv.setText("Seasonal messages like welcome (நல்வரவு) is used in Kolam. Volunteering to draw kolam at temple is sometimes done when a devotee's");

关于英文单词之间的安卓泰米尔字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10635516/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com