1. A method comprising: outputting, via a processing device, at a first zoom level, and in a first text layout comprising lines of characters, a first portion of an electronic document on a display of an electronic reading device, wherein the electronic document contains text with base characters and corresponding ruby characters, and wherein the first text layout comprises a first base character at a first position in the first text layout and a corresponding first ruby character at a second position in the first text layout; receiving, via the processing device, a command to change from the first zoom level to a second zoom level; determining, via the processing device and for the second zoom level, a second text layout, wherein the second text layout comprises the first base character at a third position in the second text layout and the corresponding first ruby character at a fourth position in the second text layout; and identifying, via the processing device, additional changes to positions of the first base character and the first ruby character in the second text layout based at least in part on line boundary rules associated with the ruby character at the fourth position; modifying the second text layout based at least in part on the additional changes to the position of the first base character and the first ruby character; and updating the display of the electronic reading device to output a second portion of the electronic document at the second zoom level and in the second text layout.
1. A method comprising: outputting, via a processing device, at a first zoom level, and in a first text layout comprising lines of characters, a first portion of an electronic document on a display of an electronic reading device, wherein the electronic document contains text with base characters and corresponding ruby characters, and wherein the first text layout comprises a first base character at a first position in the first text layout and a corresponding first ruby character at a second position in the first text layout; receiving, via the processing device, a command to change from the first zoom level to a second zoom level; determining, via the processing device and for the second zoom level, a second text layout, wherein the second text layout comprises the first base character at a third position in the second text layout and the corresponding first ruby character at a fourth position in the second text layout; and identifying, via the processing device, additional changes to positions of the first base character and the first ruby character in the second text layout based at least in part on line boundary rules associated with the ruby character at the fourth position; modifying the second text layout based at least in part on the additional changes to the position of the first base character and the first ruby character; and updating the display of the electronic reading device to output a second portion of the electronic document at the second zoom level and in the second text layout. 2. The method of claim 1 , wherein modifying the second text layout based at least in part on line boundary rules further comprises: identifying, at a line boundary, a group of ruby characters associated with a base character, wherein the group of ruby characters is longer than the base character; and adjusting positions of the base character and the group of ruby characters so that the group of ruby characters aligns with an adjacent margin and the base character is centered with the group of ruby characters.