recovery: change font for menus to be an image
Instead of representing the font used for menus and log messages in the recovery binary, load it from a resource PNG image. This allows different devices to substitute their own font images. Change-Id: Ib36b86db3d01298aa7ae2b62a26ca29e6ef18014
This commit is contained in:
parent
869abf03e2
commit
55a36ac1e0
5 changed files with 38 additions and 255 deletions
|
@ -1,214 +0,0 @@
|
||||||
struct {
|
|
||||||
unsigned width;
|
|
||||||
unsigned height;
|
|
||||||
unsigned cwidth;
|
|
||||||
unsigned cheight;
|
|
||||||
unsigned char rundata[];
|
|
||||||
} font = {
|
|
||||||
.width = 960,
|
|
||||||
.height = 18,
|
|
||||||
.cwidth = 10,
|
|
||||||
.cheight = 18,
|
|
||||||
.rundata = {
|
|
||||||
0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x55,0x82,0x06,0x82,0x02,0x82,0x10,0x82,
|
|
||||||
0x11,0x83,0x08,0x82,0x0a,0x82,0x04,0x82,0x46,0x82,0x08,0x82,0x07,0x84,0x06,
|
|
||||||
0x84,0x0a,0x81,0x03,0x88,0x04,0x84,0x04,0x88,0x04,0x84,0x06,0x84,0x1e,0x81,
|
|
||||||
0x0e,0x81,0x0a,0x84,0x06,0x84,0x07,0x82,0x05,0x85,0x07,0x84,0x04,0x86,0x04,
|
|
||||||
0x88,0x02,0x88,0x04,0x84,0x04,0x82,0x04,0x82,0x02,0x88,0x05,0x86,0x01,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x04,0x84,0x04,
|
|
||||||
0x86,0x06,0x84,0x04,0x86,0x06,0x84,0x04,0x88,0x02,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,
|
|
||||||
0x88,0x03,0x86,0x0e,0x86,0x06,0x82,0x11,0x82,0x10,0x82,0x18,0x82,0x0f,0x84,
|
|
||||||
0x0d,0x82,0x1c,0x82,0x09,0x84,0x7f,0x16,0x84,0x05,0x82,0x05,0x84,0x07,0x83,
|
|
||||||
0x02,0x82,0x19,0x82,0x06,0x82,0x02,0x82,0x06,0x82,0x01,0x82,0x03,0x86,0x04,
|
|
||||||
0x83,0x02,0x82,0x03,0x82,0x01,0x82,0x07,0x82,0x09,0x82,0x06,0x82,0x3e,0x82,
|
|
||||||
0x04,0x84,0x06,0x83,0x06,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x03,
|
|
||||||
0x82,0x09,0x82,0x02,0x82,0x09,0x82,0x03,0x82,0x02,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x1c,0x82,0x0e,0x82,0x08,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x05,0x84,0x04,
|
|
||||||
0x82,0x02,0x82,0x05,0x82,0x02,0x82,0x03,0x82,0x03,0x82,0x03,0x82,0x08,0x82,
|
|
||||||
0x09,0x82,0x02,0x82,0x03,0x82,0x04,0x82,0x05,0x82,0x0a,0x82,0x03,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x83,0x03,0x82,0x03,0x82,0x02,0x82,
|
|
||||||
0x03,0x82,0x03,0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x03,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x06,0x82,0x05,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x08,0x82,0x03,0x82,0x08,0x82,0x0c,
|
|
||||||
0x82,0x05,0x84,0x11,0x82,0x0f,0x82,0x18,0x82,0x0e,0x82,0x02,0x82,0x0c,0x82,
|
|
||||||
0x1c,0x82,0x0b,0x82,0x7f,0x15,0x82,0x08,0x82,0x08,0x82,0x05,0x82,0x01,0x82,
|
|
||||||
0x01,0x82,0x19,0x82,0x06,0x82,0x02,0x82,0x06,0x82,0x01,0x82,0x02,0x82,0x01,
|
|
||||||
0x82,0x01,0x82,0x02,0x82,0x01,0x82,0x01,0x82,0x03,0x82,0x01,0x82,0x07,0x82,
|
|
||||||
0x08,0x82,0x08,0x82,0x3d,0x82,0x03,0x82,0x02,0x82,0x04,0x84,0x05,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x06,0x83,0x03,0x82,0x08,0x82,0x04,0x81,0x09,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x1a,0x82,0x10,0x82,0x06,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x03,0x82,0x03,0x82,0x03,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x08,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x04,0x82,0x05,0x82,0x0a,0x82,0x03,0x82,0x03,0x82,0x03,0x82,0x08,0x83,
|
|
||||||
0x02,0x83,0x02,0x83,0x03,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x05,0x82,0x05,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x09,0x82,0x03,0x82,0x08,0x82,0x0c,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x11,0x82,0x0e,0x82,0x18,0x82,0x0e,0x82,0x02,0x82,0x0c,0x82,0x0b,0x82,0x0b,
|
|
||||||
0x82,0x02,0x82,0x0b,0x82,0x4d,0x82,0x45,0x82,0x08,0x82,0x08,0x82,0x05,0x82,
|
|
||||||
0x02,0x83,0x1a,0x82,0x07,0x81,0x02,0x81,0x07,0x82,0x01,0x82,0x02,0x82,0x01,
|
|
||||||
0x82,0x05,0x82,0x01,0x84,0x04,0x82,0x01,0x82,0x07,0x82,0x08,0x82,0x08,0x82,
|
|
||||||
0x06,0x82,0x02,0x82,0x06,0x82,0x28,0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x01,
|
|
||||||
0x82,0x05,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x05,0x84,0x03,0x82,0x08,0x82,
|
|
||||||
0x0d,0x82,0x03,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x19,0x82,0x12,0x82,0x05,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x02,0x84,0x03,0x82,0x02,0x82,0x03,0x82,0x03,0x82,
|
|
||||||
0x03,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x08,0x82,0x08,0x82,0x04,
|
|
||||||
0x82,0x05,0x82,0x0a,0x82,0x03,0x82,0x03,0x82,0x03,0x82,0x08,0x83,0x02,0x83,
|
|
||||||
0x02,0x84,0x02,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x0b,0x82,0x05,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,
|
|
||||||
0x82,0x04,0x82,0x09,0x82,0x0b,0x82,0x03,0x82,0x04,0x82,0x20,0x82,0x18,0x82,
|
|
||||||
0x0e,0x82,0x10,0x82,0x0b,0x82,0x0b,0x82,0x02,0x82,0x0b,0x82,0x4d,0x82,0x45,
|
|
||||||
0x82,0x08,0x82,0x08,0x82,0x26,0x82,0x10,0x88,0x01,0x82,0x01,0x82,0x06,0x83,
|
|
||||||
0x01,0x82,0x04,0x84,0x08,0x81,0x08,0x82,0x0a,0x82,0x05,0x82,0x02,0x82,0x06,
|
|
||||||
0x82,0x28,0x82,0x03,0x82,0x04,0x82,0x05,0x82,0x0b,0x82,0x08,0x82,0x04,0x82,
|
|
||||||
0x01,0x82,0x03,0x82,0x08,0x82,0x0d,0x82,0x03,0x82,0x04,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x18,0x82,0x06,0x88,0x06,0x82,0x04,0x82,0x04,0x82,0x02,0x82,0x01,0x85,
|
|
||||||
0x02,0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x03,0x82,0x08,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x08,0x82,0x08,0x82,0x08,0x82,0x04,0x82,0x05,0x82,0x0a,0x82,0x03,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x08,0x88,0x02,0x84,0x02,0x82,0x02,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x0b,0x82,
|
|
||||||
0x05,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x03,0x82,0x04,0x82,0x04,0x84,0x06,
|
|
||||||
0x84,0x08,0x82,0x05,0x82,0x09,0x82,0x0b,0x82,0x2b,0x82,0x18,0x82,0x0e,0x82,
|
|
||||||
0x10,0x82,0x1c,0x82,0x0b,0x82,0x4d,0x82,0x45,0x82,0x08,0x82,0x08,0x82,0x26,
|
|
||||||
0x82,0x11,0x82,0x01,0x82,0x03,0x82,0x01,0x82,0x09,0x82,0x06,0x82,0x12,0x82,
|
|
||||||
0x0a,0x82,0x06,0x84,0x07,0x82,0x27,0x82,0x04,0x82,0x04,0x82,0x05,0x82,0x0b,
|
|
||||||
0x82,0x07,0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x01,0x83,0x04,0x82,0x01,0x83,
|
|
||||||
0x08,0x82,0x05,0x82,0x02,0x82,0x03,0x82,0x04,0x82,0x05,0x83,0x07,0x83,0x05,
|
|
||||||
0x82,0x16,0x82,0x08,0x82,0x03,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x02,0x82,0x02,0x82,0x04,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x08,
|
|
||||||
0x82,0x08,0x82,0x04,0x82,0x05,0x82,0x0a,0x82,0x03,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x08,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,
|
|
||||||
0x0a,0x82,0x05,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x03,0x82,0x01,0x82,0x01,
|
|
||||||
0x82,0x04,0x84,0x06,0x84,0x08,0x82,0x05,0x82,0x0a,0x82,0x0a,0x82,0x23,0x85,
|
|
||||||
0x03,0x82,0x01,0x83,0x06,0x85,0x05,0x83,0x01,0x82,0x04,0x84,0x04,0x86,0x05,
|
|
||||||
0x85,0x01,0x81,0x02,0x82,0x01,0x83,0x05,0x84,0x09,0x84,0x02,0x82,0x03,0x82,
|
|
||||||
0x06,0x82,0x05,0x81,0x01,0x82,0x01,0x82,0x03,0x82,0x01,0x83,0x06,0x84,0x04,
|
|
||||||
0x82,0x01,0x83,0x06,0x83,0x01,0x82,0x02,0x82,0x01,0x84,0x04,0x86,0x03,0x86,
|
|
||||||
0x04,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x03,0x87,0x05,0x82,0x08,0x82,0x08,0x82,0x26,0x82,
|
|
||||||
0x11,0x82,0x01,0x82,0x04,0x86,0x07,0x82,0x05,0x83,0x12,0x82,0x0a,0x82,0x04,
|
|
||||||
0x88,0x02,0x88,0x0c,0x88,0x10,0x82,0x04,0x82,0x04,0x82,0x05,0x82,0x0a,0x82,
|
|
||||||
0x06,0x83,0x04,0x82,0x03,0x82,0x03,0x83,0x02,0x82,0x03,0x83,0x02,0x82,0x07,
|
|
||||||
0x82,0x06,0x84,0x05,0x82,0x02,0x83,0x05,0x83,0x07,0x83,0x04,0x82,0x18,0x82,
|
|
||||||
0x06,0x82,0x04,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x02,0x86,0x04,
|
|
||||||
0x82,0x08,0x82,0x04,0x82,0x02,0x86,0x04,0x86,0x04,0x82,0x02,0x84,0x02,0x88,
|
|
||||||
0x05,0x82,0x0a,0x82,0x03,0x85,0x05,0x82,0x08,0x82,0x01,0x82,0x01,0x82,0x02,
|
|
||||||
0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x03,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x03,0x82,0x05,0x84,0x07,0x82,0x05,0x82,0x04,0x82,0x03,
|
|
||||||
0x82,0x02,0x82,0x03,0x82,0x01,0x82,0x01,0x82,0x05,0x82,0x08,0x82,0x08,0x82,
|
|
||||||
0x06,0x82,0x0a,0x82,0x0a,0x82,0x22,0x82,0x03,0x82,0x02,0x83,0x02,0x82,0x04,
|
|
||||||
0x82,0x03,0x82,0x03,0x82,0x02,0x83,0x03,0x82,0x02,0x82,0x05,0x82,0x06,0x82,
|
|
||||||
0x03,0x83,0x02,0x83,0x02,0x82,0x06,0x82,0x0b,0x82,0x02,0x82,0x02,0x82,0x07,
|
|
||||||
0x82,0x05,0x88,0x02,0x83,0x02,0x82,0x04,0x82,0x02,0x82,0x03,0x83,0x02,0x82,
|
|
||||||
0x04,0x82,0x02,0x83,0x03,0x83,0x02,0x82,0x02,0x82,0x04,0x82,0x04,0x82,0x06,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x02,0x82,
|
|
||||||
0x03,0x82,0x04,0x82,0x08,0x82,0x02,0x84,0x09,0x82,0x09,0x84,0x23,0x82,0x11,
|
|
||||||
0x82,0x01,0x82,0x06,0x82,0x01,0x82,0x05,0x82,0x05,0x82,0x01,0x82,0x11,0x82,
|
|
||||||
0x0a,0x82,0x06,0x84,0x07,0x82,0x26,0x82,0x05,0x82,0x04,0x82,0x05,0x82,0x08,
|
|
||||||
0x83,0x09,0x82,0x03,0x82,0x03,0x82,0x09,0x82,0x02,0x82,0x04,0x82,0x05,0x82,
|
|
||||||
0x06,0x82,0x02,0x82,0x05,0x83,0x01,0x82,0x17,0x82,0x16,0x82,0x06,0x82,0x05,
|
|
||||||
0x82,0x01,0x82,0x01,0x82,0x02,0x88,0x02,0x82,0x03,0x82,0x03,0x82,0x08,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x08,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x05,
|
|
||||||
0x82,0x0a,0x82,0x03,0x82,0x02,0x82,0x04,0x82,0x08,0x82,0x01,0x82,0x01,0x82,
|
|
||||||
0x02,0x82,0x02,0x84,0x02,0x82,0x04,0x82,0x02,0x86,0x04,0x82,0x04,0x82,0x02,
|
|
||||||
0x86,0x09,0x82,0x06,0x82,0x05,0x82,0x04,0x82,0x04,0x84,0x04,0x82,0x01,0x82,
|
|
||||||
0x01,0x82,0x04,0x84,0x07,0x82,0x07,0x82,0x07,0x82,0x0b,0x82,0x09,0x82,0x27,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x04,0x82,0x06,0x82,0x03,0x82,0x03,0x82,0x04,0x82,0x05,0x82,0x0b,0x82,0x02,
|
|
||||||
0x82,0x01,0x82,0x08,0x82,0x05,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x07,
|
|
||||||
0x82,0x0a,0x82,0x06,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x03,0x82,0x04,0x82,
|
|
||||||
0x04,0x84,0x04,0x82,0x04,0x82,0x07,0x82,0x06,0x82,0x08,0x82,0x08,0x82,0x26,
|
|
||||||
0x82,0x0f,0x88,0x05,0x82,0x01,0x82,0x05,0x82,0x05,0x82,0x02,0x82,0x01,0x82,
|
|
||||||
0x0d,0x82,0x0a,0x82,0x05,0x82,0x02,0x82,0x06,0x82,0x26,0x82,0x05,0x82,0x04,
|
|
||||||
0x82,0x05,0x82,0x07,0x82,0x0c,0x82,0x02,0x88,0x08,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x05,0x82,0x05,0x82,0x04,0x82,0x08,0x82,0x18,0x82,0x14,0x82,0x07,0x82,0x05,
|
|
||||||
0x82,0x01,0x84,0x03,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x08,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x05,
|
|
||||||
0x82,0x0a,0x82,0x03,0x82,0x02,0x82,0x04,0x82,0x08,0x82,0x01,0x82,0x01,0x82,
|
|
||||||
0x02,0x82,0x02,0x84,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x02,0x82,0x0a,0x82,0x05,0x82,0x05,0x82,0x04,0x82,0x04,0x84,0x04,0x82,
|
|
||||||
0x01,0x82,0x01,0x82,0x04,0x84,0x07,0x82,0x07,0x82,0x07,0x82,0x0b,0x82,0x09,
|
|
||||||
0x82,0x22,0x87,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x88,
|
|
||||||
0x04,0x82,0x06,0x82,0x03,0x82,0x03,0x82,0x04,0x82,0x05,0x82,0x0b,0x82,0x02,
|
|
||||||
0x84,0x09,0x82,0x05,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x08,0x86,0x05,
|
|
||||||
0x82,0x06,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x03,0x82,0x01,0x82,0x01,0x82,
|
|
||||||
0x05,0x82,0x05,0x82,0x04,0x82,0x06,0x82,0x07,0x82,0x08,0x82,0x08,0x82,0x26,
|
|
||||||
0x82,0x10,0x82,0x01,0x82,0x07,0x82,0x01,0x82,0x04,0x82,0x01,0x83,0x02,0x82,
|
|
||||||
0x03,0x83,0x0f,0x82,0x08,0x82,0x06,0x82,0x02,0x82,0x06,0x82,0x25,0x82,0x07,
|
|
||||||
0x82,0x02,0x82,0x06,0x82,0x06,0x82,0x07,0x82,0x04,0x82,0x07,0x82,0x09,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x04,0x82,0x06,0x82,0x04,0x82,0x08,0x82,0x19,0x82,0x05,
|
|
||||||
0x88,0x05,0x82,0x08,0x82,0x05,0x82,0x02,0x82,0x04,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x08,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x05,0x82,0x05,0x82,0x03,0x82,0x03,0x82,0x03,0x82,
|
|
||||||
0x03,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x03,0x83,0x02,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x08,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x03,0x82,0x09,0x82,0x05,0x82,
|
|
||||||
0x05,0x82,0x04,0x82,0x04,0x84,0x04,0x83,0x02,0x83,0x03,0x82,0x02,0x82,0x06,
|
|
||||||
0x82,0x06,0x82,0x08,0x82,0x0c,0x82,0x08,0x82,0x21,0x82,0x04,0x82,0x02,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x0a,0x82,0x06,0x82,0x03,
|
|
||||||
0x82,0x03,0x82,0x04,0x82,0x05,0x82,0x0b,0x82,0x02,0x85,0x08,0x82,0x05,0x82,
|
|
||||||
0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x0d,0x82,0x04,0x82,0x06,0x82,0x04,0x82,
|
|
||||||
0x04,0x84,0x04,0x82,0x01,0x82,0x01,0x82,0x05,0x82,0x05,0x82,0x04,0x82,0x05,
|
|
||||||
0x82,0x08,0x82,0x08,0x82,0x08,0x82,0x38,0x82,0x01,0x82,0x04,0x82,0x01,0x82,
|
|
||||||
0x01,0x82,0x04,0x84,0x01,0x82,0x01,0x82,0x03,0x82,0x10,0x82,0x08,0x82,0x30,
|
|
||||||
0x83,0x06,0x82,0x07,0x82,0x02,0x82,0x06,0x82,0x05,0x82,0x08,0x82,0x04,0x82,
|
|
||||||
0x07,0x82,0x03,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x04,0x82,0x06,0x82,0x04,
|
|
||||||
0x82,0x03,0x81,0x04,0x82,0x1a,0x82,0x10,0x82,0x10,0x82,0x08,0x82,0x04,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,
|
|
||||||
0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x05,0x82,0x05,0x82,0x03,0x82,
|
|
||||||
0x03,0x82,0x03,0x82,0x03,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x03,0x83,0x02,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x02,0x84,0x02,0x82,0x03,0x82,0x03,0x82,
|
|
||||||
0x04,0x82,0x05,0x82,0x05,0x82,0x04,0x82,0x05,0x82,0x05,0x83,0x02,0x83,0x03,
|
|
||||||
0x82,0x02,0x82,0x06,0x82,0x05,0x82,0x09,0x82,0x0c,0x82,0x08,0x82,0x21,0x82,
|
|
||||||
0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x0a,
|
|
||||||
0x82,0x07,0x85,0x04,0x82,0x04,0x82,0x05,0x82,0x0b,0x82,0x02,0x82,0x02,0x82,
|
|
||||||
0x07,0x82,0x05,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x0d,0x82,0x04,0x82,
|
|
||||||
0x06,0x82,0x04,0x82,0x04,0x84,0x04,0x82,0x01,0x82,0x01,0x82,0x04,0x84,0x04,
|
|
||||||
0x82,0x04,0x82,0x04,0x82,0x09,0x82,0x08,0x82,0x08,0x82,0x26,0x82,0x10,0x82,
|
|
||||||
0x01,0x82,0x05,0x86,0x04,0x82,0x01,0x82,0x01,0x82,0x01,0x83,0x01,0x84,0x10,
|
|
||||||
0x82,0x06,0x82,0x1d,0x83,0x11,0x83,0x05,0x82,0x09,0x84,0x07,0x82,0x05,0x82,
|
|
||||||
0x09,0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x04,
|
|
||||||
0x82,0x08,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x06,0x83,0x07,0x83,0x09,0x82,
|
|
||||||
0x0e,0x82,0x0a,0x82,0x06,0x82,0x03,0x82,0x02,0x82,0x04,0x82,0x02,0x82,0x03,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x03,0x82,0x03,0x82,0x08,0x82,0x09,0x82,
|
|
||||||
0x02,0x83,0x02,0x82,0x04,0x82,0x05,0x82,0x06,0x82,0x01,0x82,0x04,0x82,0x04,
|
|
||||||
0x82,0x02,0x82,0x08,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x03,0x82,0x02,0x82,
|
|
||||||
0x03,0x82,0x09,0x82,0x02,0x82,0x03,0x82,0x04,0x82,0x03,0x82,0x02,0x82,0x06,
|
|
||||||
0x82,0x06,0x82,0x02,0x82,0x06,0x82,0x05,0x82,0x04,0x82,0x02,0x82,0x04,0x82,
|
|
||||||
0x05,0x82,0x05,0x82,0x09,0x82,0x0d,0x82,0x07,0x82,0x21,0x82,0x04,0x82,0x02,
|
|
||||||
0x83,0x02,0x82,0x04,0x82,0x03,0x82,0x03,0x82,0x02,0x83,0x03,0x82,0x03,0x82,
|
|
||||||
0x04,0x82,0x06,0x82,0x08,0x82,0x04,0x82,0x05,0x82,0x0b,0x82,0x02,0x82,0x03,
|
|
||||||
0x82,0x06,0x82,0x05,0x82,0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x03,0x82,
|
|
||||||
0x02,0x82,0x03,0x83,0x02,0x82,0x04,0x82,0x02,0x83,0x03,0x82,0x07,0x82,0x04,
|
|
||||||
0x82,0x04,0x82,0x02,0x82,0x03,0x82,0x02,0x83,0x05,0x82,0x05,0x88,0x03,0x82,
|
|
||||||
0x02,0x82,0x04,0x82,0x02,0x83,0x03,0x82,0x0a,0x82,0x08,0x82,0x08,0x82,0x26,
|
|
||||||
0x82,0x1c,0x82,0x06,0x82,0x02,0x83,0x03,0x84,0x02,0x82,0x10,0x82,0x04,0x82,
|
|
||||||
0x1e,0x83,0x11,0x83,0x05,0x82,0x0a,0x82,0x05,0x88,0x02,0x88,0x04,0x84,0x09,
|
|
||||||
0x82,0x05,0x84,0x06,0x84,0x05,0x82,0x09,0x84,0x06,0x84,0x07,0x83,0x07,0x83,
|
|
||||||
0x0a,0x81,0x0e,0x81,0x0b,0x82,0x07,0x85,0x03,0x82,0x04,0x82,0x02,0x86,0x06,
|
|
||||||
0x84,0x04,0x86,0x04,0x88,0x02,0x82,0x0a,0x84,0x01,0x81,0x02,0x82,0x04,0x82,
|
|
||||||
0x02,0x88,0x04,0x83,0x05,0x82,0x04,0x82,0x02,0x88,0x02,0x82,0x04,0x82,0x02,
|
|
||||||
0x82,0x04,0x82,0x04,0x84,0x04,0x82,0x0a,0x85,0x03,0x82,0x04,0x82,0x04,0x84,
|
|
||||||
0x07,0x82,0x07,0x84,0x07,0x82,0x05,0x82,0x04,0x82,0x02,0x82,0x04,0x82,0x05,
|
|
||||||
0x82,0x05,0x88,0x03,0x86,0x09,0x82,0x03,0x86,0x22,0x85,0x01,0x81,0x02,0x82,
|
|
||||||
0x01,0x83,0x06,0x85,0x05,0x83,0x01,0x82,0x04,0x85,0x05,0x82,0x07,0x86,0x03,
|
|
||||||
0x82,0x04,0x82,0x02,0x88,0x08,0x82,0x02,0x82,0x04,0x82,0x02,0x88,0x02,0x82,
|
|
||||||
0x01,0x82,0x01,0x82,0x02,0x82,0x04,0x82,0x04,0x84,0x04,0x82,0x01,0x83,0x06,
|
|
||||||
0x83,0x01,0x82,0x03,0x82,0x08,0x86,0x06,0x84,0x05,0x83,0x01,0x82,0x05,0x82,
|
|
||||||
0x06,0x82,0x02,0x82,0x03,0x82,0x04,0x82,0x04,0x83,0x01,0x82,0x03,0x87,0x06,
|
|
||||||
0x84,0x05,0x82,0x05,0x84,0x7f,0x15,0x83,0x7f,0x14,0x83,0x7f,0x5e,0x82,0x7f,
|
|
||||||
0x05,0x89,0x47,0x82,0x04,0x82,0x17,0x82,0x03,0x82,0x34,0x82,0x0e,0x82,0x4e,
|
|
||||||
0x82,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x0a,0x82,0x04,0x82,0x17,0x82,0x03,0x82,
|
|
||||||
0x34,0x82,0x0e,0x82,0x48,0x82,0x04,0x82,0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x0a,
|
|
||||||
0x82,0x04,0x82,0x17,0x82,0x03,0x82,0x34,0x82,0x0e,0x82,0x49,0x82,0x02,0x82,
|
|
||||||
0x7f,0x7f,0x7f,0x7f,0x7f,0x7f,0x0c,0x86,0x19,0x85,0x35,0x82,0x0e,0x82,0x4a,
|
|
||||||
0x84,0x3f,
|
|
||||||
0x00,
|
|
||||||
}
|
|
||||||
};
|
|
|
@ -30,7 +30,6 @@
|
||||||
|
|
||||||
#include <pixelflinger/pixelflinger.h>
|
#include <pixelflinger/pixelflinger.h>
|
||||||
|
|
||||||
#include "font_10x18.h"
|
|
||||||
#include "minui.h"
|
#include "minui.h"
|
||||||
|
|
||||||
#if defined(RECOVERY_BGRA)
|
#if defined(RECOVERY_BGRA)
|
||||||
|
@ -47,7 +46,7 @@
|
||||||
#define NUM_BUFFERS 2
|
#define NUM_BUFFERS 2
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
GGLSurface texture;
|
GGLSurface* texture;
|
||||||
unsigned cwidth;
|
unsigned cwidth;
|
||||||
unsigned cheight;
|
unsigned cheight;
|
||||||
unsigned ascent;
|
unsigned ascent;
|
||||||
|
@ -230,12 +229,14 @@ int gr_text(int x, int y, const char *s)
|
||||||
GRFont *font = gr_font;
|
GRFont *font = gr_font;
|
||||||
unsigned off;
|
unsigned off;
|
||||||
|
|
||||||
|
if (!font->texture) return x;
|
||||||
|
|
||||||
x += overscan_offset_x;
|
x += overscan_offset_x;
|
||||||
y += overscan_offset_y;
|
y += overscan_offset_y;
|
||||||
|
|
||||||
y -= font->ascent;
|
y -= font->ascent;
|
||||||
|
|
||||||
gl->bindTexture(gl, &font->texture);
|
gl->bindTexture(gl, font->texture);
|
||||||
gl->texEnvi(gl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE);
|
gl->texEnvi(gl, GGL_TEXTURE_ENV, GGL_TEXTURE_ENV_MODE, GGL_REPLACE);
|
||||||
gl->texGeni(gl, GGL_S, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
|
gl->texGeni(gl, GGL_S, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
|
||||||
gl->texGeni(gl, GGL_T, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
|
gl->texGeni(gl, GGL_T, GGL_TEXTURE_GEN_MODE, GGL_ONE_TO_ONE);
|
||||||
|
@ -322,31 +323,21 @@ unsigned int gr_get_height(gr_surface surface) {
|
||||||
|
|
||||||
static void gr_init_font(void)
|
static void gr_init_font(void)
|
||||||
{
|
{
|
||||||
GGLSurface *ftex;
|
|
||||||
unsigned char *bits, *rle;
|
|
||||||
unsigned char *in, data;
|
|
||||||
|
|
||||||
gr_font = calloc(sizeof(*gr_font), 1);
|
gr_font = calloc(sizeof(*gr_font), 1);
|
||||||
ftex = &gr_font->texture;
|
|
||||||
|
|
||||||
bits = malloc(font.width * font.height);
|
int res = res_create_surface("font", (void**)&(gr_font->texture));
|
||||||
|
if (res != 0) {
|
||||||
ftex->version = sizeof(*ftex);
|
printf("failed to read font: res=%d\n", res);
|
||||||
ftex->width = font.width;
|
gr_font->texture = NULL;
|
||||||
ftex->height = font.height;
|
return;
|
||||||
ftex->stride = font.width;
|
|
||||||
ftex->data = (void*) bits;
|
|
||||||
ftex->format = GGL_PIXEL_FORMAT_A_8;
|
|
||||||
|
|
||||||
in = font.rundata;
|
|
||||||
while((data = *in++)) {
|
|
||||||
memset(bits, (data & 0x80) ? 255 : 0, data & 0x7f);
|
|
||||||
bits += (data & 0x7f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gr_font->cwidth = font.cwidth;
|
// interpret the grayscale as alpha
|
||||||
gr_font->cheight = font.cheight;
|
gr_font->texture->format = GGL_PIXEL_FORMAT_A_8;
|
||||||
gr_font->ascent = font.cheight - 2;
|
|
||||||
|
gr_font->cwidth = gr_font->texture->width / 96;
|
||||||
|
gr_font->cheight = gr_font->texture->height;
|
||||||
|
gr_font->ascent = gr_font->cheight - 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gr_init(void)
|
int gr_init(void)
|
||||||
|
|
|
@ -93,22 +93,23 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
|
||||||
png_set_sig_bytes(png_ptr, sizeof(header));
|
png_set_sig_bytes(png_ptr, sizeof(header));
|
||||||
png_read_info(png_ptr, info_ptr);
|
png_read_info(png_ptr, info_ptr);
|
||||||
|
|
||||||
size_t width = info_ptr->width;
|
|
||||||
size_t height = info_ptr->height;
|
|
||||||
size_t stride = 4 * width;
|
|
||||||
size_t pixelSize = stride * height;
|
|
||||||
|
|
||||||
int color_type = info_ptr->color_type;
|
int color_type = info_ptr->color_type;
|
||||||
int bit_depth = info_ptr->bit_depth;
|
int bit_depth = info_ptr->bit_depth;
|
||||||
int channels = info_ptr->channels;
|
int channels = info_ptr->channels;
|
||||||
if (!(bit_depth == 8 &&
|
if (!(bit_depth == 8 &&
|
||||||
((channels == 3 && color_type == PNG_COLOR_TYPE_RGB) ||
|
((channels == 3 && color_type == PNG_COLOR_TYPE_RGB) ||
|
||||||
(channels == 4 && color_type == PNG_COLOR_TYPE_RGBA) ||
|
(channels == 4 && color_type == PNG_COLOR_TYPE_RGBA) ||
|
||||||
(channels == 1 && color_type == PNG_COLOR_TYPE_PALETTE)))) {
|
(channels == 1 && (color_type == PNG_COLOR_TYPE_PALETTE ||
|
||||||
|
color_type == PNG_COLOR_TYPE_GRAY))))) {
|
||||||
return -7;
|
return -7;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t width = info_ptr->width;
|
||||||
|
size_t height = info_ptr->height;
|
||||||
|
size_t stride = (color_type == PNG_COLOR_TYPE_GRAY ? 1 : 4) * width;
|
||||||
|
size_t pixelSize = stride * height;
|
||||||
|
|
||||||
surface = malloc(sizeof(GGLSurface) + pixelSize);
|
surface = malloc(sizeof(GGLSurface) + pixelSize);
|
||||||
if (surface == NULL) {
|
if (surface == NULL) {
|
||||||
result = -8;
|
result = -8;
|
||||||
|
@ -120,8 +121,8 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
|
||||||
surface->height = height;
|
surface->height = height;
|
||||||
surface->stride = width; /* Yes, pixels, not bytes */
|
surface->stride = width; /* Yes, pixels, not bytes */
|
||||||
surface->data = pData;
|
surface->data = pData;
|
||||||
surface->format = (channels == 3) ?
|
surface->format = (channels == 3) ? GGL_PIXEL_FORMAT_RGBX_8888 :
|
||||||
GGL_PIXEL_FORMAT_RGBX_8888 : GGL_PIXEL_FORMAT_RGBA_8888;
|
((color_type == PNG_COLOR_TYPE_PALETTE ? GGL_PIXEL_FORMAT_RGBA_8888 : GGL_PIXEL_FORMAT_L_8));
|
||||||
|
|
||||||
int alpha = 0;
|
int alpha = 0;
|
||||||
if (color_type == PNG_COLOR_TYPE_PALETTE) {
|
if (color_type == PNG_COLOR_TYPE_PALETTE) {
|
||||||
|
@ -131,6 +132,9 @@ int res_create_surface(const char* name, gr_surface* pSurface) {
|
||||||
png_set_tRNS_to_alpha(png_ptr);
|
png_set_tRNS_to_alpha(png_ptr);
|
||||||
alpha = 1;
|
alpha = 1;
|
||||||
}
|
}
|
||||||
|
if (color_type == PNG_COLOR_TYPE_GRAY) {
|
||||||
|
alpha = 1;
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int y;
|
unsigned int y;
|
||||||
if (channels == 3 || (channels == 1 && !alpha)) {
|
if (channels == 3 || (channels == 1 && !alpha)) {
|
||||||
|
|
BIN
res/images/font.png
Normal file
BIN
res/images/font.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.1 KiB |
|
@ -34,8 +34,8 @@
|
||||||
#include "screen_ui.h"
|
#include "screen_ui.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
|
||||||
#define CHAR_WIDTH 10
|
static int char_width;
|
||||||
#define CHAR_HEIGHT 18
|
static int char_height;
|
||||||
|
|
||||||
// There's only (at most) one of these objects, and global callbacks
|
// There's only (at most) one of these objects, and global callbacks
|
||||||
// (for pthread_create, and the input event system) need to find it,
|
// (for pthread_create, and the input event system) need to find it,
|
||||||
|
@ -194,7 +194,7 @@ void ScreenRecoveryUI::draw_progress_locked()
|
||||||
|
|
||||||
void ScreenRecoveryUI::draw_text_line(int row, const char* t) {
|
void ScreenRecoveryUI::draw_text_line(int row, const char* t) {
|
||||||
if (t[0] != '\0') {
|
if (t[0] != '\0') {
|
||||||
gr_text(0, (row+1)*CHAR_HEIGHT-1, t);
|
gr_text(0, (row+1)*char_height-1, t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -212,8 +212,8 @@ void ScreenRecoveryUI::draw_screen_locked()
|
||||||
int i = 0;
|
int i = 0;
|
||||||
if (show_menu) {
|
if (show_menu) {
|
||||||
gr_color(64, 96, 255, 255);
|
gr_color(64, 96, 255, 255);
|
||||||
gr_fill(0, (menu_top+menu_sel) * CHAR_HEIGHT,
|
gr_fill(0, (menu_top+menu_sel) * char_height,
|
||||||
gr_fb_width(), (menu_top+menu_sel+1)*CHAR_HEIGHT+1);
|
gr_fb_width(), (menu_top+menu_sel+1)*char_height+1);
|
||||||
|
|
||||||
for (; i < menu_top + menu_items; ++i) {
|
for (; i < menu_top + menu_items; ++i) {
|
||||||
if (i == menu_top + menu_sel) {
|
if (i == menu_top + menu_sel) {
|
||||||
|
@ -224,8 +224,8 @@ void ScreenRecoveryUI::draw_screen_locked()
|
||||||
draw_text_line(i, menu[i]);
|
draw_text_line(i, menu[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
gr_fill(0, i*CHAR_HEIGHT+CHAR_HEIGHT/2-1,
|
gr_fill(0, i*char_height+char_height/2-1,
|
||||||
gr_fb_width(), i*CHAR_HEIGHT+CHAR_HEIGHT/2+1);
|
gr_fb_width(), i*char_height+char_height/2+1);
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -327,12 +327,14 @@ void ScreenRecoveryUI::Init()
|
||||||
{
|
{
|
||||||
gr_init();
|
gr_init();
|
||||||
|
|
||||||
|
gr_font_size(&char_width, &char_height);
|
||||||
|
|
||||||
text_col = text_row = 0;
|
text_col = text_row = 0;
|
||||||
text_rows = gr_fb_height() / CHAR_HEIGHT;
|
text_rows = gr_fb_height() / char_height;
|
||||||
if (text_rows > kMaxRows) text_rows = kMaxRows;
|
if (text_rows > kMaxRows) text_rows = kMaxRows;
|
||||||
text_top = 1;
|
text_top = 1;
|
||||||
|
|
||||||
text_cols = gr_fb_width() / CHAR_WIDTH;
|
text_cols = gr_fb_width() / char_width;
|
||||||
if (text_cols > kMaxCols - 1) text_cols = kMaxCols - 1;
|
if (text_cols > kMaxCols - 1) text_cols = kMaxCols - 1;
|
||||||
|
|
||||||
LoadBitmap("icon_installing", &backgroundIcon[INSTALLING_UPDATE]);
|
LoadBitmap("icon_installing", &backgroundIcon[INSTALLING_UPDATE]);
|
||||||
|
|
Loading…
Reference in a new issue