JXSQGDJPUCHCI46LU3CMARIDRXI7DN2QLVLM3C55APMTBXFKXV7QC L4J562JRQTGQ3XRGDTTG7II5JBNG5OVRK4CGHIA2CB54YSRIF2WQC KLGRQAFUQPJP75NVLS5MZZ3CY4TGNVGB4K2YHQSLYVGAPKCLBLUAC 3E7ON5LK5KELT7NX7O2DRSVSQQGVW3HU3LFTQGGCJ5PIRZDWD56QC NBT2QCONKZ2E5I7HIQJUNQAUNJA6RPYYTUVZQCT6Z6ABU42A277AC I3F42XELTBNGNFJGKEDBRYU75HHQX2CHMWPEIEMXAGU2FFHQVHKAC TWBSX7IMMGO6G6CEEMPQZHBVDG4XHDMHL6FEAKOH34ILJJNMRUIQC LBHZM2SE7L7M7KML6DN5HP65HP2XRKJBOHHH3IRX4RCLRNYS7CWAC FJVNPRZD2CQHHDZMFTPW57J3QR3HOF7B5ONBDTPGRBGNJOXU36WAC XTYFIHM6F5QCIGESYIWC5PLHKKA3JE5XZAXTPILYZTSGVMOU7BCAC fn shape(plans: &mut Plans,index: FontIndex,font: &rustybuzz::Face,mut ubuf: UnicodeBuffer,) -> GlyphBuffer {
fn shape(plans: &mut Plans, index: FontIndex, font: &rustybuzz::Face, text: &str) -> GlyphBuffer {let mut ubuf = UnicodeBuffer::new();ubuf.push_str(text);
let res = self.cache.entry(line.clone()).or_insert_with(|| {let mut res = Vec::new();let mut font = 0;let slice: &[json_ui::Atom] = &line;
let mut res = Vec::new();let mut font = 0;let slice: &[json_ui::Atom] = &line;
for atom in slice {let mut ubuf = UnicodeBuffer::new();for c in atom.contents.chars() {let Some(curr_font) = self.fonts
for atom in slice {let mut text = String::new();for c in atom.contents.chars() {let Some(curr_font) = (if self.fonts[font].1.unicode_ranges().contains_char(c) {Some(font)} else {self.fonts
else {// TODO: Render fallback character// For new we'll just use a standinubuf.add('⋄', 2);continue;
}) else {// TODO: Render fallback character// For new we'll just use a standintext.push('⋄');continue;};if font != curr_font {let rb_font = &self.fonts[font].1;let glyph_buffer = shape(&mut self.plans, font, rb_font, &text);let run = Run {fg: atom.face.fg.to_rgba(config).unwrap_or(default_fg),bg: atom.face.bg.to_rgba(config),font_size,font,glyph_buffer,upe: rb_font.units_per_em(),
if font != curr_font {let rb_font = &self.fonts[font].1;let glyph_buffer = shape(&mut self.plans, font, rb_font, ubuf);ubuf = UnicodeBuffer::new();res.push(Run {fg: atom.face.fg.to_rgba(config).unwrap_or(default_fg),bg: atom.face.bg.to_rgba(config),font_size,font,glyph_buffer,upe: rb_font.units_per_em(),});font = curr_font;}if c == '\n' {ubuf.add(' ', 2);} else {ubuf.add(c, 2);}
text.clear();res.push(run);font = curr_font;
let rb_font = &self.fonts[font].1;let glyph_buffer = shape(&mut self.plans, font, rb_font, ubuf);res.push(Run {fg: atom.face.fg.to_rgba(config).unwrap_or(default_fg),bg: atom.face.bg.to_rgba(config),font_size,font,glyph_buffer,upe: rb_font.units_per_em(),});
if c == '\n' {text.push(' ');} else {text.push(c);}
(true, res.into())});res.0 = true;res.1.clone()}fn clear_cache(&mut self) {self.cache.retain(|_, v| {let used = v.0;v.0 = false;used})
let rb_font = &self.fonts[font].1;let glyph_buffer = shape(&mut self.plans, font, rb_font, &text);let run = Run {fg: atom.face.fg.to_rgba(config).unwrap_or(default_fg),bg: atom.face.bg.to_rgba(config),font_size,font,glyph_buffer,upe: rb_font.units_per_em(),};res.push(run);}res.into()