How do custom fonts keyboard apps change the style of output text? - android

There are a lot of keyboard apps in the Play Store which can use to type in different font styles, like this app. These font styles work in any other app & they are only available for English characters.
I would like to know how do these text styles work? Is it some kind of a text span? Thanks for the help.

Related

Syncfusion Xamarin.Forms formatted text in generated PDF

I want to ask you if it's possible to create formatted text like
This text is normal and this one is bold. We also have an italic font slope.
in this way:
graphics.DrawString("This text is normal and this one is bold. We also have an italic font slope.", font, PdfBrushes.Black, new PointF(0, 0));
I tried to use order the documentation a HTML Styled Text (https://help.syncfusion.com/file-formats/pdf/working-with-text#adding-a-html-styled-text) but PdfHTMLTextElement Class is not supported in Xamarin.
A next choice was to insert RTF text (https://help.syncfusion.com/file-formats/pdf/working-with-text#inserting-rich-text-format-contents) it's also impossible to use that in Xamarin.
I'd also to have a formatted string inside a cells of PdfLightTable. Have you any tips how to achieve this?
I'd appreciate your help very much.
At present the PdfHTMLTextElement is not supported in Xamarin platform. In order to achieve your requirement, we have created the workaround sample for applying style to the text based on HTML tags.
Please find the
Sample
Thanks.

Rich Text Formatting

I'm trying to find a way to format EditText in an Android app that I'm planning to create.
When I created a example project to do this, all there is are plain text multiline edit text etc. There isn't really a specific EditText for rich text formatting. For instance in windows there is RichTextBox. Here thw developer can set styles such as bold,Italics underline etc. by selecting part of the text and styling it.
I'm wondering how I can achieve this in Android development. Can someone shed some light on this, would be greatly appreciated!

Android - Justify alignment and custom font for Texts in Arabic and Persian languages

I am developing an android application and I strongly need to use Justify text alignment and also I should use custom font for texts. my application is in Persian language.
If I use TextView for showing texts I cant set text alignment to Justify.
If I use WebView and load html to it I cant use font for it (I know that I can set font using html and css but it does not work for some languages like Persian and Arabic , I tested it, only on android 4.4.2 i see my custom font but on other versions of android webview show android default font)
I tried converting font to SVG but nothings changed.
also I searched in github for a custom webview or textview , I fount one custom textView , both font and text alignment was ok but the direction was left to right but i need it be right to left (I tried changing gravity and other things but cant fix problem).
So what is your suggestion ?
Thank you so much for helping.
Regards.
Take a look at this forum.I used this library with the following attrs and everything works perfectly:
ext:documentView_reverse="true"
ext:documentView_textAlignment="justified"
ext:documentView_textFormat="formatted"

Multiple fonts associated with same TextView

Is there any way to set different fonts for different states in a TextView?
Let's say I want Helvetica Regular for normal state, and Helvetica Bold for pressed?
I know how to link a custom font with a text view, but not sure how to do same for multiple fonts and single TextView? Specifically, is there a way to achieve this behaviour through xml?
Update: I'm not looking into workarounds, like having HTML in TextView, or even replacing TextView with WebView. If it's not possible to achieve, I'd rather have one font
check this link may help you:
http://shuklaxyz.blogspot.com/2012/05/custom-fonts-for-webview-and-textviewv.html
also :
Custom fonts and XML layouts (Android)
also:
Custom TrueType font from xml only
and this :
http://polwarthlimited.com/2013/05/android-typefaces-including-a-custom-font/
hope that help.
Using Html.fromHtml comes in handy, but it is limited to the tags you can use. I personally only have used this to do Bold, Colors, italics.
Like this:
String myWords ="<FONT COLOR = "#992211">This is Red:</FONT><br>";
myTextView.setText(Html.fromHtml(myWords));

How do I change android auto-correct text color?

I'm currently using an EditText field with a grey background. My problem is that when auto-correction happens, you can't see the grey auto-corrected words against the grey background. Is there a way to change the default font used by auto-correct?
You can configure the appearance of pretty much everything by theming your application. That would also be the way to go to customize the appearance of your EditText.
Read the Styles and Themes guide at Android Developers.
I recommend you have a look at the themes.xml file of the emulator of your target platform. It's located in android-sdk/platforms/android-X/data/res/values.

Categories

Resources