Changeset - r28504:922ec220613a
[Not reviewed]
master
0 1 0
Patric Stout - 11 months ago 2024-01-18 08:34:56
truebrain@openttd.org
Fix: [HarfBuzz] make HarfBuzz use the same glyphs as we render
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/gfx_layout_icu.cpp
Show inline comments
 
@@ -154,12 +154,14 @@ ICUParagraphLayout::ICUVisualRun::ICUVis
 
 * @param buff The buffer of which a partial (depending on start/length of the run) will be shaped.
 
 * @param length The length of the buffer.
 
 */
 
void ICURun::Shape(UChar *buff, size_t buff_length)
 
{
 
	auto hbfont = hb_ft_font_create_referenced(*(static_cast<const FT_Face *>(font->fc->GetOSHandle())));
 
	/* Match the flags with how we render the glyphs. */
 
	hb_ft_font_set_load_flags(hbfont, GetFontAAState(this->font->fc->GetSize()) ? FT_LOAD_TARGET_NORMAL : FT_LOAD_TARGET_MONO);
 

	
 
	/* ICU buffer is in UTF-16. */
 
	auto hbbuf = hb_buffer_create();
 
	hb_buffer_add_utf16(hbbuf, reinterpret_cast<uint16_t *>(buff), buff_length, this->start, this->length);
 

	
 
	/* Set all the properties of this segment. */
0 comments (0 inline, 0 general)