UILabel text wrong new line when has special character - ios

Details of the issue :
When display text inside UILabel and almost the text fill complete line, if you add one more character with spacial character such as "ً" (check number 1) , it cuts first letter of text and put it in line alone(check number 2) and the rest of text in other line (check number 3)
Please note that the issue happening in the Facebook app and iOS note app

Try setting the linebreak mode to word wrap.
This may help.
Another option, try using textview instead of label.

Related

Why does copying multi-row text from Google Sheets to the Instagram caption box add a quote mark at the beginning and end of the text?

This may be the most niche question ever but let's try it anyway.
I have a Google Sheets spreadsheet that contains cells with multiple lines of text. Each line of text is separated by a soft break.
As shown below, when I copy the contents of a cell (row 2 in the screenshot) from the Google Sheets app to the Instagram caption box, a quote mark is added to the beginning and end of the caption.
If I copy the contents of a cell and that cell has only a single line of text (row 3 in the screenshot), no quote mark is added.
I am using an iPhone 11 running the latest version of iOS.
The extra quotes are added when there are special characters in the cell. In your scenario, the Line Feed characters are causing this. Definitely annoying.
There is a way around this – using Carriage Return characters, rather than Line Feeds to separate each line. For some reason these characters don’t cause the quotation marks to appear.
One thing you can do in your sheet is to create a helper cell that will take your text, and replace the line feeds with carriage returns (assuming your input text is in cell A2, add this formula to an empty cell):
=SUBSTITUTE(A2,char(10),char(13))
The output for this will look like it doesn’t contain linefeeds, but when you copy & paste from that cell, the linefeeds will be there in the pasted text, without the extra quotation marks.
The quotations are inserted by the target application when non-printable or otherwise incompatible characters appear in the copied text. There are several scenarios in which the quotes don't appear, and several in which they do.
For example in the MacOS Notes application, consider a cell containing either a vertical tab (appearing as a line break in a single cell with a Cmd-Enter on Mac or Cntl-Enter on Windows) or a newline character in a formula such as ="test"&char(10)&"test". When copied and pasted into a record in Notes, the text is copied as is (i.e., as expected). However when pasting into the Notes search box, the quotes appear, such as described in the question.
There appear to be 3 alternative ways to handle this issue:
Strip the non-printable characters with a formula
Using the CLEAN function, the characters will be stripped. This will produce oft undesirable results, but will eliminate the quotes. See the Wrapped in CLEAN column:
Paste elsewhere first
In the Notes example, one can paste the offending text into a Note (or presumably any text editor.) The offending quotes are omitted. The text can then be recopied and repasted without quotes. This will still collapse a line feed into a space:
Publish to Web and copy from there
Publishing a sheet with non-printable characters enables quoteless copy, like the previous option, but may be a preferable. See the test sheet
Copy from the Sample Text column. You can paste without quotes, but the line break is stripped and replaced with a space as above.
this is a common issue. the solution would be to paste your copy into fx bar instead of cell selection. this way you can skip the additional quotes
The easiest of the easiest solution is to copy straight from the cell. Mark the text within the cell instead of marking the whole cell and then copy.
its very easy guys
just follow as i say
step1: type letter in a cell
step2: select logo(A) with 4 dash(-) which is on top
step3: select cell
step4:turn on wrap text
problem solved
if you are using desktop
mac: alt/opttion+enter
windows: alt+enter
you can also select all cell at once then you can select format on menu bar and select text warping and then wrap(this is not recommended as it may destroy your table format)

Is there a way to use non-breaking spaces in a UILabel in a launch screen?

I would like to ensure that names in a multi-line copyright string on the launch screen do not get split by line breaks on different devices. Inside a view controller with a UILabel outlet textLabel, the escape sequence "\u{00a0}" works programmatically:
textLabel.text = "Lots of text before... Firstname\u{00a0}Lastname... and after."
It displays the string with the escape sequence replaced by a space and the words either side always appear on the same line.
However, I can't get it work by putting it in as the value in a UILabel in Interface Builder - either in LaunchScreen or any other View Controller. It just displays the string with the codes left as typed. I've tried all the various combinations of \u, \U, \\u, \\U, \x+, etc. suggested in several SO questions to no avail. I think intervening in the display of the launch screen programmatically is impossible.
Have I missed something?
Don't use \u{00a0} in the text you enter into the storyboard. Enter an actual non-breaking space. The easiest way is to type ⌥-space (option-space).
If you ever need to enter any other special characters, another option is to use the standard Character Viewer. Select Emoji & Symbols from the Edit menu to bring up the Character Viewer. Then find the desired character that you wish to put in a label. You can do this in Swift code as well instead of typing cryptic Unicode escape sequences into your strings.

ReadMoreTextview not working on New Line of text

I'm using see more & see less functionality using this code. But I'm stuck on one condition that is if I've content with \n or new line text then it's not working as I expected.
If I tap see less off text then it's expanding to full text. But not in exact See Less text.

UILabel word wrapping brings extra word to next line when there is enough space for it

Under certain circumstances, UILabel seems to bring an extra word to new line even when there is enough space for it, for example,
If one more word is appended,
Even if I force the width of the label to become something like below, it still moves the word consists of "c"s to the next line,
I've tried twisting the configuration of the UILabel, but seems it behaves the same unless I set the line breaking mode to character wrap, below is the configuration for the above cases,
And the constraints (in the first two cases, the trailing ),
Is there any reason for this particular behaviour and can I fix this? It looks weird in this way leaving that space emptied.
this is the default behavior since iOS 11, to fix orphaned words. No way to shut it off
to fix it
use the text as attributed text
or
use UItextview and turn of the scroll, edit option
or
use the custom label here
Get each line of text in a UILabel
You should set the line break to character wrap, because the letters after the space will be recognized as a word.
Hey I know this is late but I just figured out that you can cheat the system by adding a bunch of spaces at the end of the text.
If text of UILable may be changed, then it's still possible to use quick-dirty hack with "\n" - new line symbol.
Text "Aaaaaaaaaaaaaa bbb cccccccccc\ndddddd" will force UILabel to display:
Aaaaaaaaaaaaaa bbb cccccccccc
ddddddd
In Interface Builder new line can be inputted with Ctrl + Enter
If u use wordWrap, it tries to keep words in full form, as a result of this, it goes to next line. If you use character wrap, it will break on characters, and push the chars onto next line.
For Example:-
My name is ABCXXXX and I (have space here)
love myself.
Solution:-
Use NSMutableAttributedText and write love\n. It will make the "love" be in the space myself in the next line.

How do you add a superscript character into a Powerbuilder textbox?

Is there any way to do this in the Powerbuilder properties window for a datawindow's textbox?
That kind of depends on how you define "textbox", but in general the only way to mix normal and superscript text is with a richtext control. In PB 11.5, you can even use richtext as a column style.
Good luck,
Terry.
Yes. For the text control, you must select a font that has superscript characters (Arial does).
Go into the Windows Character Map (usually in the start menu under Accessories->System Tools) and select your font.
Then go to the superscript character that you want to place in your text control. Click it and then click the Select button to place it down in the character map text box.
Then click the Copy button.
Now you can return to PowerBuilder and paste this value into the properties window text area.
As long as the same font is selected for the DataWindow control as was selected in the character map it should show as your superscript character.
This same techinque can be done to include any of the Wingding type characters as well.
We ended up using two separate text fields. It's a butt-ugly solution, but it works. The superscript field has a smaller font and is nudged a little higher up.
I think newer PB versions support superscripts.
Thanks for the help.
Glenn
If you go to the character map - when you select your character it will show the keys to enter this character on the bottom right of the window.
Example : in Arial font - the ® (registered) mark is Alt + 0174
To enter these, turn your numlock on, hold the alt key down, and type 0 1 7 & 4 then let up on the alt key. You have to use the number keys on the number pad to do this the ones on the top of the keyboard dont work.
You can then enter your characters directly or do something like this :
ls_key = '®'
Actually I stumbled across a simpler solution. I copied and pasted a portion of the text from a pdf into the text property of a datawindow text contol. The superscript character simply pasted in. So I'm guessing that Dougman's solution would work too.
Example:
"™Trademark used under..."
Note: I'm using PB 9.0.1
Thanks for all the help,
Glenn

Resources