I'm doing a project where we are re-creating a very old system.
The client wants the same base functionality and some improvements.

One of the things I'm currently working on is the note-system. These are used as flags of some sort, but are also used as a comment field for some products or client profiles.

In the old system you could write the text and save it like you would get in a .txt file. They want the new one to be able to do word formatting such as:

Different font sizes (Only some parts of the text)
Different font colours (Only some parts of the text)
Underlining of words
Bolding
Italics
Tab-spaces

Those are the specs they want. What I need to know is the following:

1) How do I do that?
2) Currently they store all these files on the server as text files and the database have paths that refers to each file. I want to be able to save a text file with that formatting to the HDD of the server like in the old system.
3) If possible I would like to save that text to the database with the formatting.

Any help would be very much appreciated.