There's currently this function, set_font_with_fallback, that
almost always gets called with a NULL first argument in the
initramfs, forcing the _with_fallback part of the function to
run.
It's a little strange to have a function with a chunk of code that
hardly ever runs. Furthermore there's a bug where the error variable
is left uninitialized in this case leading to the freetype plugin
sporadically failing to load the fallback font.
This commit reworks things to drop set_font_with_fallback, and just
call FT_New_Face directly in the caller. Fallbacks are handled
at the point where the font path is determined
(previously called query_fc_match, now called find_default_font_path.
There are a few issues with the remove_hexboxes_from_pango_layout
function, where it's getting offsets wrong and things like that.
This commit changes the approach entirely. Rather than modifying
the text to remove characters without font converage, it just
changes out the glyphs for those characters to be white boxes.
Setting the console keyboard mode is not entirely idempotent.
The kernel may flush the input buffer leading to lost
key strokes. We currently set the mode explicitly on graphics
updates as part of our more general "fix things up in case
something during boot screws with the terminal settings" code.
That leads to keystrokes getting eaten.
This commit makes the terminal more careful about setting the
keyboard mode. It now only changes it when plymouth thinks its
necessary to do so.
In the future we could query the keyboard mode and reset it
when it's wrong, but I think we should hold off on doing that
until shown we need to.
We're currently facing a bug where keys have to be hit several
times to register for a user.
In order to make traction on that problem, this commit adds a
new plymouth.debug-key-events kernel command line option
to report in more detail the keyboard events coming in from the
terminal.
We don't need to flush the terminal input buffer on key events from
the renderers, because the terminal does that itself.
Also, we should disable the terminal input when a /dev/input
device is added instead of relying on it happening the next flush
period.
Finally, we should make sure the terminal gets reenabled on close,
just so we clean up after ourselves.
We're currently seeing a bug where it seems like the terminal might
be getting intermittently disabled.
This commit adds some logging to confirm or rule out that possibility.
This commit adds a new kernel command line option
plymouth.debug-escape-sequences that makes escape sequences stay
unparsed and instead get printed on the screen.
If code calls ply_label_get_width without ply_label_show or some other
call that forces the dimensions to be computed first, then the returned
width will be wrong.
This commit makes the freetype plugin look more like the pango plugin
where the size will computed on demand when querying the width, if
necessary.
If a file is a symlink, we usually want to follow it, so
testing the symlink itself, is less than optimal.
This commit switches to lstat instead of stat.
pango will give a height that's several orders of magnitude too
big sometimes when the width is -1.
This commit checks for -1, explicitly measures the width first, and
remeasures with that width passed in to compute the height.
There are still a number of places in the code where a console
viewer is expected, when it's totally possible that there won't
be one.
This commit runs through them, and does a few other style
cleanups on the way.
There are still a number of places in the code where a console
viewer is expected, when it's totally possible that there won't
be one.
This commit runs through them, and does a few other style
cleanups on the way.
There are still a number of places in the code where a console
viewer is expected, when it's totally possible that there won't
be one.
This commit runs through them, and does a few other style
cleanups on the way.
Right now we divide by zero if the font metrics can't be determined
and tank.
This commit attempts to detect the situation and fall back to using
kernel fb console in that case.
Right now we catch the two big types of crashes:
1. Segmentation fault
2. Assertion failure
But we don't catch another common type, "Divide by zero"
This commit fixes that.