What's the meaning of "soft-wrap opportunities"? [duplicate] - css

I am in the process of writing a text editor. After looking at other text editors I have noticed that a number of them refer to a "soft" versus "hard" wrap. What is the difference? I can't seem to find the answer by searching.

A hard wrap inserts actual line breaks in the text at wrap points, with soft wrapping the actual text is still on the same line but looks like it's divided into several lines.

It's usual for text editors to auto-wrap text into paragraphs with hard newlines, but it's less common for the text to be re-flowed into a nice paragraph if you come back later and edit/add/remove words later on. (You can do this manually in emacs with M-q.)
This is rather annoying, since obsessive compulsive people like me then go back and have to manually re-insert the hard breaks at the appropriate points.
On the other hand, soft wrapping is annoying because most all command line tools use line-based diff-ing (version control is where this becomes most noticeable to me). If you've got a 1/3-page paragraph that's soft wrapped and fix a typo, it's basically impossible to see where the change is in a regular diff output or similar.

soft : The text in the textarea is not wrapped when submitted in a form. This is default
hard : The text in the textarea is wrapped (contains newlines) when submitted in a form. When "hard" is used, the cols attribute must be specified
Reference: W3Schools

Related

BIRT Report - Multiline text underlined to the full width

I'm trying to create a report with a layout as shown in the picture. The value of each field is underlined to the full width of the report. If it occupies more than one line each line is underlined. And there is also a short comment under the first line explaining the meaning of the field (shown in parentheses).
When we faced the same problem using JasperReports we had to create a custom component for that purpose. Does anyone know what the solution in BIRT might look like?
The only way I can think of is to calculate the line wrapping yourself, eg. converting your long text into a series of single lines.
Say you find a way to do this in a scripted data set, using the long text as an input.
You could then use a table item to render these single lines in the layout; using the bottom border to create the underlines (or possible an empty extra detail row with a top border and a height of 2pt to create nice line spacing).
Now how would this scripted data set look like?
I think when you study the source code of BIRT, you'll probably somewhere find a utility function that calculates the width (in whatever units) of a given text in a given font and size. Maybe this is also somewhere inside java.awt or inside iText (com.lowagie.text).
Then it is possible to call this function from inside Java Script and - with more or less logic - to use this as a basis for your scripted data set. But I think this will take a few hours to code.
If you manage to do this, it'd be nice if you post the solution here.

Indesigne paragraph styling error

So I've been working on some project of mine and long story short, I have to correct paragraph stylings and so on, because it didn't exprot correctly. Now I've been doing this for over a 1100 paragraphs and it was as it should be until the paragraph 1142 which when I apply style deletes everything that is after it, for no apperant reason. This only happens with this paragraphs, all the others befor it and after it apply styles correctly. I really dont get this. Thanks ! (since I dont have 10 reputation ill link the image http://i.stack.imgur.com/5K7ec.gif)
Not a programming problem; it's PICNIC.
Looking closely at the image, I see the newly applied style does not allow hyphenation. The single word in that paragraph is too long, and since you do not allow word breaks, InDesign tries to move it to a next frame, hoping that will be wide enough. (Apparently it is not.)
Enable hyphenation, or break the word in two with a space, or make the column wider, or use a smaller font. With your style parameters it simply does not fit.

How do I display line breaking markers while printing or displaying QTextDocument?

Imagine that I have very long lines in my text document. I want such lines to be broken to fit in width. But I also want such places to be marked in some way, for example:
Here, one short line is presented, then three lines are presented, each one is broken into two to fit in width, and each such break is marked with these markers (just Unicode symbols): ↲ ↳.
In this example I have monospaced font and thereby I was able to did the hack by simply inserting newlines and markers manually. I'm wondering is there a better way, which would use internal Qt's text layouting mechanisms and work with non-monospaced fonts? I do not really care about what kind of markers will be - it can be red line drawn after the text separately, I just need the information about line breaks done.
I do not care about rich texts much too, plain text is also good.

How can I force vertical text to be horizontal?

I'm working on an ASP.NET website that needs to be internationalized. I'm using .resx files (essentially key-value pairs in a file) to populate static string fields on a page in different languages depending on the chosen culture/locale. I'm implementing Japanese and getting some stubborn vertical strings.
When copy and pasting them into the .resx file, they are horizontal (source of strings is Google Translate, for testing purposes). All of the strings appear normal, but one always displays vertically. The misbehaving string is a few div's deep (like all of them) and only has font-size, font-family, color, and an uppercase transform applied to it.
Removing any or all of the above rules does not change the orientation of the text. I've cleaned the formatting off the offending text with Notepad and shortened it (to ensure it wasn't a length problem). I'm stumped as to why this particular string is stubbornly vertical.
Here is the text in question: ログアウト
(Translation: Logout)
Edit
Clarification of the issue.
What it should look like:
The vertical text in question:
How can I force vertical text to be
horizontal?
Other than the title, I don't really understand your question. I'll take a guess anyway.
Try adding white-space: nowrap to the div that's misbehaving.
Recently I was doing some learning about right-to-left on the web and learned that Unicode characters have a directional property associated with them at the character level. So this might have something to do with that, though I certanily wouldn't know how to ascertain that or fix it, especially given that Google Translate is the source of the strings.
It happens quite often for Asian scripts (not just Japanese but also Korean and Chinese) to have text rendered incorrectly. Usually you just need to play with element width, especially if it is part of HTML table.

How can I prevent line breaks between words and punctuation in Flex UITextField?

I am rendering html in a Flex 3.x UITextField. The problem I am facing now is that when punctuation is at the end of a word, it can sometimes be wrapped to the next line.
For example:
That which doesn't kill me makes me stronger
,so I became a developer.
This seems like a bug in the algorithm to me. Is there a workaround?
I've been trying to reproduce your problem, but in my case, the text in the field just gets cut off when I resize my window, it doesn't wrap.
In any case, have you tried a \n new line character with the text to force the line break to occur where you want it to, or does your text need to flow with the window size?
#Wade This component isn't really designed to be resized, though it does wrap on resize. Did you set the wordwrap to true?
#Armagosh I can't know where the line breaks will occur ahead of time. It depends on screen resolution and the Flex algorithm for wordwrapping. I am also not clear if this will help. If I put two spaces after the comma, would that prevent the comma from being after the line break?
It renders any one of a number of different xhtml items, some of which will wind up having the ',' be at exactly the end of the line in some resolutions. The same problem happens with hyphens.
Addendum: So essentially, yes, I need the wrapping to flow with window size.

Resources