Claims
- 1. A method comprising:
maintaining an index of candidate start nodes of a current line; beginning with a first node in the reading order of a paragraph, adjusting the index, calculating a width of the current line, and calculating an optimal line break scheme for a paragraph layout that ends with the first node, the optimal line break scheme having a last line that begins with one of the candidate start nodes; for every subsequent node in the reading order of the paragraph, adjusting the index, calculating the width of the current line, and calculating an optimal line break scheme for a paragraph layout that ends with that subsequent node, each optimal line break scheme having a last line that begins with one of the candidate nodes; and formatting the paragraph in accordance with the optimal line break scheme of a last node in the paragraph.
- 2. The method of claim 1, the method further comprising:
for at least one node in the paragraph, re-calculating an optimal line break scheme for paragraph layout that ended in that one node, when the width of the current line is a less than a width of a line immediately preceding it.
- 3. A computer-readable medium carrying program code that, when executed:
maintains an index of candidate start nodes of a current line, begins with a first node in the reading order of a paragraph, adjusts the index, calculates a width of the current line, calculates an optimal line break scheme for a paragraph layout that ends with the first node, the optimal line break scheme having a last line that begins with one of the candidate start nodes; for every subsequent node in the reading order of the paragraph, adjusts the index, calculates the width of the current line, and calculates an optimal line break scheme for a paragraph layout that ends with that subsequent node, each optimal line break scheme having a last line that begins with one of the candidate nodes; and formats the paragraph in accordance with the optimal line break scheme of a last node in the paragraph.
- 4. The computer readable medium of claim 3, the medium further carrying program code that, when executed:
for at least one node in the paragraph, re-calculates an optimal line break scheme for paragraph layout that ended in that one node, when the width of the current line is a less than a width of a line immediately preceding it.
- 5. A method of processing text that is divided into nodes, each node defining an unbreakable segment of characters comprising:
calculating a base node width associated with a node, calculating a correction width, using the base node width as the width of the node when calculating a length of a line when the node does not end the line, and using a combination of the base node width and the correction width as the width of the node when calculating the length of the line when the node ends the line.
- 6. The method of claim 5, wherein the base node width is defined in terms of a distance from a beginning of the text to an end of the node.
- 7. The method of claim 5, wherein the base node width is defined in terms of a distance from a beginning of the node to an end of the node.
- 8. The method of claim 5, wherein calculating the base node width comprises adding character width components to kern pair components
- 9. The method of claim 5, wherein calculating the correction width includes accounting for the absence of a space.
- 10. The method of claim 5, wherein calculating the correction width includes accounting for the width of a hyphen.
- 11. A method of processing text that is divided into nodes, each node defining an unbreakable segment of characters comprising:
beginning with a first node in the reading order of a paragraph, calculating an optimal line break scheme for a paragraph layout that ends with the node; and for every subsequent node in the reading order of the paragraph, calculating an optimal line break scheme for a paragraph layout that ends with that subsequent node, wherein each optimal line break scheme is calculated by minimizing the total of a penalty value of a current line and all preceding penalties of all preceding lines, the preceding penalties of all preceding lines being defined by a previously calculated optimal line break scheme, and wherein calculating the optimal line break schemes includes calculating base node widths associated with the nodes, calculating correction widths, using a given base node width as the width of a given node when calculating a length of a given line when the given node does not end the given line, and using a combination of the given base node width and one of the correction widths as the width of the given node when calculating the length of the given line when the given node ends the given line.
- 12. A method comprising:
calculating a base node width associated with a node, the base node width including at least one character component and at least one kern pair component, calculating a correction width, the correction width including a space adjustment component and a hyphenation adjustment component, using the base node width as the width of the node when calculating a length of a line when the node does not end the line, and using a combination of the base node width and the correction width as the width of the node when calculating the length of the line when the node ends the line.
- 13. A method of processing text that is divided into nodes, each node defining an unbreakable segment of characters comprising:
calculating a base node width associated with a node, calculating a correction width, using the base node width as the width of the node when calculating a length of a line when the node does not begin the line, and using a combination of the base node width and the correction width as the width of the node when the node begins the line.
- 14. A method of processing text that is divided into nodes, each node defining an unbreakable segment of characters comprising:
for each node, calculating a base node width associated with the node, for each node, calculating a first correction width associated with the node if the node ends a line, for each node, calculating a second correction width associated with the node if the node begins a line, and calculating a length of a line consisting of a sequence of nodes, the calculated length being equal to the total sum of base node widths for the nodes in the sequence, plus the first correction width associated with a last node in the sequence of nodes, plus the second correction width associated with a first node in the sequence of nodes.
- 15. A computer-readable medium carrying program code that, when executed in a system of processing text that is divided into nodes, each node defining an unbreakable segment of characters:
calculates a base node width associated with a node, calculates a correction width, uses the base node width as the width of the node when calculating a length of a line when the node does not end the line, and uses a combination of the base node width and the correction width as the width of the node when calculating the length of the line when the node ends the line.
- 16. The computer-readable medium of claim 15, wherein the base node width is defined in terms of a distance from a beginning of the text to an end of the node.
- 17. The computer-readable medium of claim 15, wherein the base node width is defined in terms of a distance from a beginning of the node to an end of the node.
- 18. A computer-readable medium carrying program code that, when executed in a system of processing text that is divided into nodes, each node defining an unbreakable segment of characters:
begins with a first node in the reading order of a paragraph, calculates an optimal line break scheme for a paragraph layout that ends with the node; and for every subsequent node in the reading order of the paragraph, calculates an optimal line break scheme for a paragraph layout that ends with that subsequent node, wherein each optimal line break scheme is calculated by minimizing the total of a penalty value of a current line and all preceding penalties of all preceding lines, the preceding penalties of all preceding lines being defined by a previously calculated optimal line break scheme, and wherein calculating the optimal line break schemes includes calculating base node widths associated with the nodes, calculating correction widths, using a given base node width as the width of a given node when calculating the length of a given line when the given node does not end the given line, and using a combination of the given base node width and one of the correction widths as the width of the given node when calculating the length of the given line when the given node ends the given line.
- 19. A computer-readable medium carrying program code that, when executed:
calculates a base node width associated with a node, the base node width including at least one character component and at least one kern pair component, calculates a correction width, the correction width including a space adjustment component and a hyphenation adjustment component, uses the base node width as the width of the node when calculating a length of a line when the node does not end the line, and uses a combination of the base node width and the correction width as the width of the node when calculating the length of the line when the node ends the line.
- 20. A computer-readable medium carrying program code that, when executed in a system of processing text that is divided into nodes, each node defining an unbreakable segment of characters:
calculates a base node width associated with a node, calculates a correction width, uses the base node width as the width of the node when calculating a length of a line when the node does not begin the line, and uses a combination of the base node width and the correction width as the width of the node when the node begins the line.
- 21. A computer-readable medium carrying program code that, when executed in a system of processing text that is divided into nodes, each node defining an unbreakable segment of characters:
for each node, calculates a base node width associated with the node, for each node, calculates a first correction width associated with the node if the node ends a line, for each node, calculates a second correction width associated with the node if the node begins a line, and calculates a length of a line consisting of a sequence of nodes, the calculated length being equal to the total sum of base node widths for the nodes in the sequence, plus the first correction width associated with a last node in the sequence of nodes, plus the second correction width associated with a first node in the sequence of nodes.
Parent Case Info
[0001] This application is a continuation of U.S. application Ser. No. 10/181,882, filed Jul. 22, 2002, which was the National Stage of International Application No. PCT/US00/35134, filed Dec. 22, 2000, which claims priority to U.S. Provisional Application No. 60/252,863, filed Nov. 22, 2000. This application claims priority from each of the above-referenced applications, each of which is incorporated herein by reference.
Provisional Applications (1)
|
Number |
Date |
Country |
|
60252863 |
Nov 2000 |
US |
Continuations (1)
|
Number |
Date |
Country |
Parent |
10181882 |
Jul 2002 |
US |
Child |
10402785 |
Mar 2003 |
US |