Automated paragraph layout
AssigneeAdobe Systems Incorporated, a Delaware corporation
InventorsDavid E. Williamson, Eric A. Menninga
Life of this patent
Estimating the term…
Abstract
Methods and apparatus for calculating paragraph layout. A method begins with a first node in a paragraph and calculates an optimal line break scheme for paragraph layout that ended in the node. For every subsequent node in the paragraph, the method calculates an optimal line break scheme for paragraph layout that ends respectively in every subsequent node. 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 are defined by a previously calculated optimal line break scheme.
Claims21
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Dependencies are inferred from the claim text.