This is a "port" of a layout engine I created for an Open Source project in which we are building a database modeling tool. I had to dumb down the engine a bit and cut some corners performance-wise to…