Setting keyboard format (bold, italic etc.) for to be written later texts - kotlin

To describe shortly, i have a "Bold" button for example. When the user touches this button, the texts will writen later will be Bold. So when the user writes by keyboard, the texts will be bold. I tried setSpan but I gave up because it wanted a start and end, and there would be trouble if the user wanted to change the initial letter of the text he had written before for example i think. Maybe it happens with this too but I don't know. Is there any library or a way for this?

Related

How can I insert circled numbers with text in button label/text, vb.net

I am trying to insert circled numbers with (a-z) text on button labels/text in a desktop vb.net application. Wingdings 2 font has what I need for the circled numbers but has no regular (a-z) text and the button font property does not allow two different fonts in the same button label/text.
In scouring the internet, I can find nothing, but I am sure I am not the first to need this feature.
The goal is to have a circled number at the beginning of each button label/text, so that the user can click the buttons in the right sequence.
You should be be to paste them in as Unicode in most fonts. Here are some Sans Serif ones, just try to copy and paste them with the rest of your button text:
🄋 ➀ ➁ ➂ ➃ ➄ ➅ ➆ ➇ ➈ ➉
If this does not work for you, You may want to try a button image instead. Maybe use something like Paint.Net to make the text you want into an image, and then set that as the button image. I'm not sure if you can do that in a sizable way with SVG or PNG or if you would have to make several images for different sizes and use code to switch them.
FYI, I got these characters from this site, if you want more options: http://xahlee.info/comp/unicode_circled_numbers.html

How can I set the line height of a multi-line PDF form field, and save it so it doesn't get reset by filling it?

I am having the exact same issue described in this question: Multiline pdf text box
I have a PDF that has some dotted lines that I want to convert into a fillable multi-line field. I tried the solution in the linked question, but my setting is not staying when I try to fill in the field outside of Acrobat.
When I am preparing the form inside Acrobat, I set the line height to 30 and it is lining up fine:
But when I save this PDF and then try to fill in the field outside of Acrobat, the line height setting does not stay. It gets reset every time:
It's super frustrating and I have scoured the internet looking for an answer but I have nothing yet. If someone knows what to do to get the line height looking like the first screenshot, please save my sanity.
I'm using Adobe Acrobat Pro DC 2021.001.20135 on macOS 10.14.6.
Thank you
You can't. Those settings don't "stick" when the field is cleared and there's no way to set them programmatically. It's best to simply remove the lines from the PDF.
As #joelgeraci stated, the settings don't stick.
However, if the form has to be manually fillable, removing the writing lines may not be the best idea. In this situation, it would be better to change the field's background color. When the field has no content, its background color is transparent, otherwise white. And that will cover the writing lines.

iTextSharp reverses Arabic text when filling combed text field

I have a problem with iTextSharp which looks like it could be a bug.
I have a combed text field and when using iTextSharp to add Arabic text to it, the Arabic letters initially appear reversed when the field is "highlighted". So 'ف ا د ي' appears 'ي د ا ف'.
The moment I click on the field, the highlight disappears and the text appears in the correct direction.
This happens regardless of the direction and alignment and only happens in combed text fields.
Can anyone offer any solutions to this?
Note: I've added the iText tag as well because I have a hunch that this issue is not specific to iTextSharp only and I hope I can replicate any workarounds or solutions in iTextSharp. Regards,
You can usually fix this by setting GenerateAppearances to false on the form object.
Annotations in a PDF (which form fields are a version of) can have different "states" and for each of these "states" you can specify how you want a renderer to display that state. For instance, a checkbox can either be "checked" or "not checked" which is given, but how to render that actual checkmark isn't. Maybe an "X", maybe a ✓, maybe a ☑ or maybe something totally different. These different states are called their Appearance State.
If you don't set an appearance state for an annotation then you are effectively surrendering control of that state to the PDF renderer and letting it do whatever it wants.
Adobe's renderers (Acrobat and Reader) are the de facto standard for PDF renderers and recent ones are actually really good at "filling in the blanks", especially when it comes to things like RTL and many non-English/Latin things. Other renderers out there, including Google's, Apple's, Microsoft's and even your printer might not be as good at this, however, so you might want to test this.

NSLinkAttributeName highlight color bug for non-English word support

when I want to add link detect for #username, it is fine, but when the username is not English word, then when I tap on it, the hight light only cover on #
now, I fix it like this:
add a color attribute to #, and then add a link attribute to username.
Did anyone have better solution.

vb.net, label or textbox right-aligned

OK, here's a problem i have. Searching the net did not help much.
In VB.net, you can right-align the text on a label. The label however has automatic word-wrap capabilities so it seems impossible to display a text in the label (of constant size) and always view the last part of the text.
I'm placing a folder name in the label and i'm always interested in seeing the last part of the text. As is now, if the path name is too large, i keep seeing the i.e. "C:\Documents and Settings" part, which i don't care to see. In VB6 when you right-align the text in a label, it displays the last part and if the text doesn't fit, it just cuts the text at the beginning. In VB.NET if the text is too large to fit in the label, word-wrap kicks in so you end up seeing the first part of the text only.
When using a textbox, even if it's right-aligned, if the text doesn't fit it just shows as much as possible from the START of the text (instead of from the END since it's right-aligned.)
Is there a way to achieve a similar behavior in VB.NET as in VB6's label?