14. A method for laying out a paragraph of text on a page, the method comprising: obtaining the paragraph text and properties from a client; caching formatting information for the paragraph, wherein the paragraph is formatted as one line with an infinite margin, wherein all of the possible breaking points within the line are identified; performing a line-by-line format of the paragraph; creating a node pool for storing layout nodes; adding a first node to the node pool, wherein the first node is empty and wherein a current node is in the node pool comprises a minimum amount of content associated with the paragraph; creating new nodes equal to the current node and a variant of a next line, wherein all breaks for the next line following the current node are identified; adding the new nodes to the node pool; calculating a node penalty for each newly created node; determining when a first hyphenation has a better hyphenation quality than a second hyphenation, wherein at least one of a plurality of factors are used to determine the better hyphenation quality, wherein the first hyphenation is assigned to the hyphenation when the first hyphenation has the better hyphenation quality than the second hyphenation and the second hyphenation is assigned to the hyphenation when the second hyphenation has the better hyphenation quality than the first hyphenation; determining whether a current number of nodes in the node pool exceeds a threshold number of nodes; in response to determining that the current number of nodes in the node pool exceed the threshold number of nodes, removing higher-penalty layout nodes from the node pool; removing each new node to the node pool that has the penalty greater than a line penalty; determining if any nodes end at a same point; and removing the current node from the node pool, wherein nodes from the node pool are removed that cause figures to be pushed from the page.
14. A method for laying out a paragraph of text on a page, the method comprising: obtaining the paragraph text and properties from a client; caching formatting information for the paragraph, wherein the paragraph is formatted as one line with an infinite margin, wherein all of the possible breaking points within the line are identified; performing a line-by-line format of the paragraph; creating a node pool for storing layout nodes; adding a first node to the node pool, wherein the first node is empty and wherein a current node is in the node pool comprises a minimum amount of content associated with the paragraph; creating new nodes equal to the current node and a variant of a next line, wherein all breaks for the next line following the current node are identified; adding the new nodes to the node pool; calculating a node penalty for each newly created node; determining when a first hyphenation has a better hyphenation quality than a second hyphenation, wherein at least one of a plurality of factors are used to determine the better hyphenation quality, wherein the first hyphenation is assigned to the hyphenation when the first hyphenation has the better hyphenation quality than the second hyphenation and the second hyphenation is assigned to the hyphenation when the second hyphenation has the better hyphenation quality than the first hyphenation; determining whether a current number of nodes in the node pool exceeds a threshold number of nodes; in response to determining that the current number of nodes in the node pool exceed the threshold number of nodes, removing higher-penalty layout nodes from the node pool; removing each new node to the node pool that has the penalty greater than a line penalty; determining if any nodes end at a same point; and removing the current node from the node pool, wherein nodes from the node pool are removed that cause figures to be pushed from the page. 16. The method of claim 14 , further comprising if there is more than one node after the current node is removed, the routine goes back to define the current node as the node in the pool with the minimum content and continues the routine again until there is a single layout node that represents the entire paragraph.