Can I use multiple font style in UITextView? - ios4

I have a requirement to use multiple font style in UITextView. Like Bold, Italic and Underline text in single Textview. Like:
One word is Bold second may be italic third Underline as per user selection.
I don't think this is allowed to do but still if any one have achieved and want to share. I need this all while enter text and same while displaying.
Thanks

You're right that the standard UITextView does not support rich editing. At the moment there are a few solutions to the problem.
The Omni Group has released their iOS and Mac frameworks under an open source license. These include a very powerful rich text editor (see: OUIEditorFrame.m). These are very powerful but also extremely complex. Their sample iPad app includes the rich text editor example. Further discussion can be found here
Secondly, this guy has been working on a custom rich text editing control and is offering it under a negotiable licensing agreement.
Finally, you can do it all yourself and create an editor control that implements the UITextInput protocol. Aside from the Apple documentation, there are some tips on doing this here.

Why don't you use attributed string and use its property to set the string as you like.
Reference link : https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/AttributedStrings/Tasks/CreatingAttributedStrings.html

Related

Sublime Text 3: bold text in plain text mode

I'm pretty new in Sublime Text 3, and I know it allows for a wide customization.
I would like to know how I could make some part of the text bold, italic or underlined, or even coloured, when I'm writing a plain text. It may sound dumb, but I have no idea how to do it and whether I can do it.
Thank you!
Your best bet is to use the MarkdownPreview plugin combined with the LiveReload plugin to display Markdown text written in Sublime as HTML displayed in your web browser. Unfortunately there isn't anything at this time that can display rendered HTML or Markdown in Sublime itself.
EDIT Apparently there is also MarkdownLivePreview, which I wasn't aware of before. I haven't tested it yet, but it's very popular, so you might want to try it.

How exactly does Syntax Highlighting work in IDEs?

I was writing my own text editor in Electron using React and I tried to do some basic syntax highlighting. The user writes their code inside a textarea, but there is no way to insert markup inside a textarea so I can't color text that way.
I found this jquery plugin which adds a backdrop behind the textarea so we can put a background color in certain places however I wanted the text themselves to be colored (which can't be done as the textarea is in front of the backdrop).
Any ideas about how other IDEs like Visual Studio Code (also written in electron) pulled this off?
There are multiple approaches that can work here.
One way could be using a div with a contenteditable="true" attribute instead of a textarea. This way you can both write text inside the element and style its contents. Of course this creates its own issues that would have to be dealt with - when to parse the code, how to reposition the caret and more. Depending on the approach, MutationObserver could come in handy.
Another way would be to not use any built-in writing functionalities at all and implement your own. Listen to keyboard events and programatically insert characters. In that case you would also need to implement your own caret, selection etc., which is not easy.
VS Code is open source, so you can actually take a look under the hood and see how the editor is made. They use a completely bespoke editor called Monaco but its source code is in the VS Code repo. This file is a good start.

Is there any way to bold or italicize individual words in Bixby paragraph text?

I don't see any way to emphasize an individual word or phrase using Bixby's text styling and font features. Is this correct?
https://bixbydevelopers.com/dev/docs/reference/type/layout-macro-def.content.single-line.text.style
I've double checked with our Bixby View Team, unfortunately, specific syntax such as bold or italics are not supported at the moment.
All the available style are listed in Fonts Reference of design guide. And please note that the style applies to the entire string of a template or the entire string of a slot from a card component.
If this feature is critical to your capsule development, I would recommend that you raise a Feature Request in our community. This forum is open to other Bixby developers who can upvote it, leading to more visibility within the community and with the Product Management team.

Paypal code's color scheme

Is there a method to extract the code's color scheme from paypal code expamples and place it in sublime text?
Here is a link: Paypal link
That page is made using Groc, that put comments next to code in a beautiful way. Groc seems to use two projects that I have used before: highlight.js and maybe pygments, to highlight the code, but they don't use any of the default stylesheets, I think they use their own stylesheet.
Inside the Groc project you can see this sass file which contains almost all the info you need (color for variables, strings, keywords, etc.) to manually add the values to a custom color scheme. In addition Groc style documentation shows other useful values of the Color Scheme such as the background. You can get other values inspecting DOM.
I think you would have to manually do it. You can use this Sublime Text Color Scheme Generator. In the Paypal window, you can use developer tools (Ctrl + Shift + C if you're using Chrome) and click on the words to see the exact color value, and then just use those in the color scheme generator.
EDIT: Please take a look at #sergioFC's answer, he gave an easier way of finding all the color values.

Xpages rich text field full alignment

In the rich text field I choose Full alignment, but when previewed the text has left alignment. When I close and reopen the document, the text is brought back to left alignment.
How can this be resolved?
If I understand you correctly, you have a Notes Form with a Rich Text field, in which you align the text "justified", as in the screenshot below:
But if you view that in a Xpage, the text is no longer justified, neither in the read-only rendering, nor in the edit-rendering with the CKEditor:
Alas, if you align the text justified via the CKEditor, it renders properly in the browser
with an "interesting" rendering in the Notes Client:
This is a "known" problem and in my demo case, the Xpages runtime engine even warns me about that:
"Saving this document will change its format from native Notes rich text to HTML. This may cause a change or loss of formatting if opened again in the regular Notes client."
The conversion of rich text to HTML and vice versa is not the whole problem, even though the message says that. There are also issues with repeated conversions back and forth changeing font sizes, loss of certain colors and styles, etc.
This is a long standing issue with Ben Langhinrichs, who documents that rather thoroughly and even sells an extension to handle that conversions better.
Hope this helps a little bit.
I am using v8.5.3 and in the All Properties of the CKeditor they have a property called 'htmlConversion Warning' that you can set to 'noWarning' which seems to prevent the Saving this document message mentioned above. Seems someone from IBM has taken a note from Microsoft on providing a solution. Now if only they would take a note from them on how to market the product.

Resources