Patent ID: 8452097

Claim:
An apparatus for extracting circumscribed rectangles of one or more characters in a transplantable electronic document, comprising: a command and resource extraction device configured to extract one or more text-segment-related commands and one or more original font resources corresponding to text segments in one or more pages of the transplantable electronic document; a division device configured to divide the original font resources into one or more fonts that need to be replaced, and one or more fonts that do not need to be replaced, in which the fonts that need to be replaced serve as fonts prepared to be replaced; a font replacement device configured to seek fonts most similar to the fonts prepared to be replaced based on the aspect of character shape measurement in an outer replacement font table as candidate fonts for replacing the fonts prepared to be replaced, and then let the candidate fonts and the fonts that do not need to be replaced make up font resources after font replacement; a measurement information extraction device configured to extract character shape measurement information of the characters in the text segments based on the font resources after font replacement; and a calculation device configured to calculate the circumscribed rectangles of the characters based on the text-segment-related commands and the character shape measurement information of the characters, wherein the font replacement device utilizes a matching approach to determine similarities between fonts in the outer replacement font table, prepared to be selected and the fonts prepared to be replaced based on the aspect of character shape measurement, and then lets the fonts prepared to be selected having highest similarities serve as the candidate fonts, wherein the font replacement device determines a similarity between a font prepared to be selected and a font prepared to be replaced based on a distance dis, calculated in equation (1) as follows, between the font prepared to be selected and the font prepared to be replaced: dis ⁡ ( X , Y ) = ∑ i = 1 n ⁢ w i ⁢  x i - y i  , ( 1 ) wherein X=(x 1 , x 2 , . . . , x n ) is a font attribute vector of the font prepared to be selected, x i refers to value of ith font attribute of the font prepared to be selected, Y=(y 1 , y 2 , . . . , y n ) is a font attribute vector of the font prepared to be replaced, y i ers to value of ith font attribute of the font prepared to be replaced, w i refers to a weight of the ith font attribute, n refers to a total number of adopted font attributes, and wherein a smaller distance dis between the font prepared to be selected and the font prepared to be replaced corresponds to a higher similarity between the font prepared to be selected and the font prepared to be replaced.