Message ID | 20250505170021.29944-1-nico@fluxnic.net |
---|---|
Headers | show |
Series | vt: more Unicode handling changes | expand |
On 05. 05. 25, 18:55, Nicolas Pitre wrote: > From: Nicolas Pitre <npitre@baylibre.com> > > No logical changes. Make it easier for enhancements to come. ... > @@ -2984,12 +2985,40 @@ static int vc_process_ucs(struct vc_data *vc, int *c, int *tc) > return 0; > } > > +static int vc_get_glyph(struct vc_data *vc, int tc) > +{ > + int glyph = conv_uni_to_pc(vc, tc); > + int charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; Could you keep charmask unsigned? It used to be u16. > + > + if (!(glyph & ~charmask)) > + return glyph; > + > + if (glyph == -1) > + return -1; /* nothing to display */ > + > + /* Glyph not found */ > + Do no additional \n here ^^. > + if ((!vc->vc_utf || vc->vc_disp_ctrl || tc < 128) && !(tc & ~charmask)) { > + /* > + * In legacy mode use the glyph we get by a 1:1 mapping. > + * This would make absolutely no sense with Unicode in mind, > + * but do this for ASCII characters since a font may lack > + * Unicode mapping info and we don't want to end up with > + * having question marks only. Generally: feel free to use 100 characters per line. > + */ > + return tc; > + } > + > + /* Display U+FFFD (Unicode Replacement Character). */ > + return conv_uni_to_pc(vc, UCS_REPLACEMENT); > +} thanks,