I don't know how to use some Roboto character in my Textview.
I tried to copy paste character from the character table to eclipse (Roboto is also in my ubuntu), it works for some one but for all...
The greek 'k' works, but the greek 'h' do not print anything, ..
What is the good way to use all special characters in an android project please?
You probably need to use the unicode values of those characters vs copying pasting them from somewhere...
E.g:
Get the unicode value of a character (using LibreOffice for example), and use that in your strings.xml with the '\u' prefix:
<string name="special_characters">\u03bb \u03ba \u03bc \u03be - special greek characters</string>
See my screenshot (using Roboto-Black.ttf)
Related
I would like to show a small italic i (math symbol) in Kotlin using Android Studio. I see it has a value in Unicode-32, but that is not the character set that is the base for Kotlin in Android. Based on what I can determine, the base unicode is UTF-16 (hex), since that is what I used to define the other unicode characters I use. See https://unicode-table.com/en/.
For example, I use \u221A for the square root sign. However, there is apparently no small italic i in the same character set. Is there a way to generate the small italic i using Unicode 32 without having to redefine all the other unicode characters I use? Thanks in advance for your help.
Strings in Kotlin (and Java) are specified in 16-bit characters, therefore you can't include a 32-bit Unicode character inside a string literal.
You can, however, break your character into two 16-bit code points called a surrogate pair, like so:
\uD835\uDC56
The project I worked on has some rare characters that are not supported by Unicode
"private-use area" (PUA) code points in the range U+EE80 through U+EFF. One custom open type font range from U+0000 to U+FFFF and the other has characters beyond U+FFFF. Both fonts are in the same language.
I need to display the characters based on their PUA range(characters are retrieved from database in random lines, no fixed location for a particular character). I tried different solutions but none of them works(bidi class with typeface, composite fonts, merging fonts, fallback, etc).
Has somebody used custom fonts that can display different font based on their range of PUA code points(character by character) on Android?
If you are using java to develop your android app, java only support unicode system so you cannot use characters beyond unicode system.
I am developing an android and ios app which will be translated in multiple languages including english, hindi and gurmukhi. We have some pdf files in Gurmukhi that use ASCII fonts instead of unicode and we need to translate them to other languages so that when we try to copy the text we end up with some weird text. Is there a way to do it?
Thanks in advance.
Every symbol font has its own repertoire, so you need a custom lookup table from the ‘wrong’ character to the real character corresponding to what the glyph looks like in the particular font you are using. You can work out this table by installing the font in question and opening it in the Character Map (charmap.exe), noting down which symbol appears in each of the boxes normally occupied by A, B, C...
There is a converter tool here which knows about some common symbol fonts. If the font you want is in that list, you could try to extract the lookup table by pasting in all the characters in the range 32–126;128–255 (!"#$%&'()*+,-./0123456789:;<=>?#ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_``abcdefghijklmnopqrstuvwxyz{|}~¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ) and grabbing what comes out when converted to ‘Unicode’.
Do you need to do the conversion in the application itself? If so you will typically need to write a character-by-character lookup loop. If not, best to use a tool like this manually to convert the material you want into standard Unicode, because dealing with text encoded in arbitrary symbol fonts is a pain in the neck.
I would like to display special characters such as: ṁ ṭ m ē. In case they don't display here as well, this is how the four characters should look like:
In Android, these will display in squares. For other scripts, I am able to come over this problem with using a different font. But in this case setting the font (TextView.setTypeFace) will not solve this issue. These characters display correctly in for example OpenOffice (using Arial or Courier New), but inside Android it doesn't even when using the same fonts).
I also tried having the string saved as a unicode encoded string (e.g. in strings.xml: \u1E41 \u1E6D) getting the same result (in the logs they appear as they should). Any ideas?
If these characters are representable in Unicode, then you should be able to use Html.fromHtml() to get the glyph into a TextView, e.g.
textView.setText(Html.fromHtml("Ӓ"), TextView.BufferType.SPANNABLE);
It was really only a font issue. It was just hard to find a font that supports all characters I need.
Seeing that Google Translate has no problems with transliteration characters motivated me to make a more thorough search for fonts. Below is a list of useful fonts for this purpose:
http://guindo.pntic.mec.es/jmag0042/alphaeng.html (extensive but non-free)
http://users.teilar.gr/~g1951d/
http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=FontDownloads
http://www.mufi.info/fonts/
I am attempting to make a Korean version of my app using eclipse. If I cut and paste the Korean text into eclipse's view of my strings.xml all the characters appear as little squares. But when I change to the Graphical view of my layouts, the Korean characters are displayed correctly... I could limp along in this way and get the program made, but would be much happier if I could see the characters appear properly when looking at strings.xml. Any idea how I can do this?
Try Changing your text encoding in your editor to UTF-8.
Right click --> properties -->resources -->text file encoding.