Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I show phonetic (IPA) symbols on Android

I am trying to display phonetic symbols in a WebView, but so far I am only getting squares.

For instance, for the word "apostrophe", this should be displayed:

əˈpåstrəfi

but all I am getting on the display is:

□□påstr□fi

If it would help, I am getting the strings from an SQLite database. The string I retrieve has some HTML tags in it, so I use this:

webView.loadDataWithBaseURL("file:///android_asset/", 
     article, "text/html", Encoding.UTF_8.toString(), null);

where I have my CSS files in /assets. And the article variable contains some text enclosed in HTML tags.

like image 978
Zarah Avatar asked Jan 28 '11 10:01

Zarah


People also ask

Is there IPA keyboard for Android?

Gboard now supports IPA!

How do I get phonetic letters on my keyboard?

Add Indic Phonetic keyboards: Add the keyboard by clicking the + icon and then select the type of keyboard. Lastly, enable the phonetic keyboard by clicking on the input indicator on the taskbar (or press the Windows key + Space) and select the Indic Phonetic keyboard.


1 Answers

I've resolved problem to display phonetic symbols in TextView. The problem is the default android fonts are not implement IPA symbols. I can advise to use ccs like this


@font-face {
  /* Regular */
  font-family: "ConstructiumRegular";
  src: url("http://openfontlibrary.org/content/RebeccaRGB/412/Constructium.ttf") format("truetype");
  font-weight:  400;
  font-style:   normal;
  font-variant: normal;
  font-stretch: normal;
} 

In me case mentioned Constructium.ttf fits.

like image 101
sh1ng Avatar answered Oct 26 '22 19:10

sh1ng