File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -898,12 +898,15 @@ FT2Font::compute_string_bbox( ) {
898898 for ( size_t n = 0 ; n < glyphs.size (); n++ ) {
899899 FT_BBox glyph_bbox;
900900 FT_Glyph_Get_CBox ( glyphs[n], ft_glyph_bbox_subpixels, &glyph_bbox );
901- if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin ;
902- if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin ;
903- if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax ;
904- 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;
901+ if (glyph_bbox.xMin == glyph_bbox.xMax ) {
902+ right_side += glyphs[n]->advance .x >> 10 ;
903+ if ( right_side > bbox.xMax ) bbox.xMax = right_side;
904+ } else {
905+ if ( glyph_bbox.xMin < bbox.xMin ) bbox.xMin = glyph_bbox.xMin ;
906+ if ( glyph_bbox.yMin < bbox.yMin ) bbox.yMin = glyph_bbox.yMin ;
907+ if ( glyph_bbox.xMax > bbox.xMax ) bbox.xMax = glyph_bbox.xMax ;
908+ if ( glyph_bbox.yMax > bbox.yMax ) bbox.yMax = glyph_bbox.yMax ;
909+ }
907910 }
908911 /* check that we really grew the string bbox */
909912 if ( bbox.xMin > bbox.xMax ) {
You can’t perform that action at this time.
0 commit comments