Changeset - r27802:31cc64ccda2d
[Not reviewed]
master
0 1 0
Jonathan G Rennison - 10 months ago 2023-08-16 19:17:02
j.g.rennison@gmail.com
Fix #11203: [ICU] Glyph to char mapping with multiple runs (#11204)
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/gfx_layout_icu.cpp
Show inline comments
 
@@ -203,13 +203,13 @@ void ICURun::Shape(UChar *buff, size_t b
 
			this->glyphs.push_back(glyph_info[i].codepoint);
 
			this->positions.push_back(glyph_pos[i].x_offset / FONT_SCALE + advance);
 
			this->positions.push_back(glyph_pos[i].y_offset / FONT_SCALE);
 
			x_advance = glyph_pos[i].x_advance / FONT_SCALE;
 
		}
 

	
 
		this->glyph_to_char.push_back(glyph_info[i].cluster - this->start);
 
		this->glyph_to_char.push_back(glyph_info[i].cluster);
 
		this->advance.push_back(x_advance);
 
		advance += x_advance;
 
	}
 

	
 
	/* Position has one more element to close off the array. */
 
	this->positions.push_back(advance);
 
@@ -462,13 +462,13 @@ std::unique_ptr<const ICUParagraphLayout
 
			 * the only run on this line. So we remove the run. */
 
			last_run--;
 
		} else {
 
			/* There is no suitable line-break and this is the only run on the
 
			 * line. So we break at the cluster. This is not pretty, but the
 
			 * best we can do. */
 
			new_partial_length = char_pos - this->partial_offset;
 
			new_partial_length = char_pos - overflow_run->start - this->partial_offset;
 
		}
 
	}
 

	
 
	/* Reorder the runs on this line for display. */
 
	std::vector<UBiDiLevel> bidi_level;
 
	for (auto run = start_run; run != last_run; run++) {
0 comments (0 inline, 0 general)