Difference between hard wrap and soft wrap? - word-wrap

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

Low Level Text Output

I have not done any MACOS programming in several years. However, I now need to test out some algorithms for formatting text as paragraphs. For these tests, I need to be able to display characters with absolute position control.
These tests need to determine where line breaks are to go within a paragraph and the amount of work spacing, while taking into account hyphenation, ligatures, page breaks, kerning and the like.
When I last did such things, I was using the text functions of the CGContext class. Upon returning from my hiatus, I find all of these function are marked "deprecated" in the documentation—which conveniently leaves out what the current acceptable replacement is.
What is the current, approved process for drawing single glyphs on Mac OS?
Functions that deal with formatting strings would defeat the purpose of the academic experiment here.

How to handle big chunks of text

Until now I have used
<Label Text="Some Text"</Label>
to present text for the user. However, I was wondering if this is the correct way to render big premade text strings with bullets etc. or if there is another, more neat way to do it?
I have used a WebView in the past with a transparent background. That allows as much markup as needed and is fairly easy to do. Though I have also just used a simple Label and added a bunch of \n's and \t's to make it look like a formatted document. I think it depends on your preference, the layout you are putting the element in, and if the text will be dynamically pulled or not.
There are also markdown plugins you can add that will format mark down text so thats another option. Something like this (I have not tried this plugin myself btw).

BlockComposer.ShowText() doesnt have an option to draw underline text?

I'm using blockComposer.ShowText("foo") to build texts but how to do an underline?
I don't see enough examples on underline text, how do you all make one?
Text decorations (underline, line-through, overline) haven't been supported yet: they are generally considered an ugly and discouraged typographic habit, so that even the PDF spec doesn't natively support them (it all ends up with cosmetic graphic lines placed somewhere near the text glyphs).
It's not that tough job to add them... I simply avoided them in abhorrence, but I fear there shall come the day when I am forced to deal with this ;) ... maybe in forthcoming 0.2.0 version?

Multiple margins in Atom Editor?

Using Atom Editor, I can change the position of the vertical margin from
File > Settings > Preferred Line Length
Is there a way to add multiple margins?
You can if you install the omni-ruler plugin.
I'm amazed as how dificult is for everyone to understand the problem.
Being a "stack overflow" user, you would expect to find many user with experience on the problem of working with [fixed-width-fields] text files.
is not a text file with a long line.
is data contained in those lines, that need to be make easier for human eye to check.
that being said, the besto solution so far fo me is:
https://www.ultraedit.com/support/tutorials-power-tips/ultraedit/column-markers.html

Diff visualization algorithm

Is there any description of a diff/patch format visualization algorithm? (or maybe it is too trivial to be described)
The Rietveld code review tool has a lot of comments explaining its operation in its source code. Take particular notice of intra_regiion_diff.py and engine.py.
What diff tools produce as data is pretty basic: "this line changed that way".
"Visualizing" that normally consists of showing the original code and the modified code side by side, with the "this line changed" indicated by marking the display text somehow. Basically this means scrollable text windows with painted stripes of text. Fancy versions will paint lines between the changed line in one window, and it corresponding line in another.

Resources