This is achieved with the Cocoa text system in Mac OS X and also with W3C XML and HTML recommendations