Dynamic text adjustment in a user interface element
First Claim
1. A method for selecting a font size for text displayed in a display region, comprising:
- detecting a height and a width of the display region;
determining a height and a width of an initial text region defining a minimum region required for displaying the text using a default font size;
defining a plurality of adjusted text regions of different sizes, each adjusted text region comprising a height and a width, wherein;
the height of each of the plurality of adjusted text regions corresponds to a different number of lines of text within the adjusted text region; and
the width of each of the plurality of adjusted text regions corresponds to the width of the initial text region reduced by a reduction amount corresponding to the number of lines within the adjusted text region;
identifying, for each of the plurality of adjusted text regions, the smaller of the ratio of the height of the display region over the height of the adjusted text region and the ratio of the width of the display region over the width of the adjusted text region;
identifying the one of the plurality of adjusted text regions having the largest of the identified smaller ratios; and
displaying the text in the display region using a reduced font size corresponding to the default font size reduced by the reduction amount of the identified one of the adjusted text regions.
1 Assignment
0 Petitions
Accused Products
Abstract
This is directed to efficiently identifying alternative display attributes for displaying text in a display region when default display attributes are inadequate for displaying the text. Many electronic device user interfaces are designed based on text in a default language. When interfaces are translated for use in other languages, the translated interfaces can include words or phrases that are longer than the corresponding text in the initial language. To quickly find an adequate, alternate display attribute for the longer text (e.g., a new font size), the electronic device can calculate assumed reduced text box sizes for displaying the text should display attributes of the text be reduced. The electronic device can select an adequate reduced text box, and reduce the display attributes by an amount corresponding to the reduced text box.
23 Citations
18 Claims
-
1. A method for selecting a font size for text displayed in a display region, comprising:
-
detecting a height and a width of the display region; determining a height and a width of an initial text region defining a minimum region required for displaying the text using a default font size; defining a plurality of adjusted text regions of different sizes, each adjusted text region comprising a height and a width, wherein; the height of each of the plurality of adjusted text regions corresponds to a different number of lines of text within the adjusted text region; and the width of each of the plurality of adjusted text regions corresponds to the width of the initial text region reduced by a reduction amount corresponding to the number of lines within the adjusted text region; identifying, for each of the plurality of adjusted text regions, the smaller of the ratio of the height of the display region over the height of the adjusted text region and the ratio of the width of the display region over the width of the adjusted text region; identifying the one of the plurality of adjusted text regions having the largest of the identified smaller ratios; and displaying the text in the display region using a reduced font size corresponding to the default font size reduced by the reduction amount of the identified one of the adjusted text regions. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. An electronic device for determining a display attribute for displaying text in a display region, comprising:
-
a memory; a display unit coupled to the memory; and one or more processors coupled to the memory and the display and adapted to execute instructions stored in the memory, the instructions adapted to cause the one or more processors to— receive text; identify a display region having an initial width and height in which to display the text using default display attributes; determine that the text does not fit within the identified display region using the default display attributes; define an initial characteristic width and height, corresponding to a smallest region in which the text can fit in one line using the default display attributes; define at least one subsequent characteristic width and height, each corresponding to a number of lines over which to wrap the text, wherein— each subsequent characteristic width has a value equal to the initial width multiplied by a reduction amount raised to a power equal to the subsequent characteristic width'"'"'s corresponding number of lines, and each subsequent characteristic height has a value equal to the initial height multiplied by the subsequent characteristic height'"'"'s corresponding number of lines multiplied by the reduction amount raised to a power equal to one less than the subsequent height'"'"'s corresponding number of lines; identify the at least one subsequent characteristic width and height having a largest value for an attribute function applied to the at least one subsequent characteristic-width and height; retrieve display attributes corresponding to the identified at least one subsequent characteristic width and height; and display, using the retrieved display attributes, the text on the display unit in a location corresponding to the display region. - View Dependent Claims (10, 11)
-
-
12. A method for selecting display attributes for text displayed in a display region, comprising:
-
detecting a characteristic dimension of the display region; defining a first text box, wherein the text is displayed in the first text box on one line and wherein the first text box is characterized by a first characteristic dimension; defining a second text box having a different size than the first text box, wherein the text is displayed on two lines in the second text box and wherein the second text box is characterized by a second characteristic dimension equal to the first characteristic dimension reduced by a reduction amount; defining a third text box having a different size than the first text box and the second text box, wherein the text is displayed on three lines in the third text box and wherein the third text box is characterized by a third characteristic dimension equal to the second characteristic dimension reduced by the reduction amount; identifying the largest ratio of the characteristic dimension of the display region over the first characteristic dimension, the characteristic dimension of the display region over the second characteristic dimension, and the characteristic dimension of the display region over the third characteristic dimension; and displaying, in the display region, the text using display attributes associated with the one of the first text box, second text box and third text box that corresponds to the characteristic dimension of the identified largest ratio. - View Dependent Claims (13, 14, 15, 16, 17)
-
-
18. A non-transitory program storage device for selecting a font size for text displayed in a display region, the program storage device comprising computer program logic recorded thereon for:
-
detecting a height and a width of the display region; determining a height and a width of an initial text region defining a minimum region required for displaying the text using a default font size; defining a plurality of adjusted text regions of different sizes, each adjusted text region comprising a height and a width, wherein; the height of each of the plurality of adjusted text regions corresponds to a different number of lines of text within the adjusted text region; and the width of each of the plurality of adjusted text regions corresponds to the width of the initial text region reduced by a reduction amount corresponding to the number of lines within the adjusted text region; identifying, for each of the plurality of adjusted text regions, the smaller of the ratio of the height of the display region over the height of the adjusted text region and the ratio of the width of the display region over the width of the adjusted text region; identifying the one of the plurality of adjusted text regions having the largest of the identified smaller ratios; and displaying the text in the display region using a reduced font size corresponding to the default font size reduced by the reduction amount of the identified one of the adjusted text regions.
-
Specification