id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc,mlocked
3584,Don't pre-cache glyphs for non-displayable control chars,sphery ,stuartm,"The attached patch changes the OSD to skip pre-caching of glyphs for the C0 (0-31) and C1 (127-159) control characters. Since they are non-displayable characters, they shouldn't have any glyphs, so we're just caching 65 copies of the ""no glyph"" rectangle for each font.
Upon playback startup, my machine creates 120 fonts and pre-caches the glyphs for the first 256 characters of each, regardless of whether they're already cached elsewhere. Therefore, skipping 65 non-displayable glyphs for 120 fonts saves caching 7800 glyphs that likely won't be used.
If the glyph is later requested, it will be cached at that point, so this won't create issues if any of these characters are actually used. However, after applying this patch to my working copy, the only glyph that was ever requested from this range (in almost 2 weeks of admittedly 8859-1-centric use with captions enabled) is that for U+000a (linefeed). While we could just pre-cache that glyph, it's not used in all programs, so it makes more sense to me to let it be cached upon request.
While the fact that these characters (or at least the C1 control characters) are non-displayable may be specific to 8859-n encodings, the idea of pre-caching the first 256 glyphs from the font is probably equally 8859-n (or possibly even 8859-1) specific. And, since the glyphs will be cached on request, it doesn't hurt to skip pre-caching them. As a matter of fact, chances are that if one of these glyphs is requested, it will only be for the font that's actually being used (i.e. the VBI CC font or the OSD font or ...) rather than caching the glyph for each of the 120 fonts that may be used during playback.
Note that my machine was set to use FreeSans for /all/ caption fonts, including the ATSC mono/serif/sans in regular/italic/bold/oblique and was using the Retro-OSD theme. Therefore, only 3 unique fonts, Bitstream Vera Sans (Bold), Bitstream Vera Sans (Roman), and FreeSans (Medium), were actually used even though 120 were created (although some may have been different sizes).
",patch,closed,minor,0.21,mythtv,head,medium,fixed,,,0