File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -894,13 +894,16 @@ FT2Font::compute_string_bbox( ) {
894894 bbox.xMin = bbox.yMin = 32000 ;
895895 bbox.xMax = bbox.yMax = -32000 ;
896896
897+ int right_side = 0 ;
897898 for ( size_t n = 0 ; n < glyphs.size (); n++ ) {
898899 FT_BBox glyph_bbox;
899900 FT_Glyph_Get_CBox ( glyphs[n], ft_glyph_bbox_subpixels, &glyph_bbox );
900901 if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin ;
901902 if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin ;
902903 if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax ;
903904 if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax ;
905+ right_side += glyphs[n]->advance .x >> 10 ;
906+ if ( right_side > bbox.xMax ) bbox.xMax = right_side;
904907 }
905908 /* check that we really grew the string bbox */
906909 if ( bbox.xMin > bbox.xMax ) {
You can’t perform that action at this time.
0 commit comments