摘要 |
A method for improving rendering speed of a browser page is disclosed. The method includes: setting an initial state of the rendering operation; segmenting, from the beginning of the first character of a character string, the character string based on the character font, and calculating the character width of each segment by using the font library; obtaining the width of the character string by adding up the character width of each segment; displaying the character string based on the obtained width. A device for improving rendering speed of a browser page is also disclosed. The method and device reduce the number of times of calling the font library interface function to calculate the character width, thus reduce the resource overhead caused thereby and improve the efficiency of calculating the character width. |