TextView display string containing "fi" issue - android

I have been struggling to fix an issue of display a string which contains a pattern of "fi" such as word "munificent" in Android TextView. That was displayed wrong by missing the dot of the letter "i". I have tried to set font, android:textScaleX, and even tried using WebView. They are all same result. Please help.
Thanks.

You are probably seeing the "fi" ligature. It is a source of many complaints. There is even an online petition to get rid of it.
Evidently, you can get rid of it by setting the android:fontFeatureSettings attribute on a TextView for Lollipop and up. See this question for some guidance.

Related

Titles getting cut off in mobile app built with kotlin

I am working on an open source project and I am kind of stumped. Whenever the titles are being displayed in another language the titles begin to be cut off as you can see in the attached picture. Has anyone experience similar problems, and how would.you fix it?
you can see how some items are getting cut off
It seems that the problem is the size of the text, whenever it's too big the view get messed up. Maybe you can limit the text to two lines if you are able too and use ellipsize to add the dots at the end.

Live formatting editText with markups/markdown

I have a slight issue. I wanna do something like we have here where we put in format markers such as this and this but I want it to appear in the edit text but not remove the marks for it. At the moment I'm achieving this with a preview button which displays an AlertDialog to show the previewed text.
I'm not sure which code to show as I have no idea how to do this at all. I also have no idea where to start on something like this. I've tried doing tons of research and it formats one word and then completely removes the markup/down for it.
Any help will be appreciated and I'm happy to supply any code whatsoever :)
I achieved this using a third-party library RichEditor and took the ones that I needed. It works really well for what I needed so I would recommend it for people to use.
It uses a webview for the EditText and then converts the text into a WYSIWYG formatting.

Android TextView URLDecode and fromHTML not quite working

I am working with HTML and Unicode text that I'm querying from a database. I'm trying to convert it for proper display in a text view.
Here is the relevant code where I'm attempting the conversion:
ReviewView.setText(Html.fromHtml(URLDecoder.decode(cursor.getString(14), "UTF-8")).toString());
However, it's only partially working. Here is an example of the text I'm working with:
is%20in%20the%20title.%3C/p%3E%3Cstrong%3EBoiled%20Brocoli%3C/strong%3E%3Cbr%20/%3EApparently%20brocoli%20does%20not%20make%20for%20a%20good%20pesto.%20This%20tasted%20like%20brocoli%20I%20used%20to%20cook%20when%20I%20was%20eleven%20at%20home%2C%20which%20is%20to%20say%20I%20don%27t%20really%20remember%20it.%3C/p%3E
I want it to look like:
is in the title.
Boiled Broccoli
Apparently broccoli does not make for a good pesto. This tasted like broccoli I used to cook when I was eleven at home which is to say I don't really remember it.
Instead I'm getting:
is in the title.Boiled Broccoli
Apparently broccoli does not make for a good pesto. This tasted like broccoli I used to cook when I was eleven at home which is to say I don't really remember it.
Any ideas on how to properly decode this?
Thanks!
The start of the Paragraph tag is wrong. in your case,it starts with a end tag, like this < / p > (added space inside the tags for clarity). Also replace the strong tag with b. It should work now.
Separating the commands actually fixed this. So on separate lines I complete first the decode then the fromHTML.

Printing arabic strings in android

In my application I need to add some string to a list and print them back. Problem is when I print them I can see the letters has inter change whithing the word.The word is in Arabic. (before 4.2 android doesnt support natively for Arabic).
What I tried was using several Arabic rendering classes such as fursi class and Arabi utility class. Nothing is helped me.
Here is the word ٣.. ما زاد على actually this part ٣.. should be the first it always goes to right as I have shown. Is there way to solve this thing. this is the one and only bug to hold the application to add to market :(
Oh, ouch! Arabic is worse than Hebrew in this aspect because Arabic has its own digits! Right!
I once had a similar problem on Windows, with symbols that weren't treated exactly as Hebrew but also not exactly as non-Hebrew. The only way I found to fix this was to split the string into two - print the problematic symbols (your 300) and then print the rest of the string.
I thought that with Unicode things has gotten better. I guess not always.
UPDATE: In a comment you said the translation of the string was 3.. . In Arabic, zero and a dot look very similar (which is why I confused a dot with a zero). Perhaps the person responsible of the input typed it wrong, not being fluent in Arabic, as well? 3.. doesn't make a lot of sense (3. does, and so does 300, but 3.. ?). Check the input, it might be wrong, and that can confuse the layout algorithm.
I can't technically understand the reason behind my action to correct above issue. However this is it . ` I reverse the word and separated letters by "+" and added to the list.It is amazing !

Android: How to display formated code in TextView?

I am writing an android application that will be displaying codes... specially java codes, or maybe jsp code as well. I was thinking about placing these codes in a TextView. However i dont know how to do this for android. I didnt find any tutorial or documentation on how to display formated text in a TextView. I know I can put html in there, so one direction would be format the code itself in html and then place it in the textview.
Is there a better way to do that?
Many thanks
T
TExtView can't do all the formatting. HTML is the best guess.
Search for "Spannable HTML Textview Android" and you will get quite a few examples. Here is one.
Is it possible to have multiple styles inside a TextView?

Categories

Resources