Working on a typesetting algorithm

Wondering if I could implement a paragraph styles, text overflow etc stuff and make a basic indesign clone...