forked from Miroirs/x49gp
drop all custom fonts code and assets
This commit is contained in:
parent
a6fefc2cb5
commit
b8614acbae
84 changed files with 0 additions and 1353 deletions
3
Makefile
3
Makefile
|
@ -123,9 +123,6 @@ SRCS = ./src/x49gpng/main.c \
|
|||
./src/x49gpng/s3c2410_arm.c \
|
||||
./src/x49gpng/ui.c \
|
||||
./src/x49gpng/timer.c \
|
||||
./src/x49gpng/ui_tiny_font.c \
|
||||
./src/x49gpng/ui_regular_font.c \
|
||||
./src/x49gpng/ui_symbol.c \
|
||||
./src/x49gpng/gdbstub.c \
|
||||
./src/x49gpng/block.c \
|
||||
./src/x49gpng/options.c
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_A_width 5
|
||||
#define tiny_A_height 7
|
||||
#define tiny_A_x_hot 0
|
||||
#define tiny_A_y_hot 6
|
||||
static unsigned char tiny_A_bits[] = {
|
||||
0x06, 0x09, 0x09, 0x0f, 0x09, 0x09, 0x09};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_B_width 5
|
||||
#define tiny_B_height 7
|
||||
#define tiny_B_x_hot 0
|
||||
#define tiny_B_y_hot 6
|
||||
static unsigned char tiny_B_bits[] = {
|
||||
0x07, 0x09, 0x09, 0x07, 0x09, 0x09, 0x07};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_C_width 5
|
||||
#define tiny_C_height 7
|
||||
#define tiny_C_x_hot 0
|
||||
#define tiny_C_y_hot 6
|
||||
static unsigned char tiny_C_bits[] = {
|
||||
0x06, 0x09, 0x01, 0x01, 0x01, 0x09, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_D_width 5
|
||||
#define tiny_D_height 7
|
||||
#define tiny_D_x_hot 0
|
||||
#define tiny_D_y_hot 6
|
||||
static unsigned char tiny_D_bits[] = {
|
||||
0x07, 0x09, 0x09, 0x09, 0x09, 0x09, 0x07};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_E_width 4
|
||||
#define tiny_E_height 7
|
||||
#define tiny_E_x_hot 0
|
||||
#define tiny_E_y_hot 6
|
||||
static unsigned char tiny_E_bits[] = {
|
||||
0x17, 0x01, 0x01, 0x03, 0x01, 0x01, 0x17};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_F_width 4
|
||||
#define tiny_F_height 7
|
||||
#define tiny_F_x_hot 0
|
||||
#define tiny_F_y_hot 6
|
||||
static unsigned char tiny_F_bits[] = {
|
||||
0x07, 0x01, 0x01, 0x03, 0x01, 0x01, 0x01};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_G_width 6
|
||||
#define tiny_G_height 7
|
||||
#define tiny_G_x_hot 0
|
||||
#define tiny_G_y_hot 6
|
||||
static unsigned char tiny_G_bits[] = {
|
||||
0x0e, 0x11, 0x01, 0x01, 0x19, 0x11, 0x0e};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_H_width 5
|
||||
#define tiny_H_height 7
|
||||
#define tiny_H_x_hot 0
|
||||
#define tiny_H_y_hot 6
|
||||
static unsigned char tiny_H_bits[] = {
|
||||
0x09, 0x09, 0x09, 0x0f, 0x09, 0x09, 0x09};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_I_width 4
|
||||
#define tiny_I_height 7
|
||||
#define tiny_I_x_hot 0
|
||||
#define tiny_I_y_hot 6
|
||||
static unsigned char tiny_I_bits[] = {
|
||||
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_J_width 5
|
||||
#define tiny_J_height 7
|
||||
#define tiny_J_x_hot 0
|
||||
#define tiny_J_y_hot 6
|
||||
static unsigned char tiny_J_bits[] = {
|
||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x09, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_K_width 5
|
||||
#define tiny_K_height 7
|
||||
#define tiny_K_x_hot 0
|
||||
#define tiny_K_y_hot 6
|
||||
static unsigned char tiny_K_bits[] = {
|
||||
0x09, 0x05, 0x05, 0x03, 0x05, 0x05, 0x09};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_L_width 4
|
||||
#define tiny_L_height 7
|
||||
#define tiny_L_x_hot 0
|
||||
#define tiny_L_y_hot 6
|
||||
static unsigned char tiny_L_bits[] = {
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_M_width 6
|
||||
#define tiny_M_height 7
|
||||
#define tiny_M_x_hot 0
|
||||
#define tiny_M_y_hot 6
|
||||
static unsigned char tiny_M_bits[] = {
|
||||
0x11, 0x1b, 0x15, 0x15, 0x11, 0x11, 0x11};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_N_width 5
|
||||
#define tiny_N_height 7
|
||||
#define tiny_N_x_hot 0
|
||||
#define tiny_N_y_hot 6
|
||||
static unsigned char tiny_N_bits[] = {
|
||||
0x09, 0x0b, 0x0b, 0x0d, 0x0d, 0x09, 0x09};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_O_width 5
|
||||
#define tiny_O_height 7
|
||||
#define tiny_O_x_hot 0
|
||||
#define tiny_O_y_hot 6
|
||||
static unsigned char tiny_O_bits[] = {
|
||||
0x06, 0x09, 0x09, 0x09, 0x09, 0x09, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_P_width 5
|
||||
#define tiny_P_height 7
|
||||
#define tiny_P_x_hot 0
|
||||
#define tiny_P_y_hot 6
|
||||
static unsigned char tiny_P_bits[] = {
|
||||
0x07, 0x09, 0x09, 0x07, 0x01, 0x01, 0x01};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_Q_width 6
|
||||
#define tiny_Q_height 7
|
||||
#define tiny_Q_x_hot 0
|
||||
#define tiny_Q_y_hot 6
|
||||
static unsigned char tiny_Q_bits[] = {
|
||||
0x0e, 0x11, 0x11, 0x11, 0x15, 0x09, 0x16};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_R_width 5
|
||||
#define tiny_R_height 7
|
||||
#define tiny_R_x_hot 0
|
||||
#define tiny_R_y_hot 6
|
||||
static unsigned char tiny_R_bits[] = {
|
||||
0x07, 0x09, 0x09, 0x07, 0x05, 0x09, 0x09};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_S_width 5
|
||||
#define tiny_S_height 7
|
||||
#define tiny_S_x_hot 0
|
||||
#define tiny_S_y_hot 6
|
||||
static unsigned char tiny_S_bits[] = {
|
||||
0x06, 0x09, 0x01, 0x06, 0x08, 0x09, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_T_width 5
|
||||
#define tiny_T_height 7
|
||||
#define tiny_T_x_hot 1
|
||||
#define tiny_T_y_hot 6
|
||||
static unsigned char tiny_T_bits[] = {
|
||||
0x1f, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_U_width 5
|
||||
#define tiny_U_height 7
|
||||
#define tiny_U_x_hot 0
|
||||
#define tiny_U_y_hot 6
|
||||
static unsigned char tiny_U_bits[] = {
|
||||
0x09, 0x09, 0x09, 0x09, 0x09, 0x09, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_V_width 5
|
||||
#define tiny_V_height 7
|
||||
#define tiny_V_x_hot 0
|
||||
#define tiny_V_y_hot 6
|
||||
static unsigned char tiny_V_bits[] = {
|
||||
0x09, 0x09, 0x09, 0x09, 0x09, 0x06, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_W_width 6
|
||||
#define tiny_W_height 7
|
||||
#define tiny_W_x_hot 0
|
||||
#define tiny_W_y_hot 6
|
||||
static unsigned char tiny_W_bits[] = {
|
||||
0x11, 0x11, 0x11, 0x15, 0x15, 0x1b, 0x11};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_X_width 5
|
||||
#define tiny_X_height 7
|
||||
#define tiny_X_x_hot 0
|
||||
#define tiny_X_y_hot 6
|
||||
static unsigned char tiny_X_bits[] = {
|
||||
0x09, 0x09, 0x06, 0x06, 0x06, 0x09, 0x09};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_Y_width 6
|
||||
#define tiny_Y_height 7
|
||||
#define tiny_Y_x_hot 0
|
||||
#define tiny_Y_y_hot 6
|
||||
static unsigned char tiny_Y_bits[] = {
|
||||
0x11, 0x11, 0x0a, 0x04, 0x04, 0x04, 0x04};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_Z_width 5
|
||||
#define tiny_Z_height 7
|
||||
#define tiny_Z_x_hot 0
|
||||
#define tiny_Z_y_hot 6
|
||||
static unsigned char tiny_Z_bits[] = {
|
||||
0x0f, 0x08, 0x04, 0x04, 0x02, 0x01, 0x0f};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_i_width 4
|
||||
#define tiny_i_height 7
|
||||
#define tiny_i_x_hot 0
|
||||
#define tiny_i_y_hot 6
|
||||
static unsigned char tiny_i_bits[] = {
|
||||
0x02, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_ampersand_width 6
|
||||
#define tiny_ampersand_height 7
|
||||
#define tiny_ampersand_x_hot 0
|
||||
#define tiny_ampersand_y_hot 6
|
||||
static unsigned char tiny_ampersand_bits[] = {
|
||||
0x06, 0x09, 0x06, 0x16, 0x09, 0x09, 0x16};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_arrowleft_width 7
|
||||
#define tiny_arrowleft_height 5
|
||||
#define tiny_arrowleft_x_hot 0
|
||||
#define tiny_arrowleft_y_hot 4
|
||||
static unsigned char tiny_arrowleft_bits[] = {
|
||||
0x02, 0x3f, 0x02, 0x00, 0x00 };
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_arrowright_width 7
|
||||
#define tiny_arrowright_height 5
|
||||
#define tiny_arrowright_x_hot 0
|
||||
#define tiny_arrowright_y_hot 4
|
||||
static unsigned char tiny_arrowright_bits[] = {
|
||||
0x10, 0x3f, 0x10, 0x00, 0x00 };
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_braceleft_width 4
|
||||
#define tiny_braceleft_height 9
|
||||
#define tiny_braceleft_x_hot 0
|
||||
#define tiny_braceleft_y_hot 7
|
||||
static unsigned char tiny_braceleft_bits[] = {
|
||||
0x04, 0x02, 0x02, 0x02, 0x01, 0x02, 0x02, 0x02, 0x04};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_braceright_width 4
|
||||
#define tiny_braceright_height 9
|
||||
#define tiny_braceright_x_hot 0
|
||||
#define tiny_braceright_y_hot 7
|
||||
static unsigned char tiny_braceright_bits[] = {
|
||||
0x01, 0x02, 0x02, 0x02, 0x04, 0x02, 0x02, 0x02, 0x01};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_bracketleft_width 4
|
||||
#define tiny_bracketleft_height 9
|
||||
#define tiny_bracketleft_x_hot 0
|
||||
#define tiny_bracketleft_y_hot 7
|
||||
static unsigned char tiny_bracketleft_bits[] = {
|
||||
0x07, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x07};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_bracketright_width 4
|
||||
#define tiny_bracketright_height 9
|
||||
#define tiny_bracketright_x_hot 0
|
||||
#define tiny_bracketright_y_hot 7
|
||||
static unsigned char tiny_bracketright_bits[] = {
|
||||
0x07, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x07};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_colon_width 3
|
||||
#define tiny_colon_height 6
|
||||
#define tiny_colon_x_hot 0
|
||||
#define tiny_colon_y_hot 5
|
||||
static unsigned char tiny_colon_bits[] = {
|
||||
0x03, 0x03, 0x00, 0x00, 0x03, 0x03 };
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_comma_width 4
|
||||
#define tiny_comma_height 3
|
||||
#define tiny_comma_x_hot 0
|
||||
#define tiny_comma_y_hot 1
|
||||
static unsigned char tiny_comma_bits[] = {
|
||||
0x06, 0x06, 0x03};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_equal_width 5
|
||||
#define tiny_equal_height 5
|
||||
#define tiny_equal_x_hot 0
|
||||
#define tiny_equal_y_hot 4
|
||||
static unsigned char tiny_equal_bits[] = {
|
||||
0x0f, 0x00, 0x0f, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_greater_width 5
|
||||
#define tiny_greater_height 7
|
||||
#define tiny_greater_x_hot 0
|
||||
#define tiny_greater_y_hot 6
|
||||
static unsigned char tiny_greater_bits[] = {
|
||||
0x01, 0x02, 0x04, 0x08, 0x04, 0x02, 0x01};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_guillemotleft_width 11
|
||||
#define tiny_guillemotleft_height 6
|
||||
#define tiny_guillemotleft_x_hot 0
|
||||
#define tiny_guillemotleft_y_hot 5
|
||||
static unsigned char tiny_guillemotleft_bits[] = {
|
||||
0x18, 0x03, 0xc6, 0x00, 0x21, 0x00, 0xc6, 0x00, 0x18, 0x03, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_guillemotright_width 11
|
||||
#define tiny_guillemotright_height 6
|
||||
#define tiny_guillemotright_x_hot 0
|
||||
#define tiny_guillemotright_y_hot 5
|
||||
static unsigned char tiny_guillemotright_bits[] = {
|
||||
0x63, 0x00, 0x8c, 0x01, 0x10, 0x02, 0x8c, 0x01, 0x63, 0x00, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_hyphen_width 5
|
||||
#define tiny_hyphen_height 4
|
||||
#define tiny_hyphen_x_hot 0
|
||||
#define tiny_hyphen_y_hot 3
|
||||
static unsigned char tiny_hyphen_bits[] = {
|
||||
0x0f, 0x00, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_large_comma_width 4
|
||||
#define tiny_large_comma_height 6
|
||||
#define tiny_large_comma_x_hot 0
|
||||
#define tiny_large_comma_y_hot 2
|
||||
static unsigned char tiny_large_comma_bits[] = {
|
||||
0x07, 0x07, 0x07, 0x04, 0x02, 0x01 };
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_less_width 5
|
||||
#define tiny_less_height 7
|
||||
#define tiny_less_x_hot 0
|
||||
#define tiny_less_y_hot 6
|
||||
static unsigned char tiny_less_bits[] = {
|
||||
0x08, 0x04, 0x02, 0x01, 0x02, 0x04, 0x08};
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_arrowleft_width 12
|
||||
#define tiny_math_arrowleft_height 6
|
||||
#define tiny_math_arrowleft_x_hot 0
|
||||
#define tiny_math_arrowleft_y_hot 5
|
||||
static unsigned char tiny_math_arrowleft_bits[] = {
|
||||
0x10, 0x00, 0x1c, 0x00, 0xff, 0x07, 0x1c, 0x00, 0x10, 0x00, 0x00, 0x00
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_arrowright_width 12
|
||||
#define tiny_math_arrowright_height 6
|
||||
#define tiny_math_arrowright_x_hot 0
|
||||
#define tiny_math_arrowright_y_hot 5
|
||||
static unsigned char tiny_math_arrowright_bits[] = {
|
||||
0x40, 0x00, 0xc0, 0x01, 0xff, 0x07, 0xc0, 0x01, 0x40, 0x00, 0x00, 0x00
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_downarrowleft_width 12
|
||||
#define tiny_math_downarrowleft_height 8
|
||||
#define tiny_math_downarrowleft_x_hot 0
|
||||
#define tiny_math_downarrowleft_y_hot 7
|
||||
static unsigned char tiny_math_downarrowleft_bits[] = {
|
||||
0x00, 0x04, 0x00, 0x04, 0x10, 0x04, 0x1c, 0x04, 0xff, 0x07, 0x1c, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00 };
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_downarrowright_width 12
|
||||
#define tiny_math_downarrowright_height 8
|
||||
#define tiny_math_downarrowright_x_hot 0
|
||||
#define tiny_math_downarrowright_y_hot 7
|
||||
static unsigned char tiny_math_downarrowright_bits[] = {
|
||||
0x01, 0x00, 0x01, 0x00, 0x41, 0x00, 0xc1, 0x01, 0xff, 0x07, 0xc0, 0x01,
|
||||
0x40, 0x00, 0x00, 0x00 };
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_e_width 6
|
||||
#define tiny_math_e_height 6
|
||||
#define tiny_math_e_x_hot 0
|
||||
#define tiny_math_e_y_hot 5
|
||||
static unsigned char tiny_math_e_bits[] = {
|
||||
0x0c, 0x12, 0x09, 0x07, 0x11, 0x0e};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_equal_width 7
|
||||
#define tiny_math_equal_height 6
|
||||
#define tiny_math_equal_x_hot 0
|
||||
#define tiny_math_equal_y_hot 5
|
||||
static unsigned char tiny_math_equal_bits[] = {
|
||||
0x3f, 0x00, 0x00, 0x3f, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_greater_width 6
|
||||
#define tiny_math_greater_height 7
|
||||
#define tiny_math_greater_x_hot 0
|
||||
#define tiny_math_greater_y_hot 6
|
||||
static unsigned char tiny_math_greater_bits[] = {
|
||||
0x03, 0x0c, 0x10, 0x0c, 0x03, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_greaterequal_width 6
|
||||
#define tiny_math_greaterequal_height 8
|
||||
#define tiny_math_greaterequal_x_hot 0
|
||||
#define tiny_math_greaterequal_y_hot 7
|
||||
static unsigned char tiny_math_greaterequal_bits[] = {
|
||||
0x03, 0x0c, 0x10, 0x0c, 0x03, 0x30, 0x0c, 0x03};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_infinity_width 13
|
||||
#define tiny_math_infinity_height 5
|
||||
#define tiny_math_infinity_x_hot 0
|
||||
#define tiny_math_infinity_y_hot 4
|
||||
static unsigned char tiny_math_infinity_bits[] = {
|
||||
0x9e, 0x07, 0x61, 0x08, 0x61, 0x08, 0x9e, 0x07, 0x00, 0x00 };
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_integral_width 9
|
||||
#define tiny_math_integral_height 10
|
||||
#define tiny_math_integral_x_hot 0
|
||||
#define tiny_math_integral_y_hot 8
|
||||
static unsigned char tiny_math_integral_bits[] = {
|
||||
0x60, 0x00, 0x90, 0x00, 0x10, 0x00, 0x10, 0x00, 0x10, 0x00, 0x08, 0x00,
|
||||
0x08, 0x00, 0x08, 0x00, 0x09, 0x00, 0x06, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_less_width 6
|
||||
#define tiny_math_less_height 7
|
||||
#define tiny_math_less_x_hot 0
|
||||
#define tiny_math_less_y_hot 6
|
||||
static unsigned char tiny_math_less_bits[] = {
|
||||
0x18, 0x06, 0x01, 0x06, 0x18, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_lessequal_width 6
|
||||
#define tiny_math_lessequal_height 8
|
||||
#define tiny_math_lessequal_x_hot 0
|
||||
#define tiny_math_lessequal_y_hot 7
|
||||
static unsigned char tiny_math_lessequal_bits[] = {
|
||||
0x30, 0x0c, 0x02, 0x0c, 0x30, 0x03, 0x0c, 0x30};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_notequal_width 7
|
||||
#define tiny_math_notequal_height 8
|
||||
#define tiny_math_notequal_x_hot 0
|
||||
#define tiny_math_notequal_y_hot 7
|
||||
static unsigned char tiny_math_notequal_bits[] = {
|
||||
0x08, 0x08, 0x3f, 0x08, 0x04, 0x3f, 0x04, 0x04};
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_numbersign_width 10
|
||||
#define tiny_math_numbersign_height 8
|
||||
#define tiny_math_numbersign_x_hot 0
|
||||
#define tiny_math_numbersign_y_hot 7
|
||||
static unsigned char tiny_math_numbersign_bits[] = {
|
||||
0x48, 0x00, 0x48, 0x00, 0xfe, 0x01, 0x48, 0x00, 0x24, 0x00, 0xff, 0x00,
|
||||
0x24, 0x00, 0x24, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_partialdiff_width 6
|
||||
#define tiny_math_partialdiff_height 8
|
||||
#define tiny_math_partialdiff_x_hot 0
|
||||
#define tiny_math_partialdiff_y_hot 7
|
||||
static unsigned char tiny_math_partialdiff_bits[] = {
|
||||
0x04, 0x08, 0x08, 0x1e, 0x11, 0x11, 0x11, 0x0e};
|
|
@ -1,7 +0,0 @@
|
|||
#define tiny_math_pi_width 9
|
||||
#define tiny_math_pi_height 6
|
||||
#define tiny_math_pi_x_hot 0
|
||||
#define tiny_math_pi_y_hot 5
|
||||
static unsigned char tiny_math_pi_bits[] = {
|
||||
0xfe, 0x00, 0x25, 0x00, 0x24, 0x00, 0x24, 0x00, 0xa4, 0x00, 0x42, 0x00
|
||||
};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_radical_width 8
|
||||
#define tiny_math_radical_height 11
|
||||
#define tiny_math_radical_x_hot 0
|
||||
#define tiny_math_radical_y_hot 8
|
||||
static unsigned char tiny_math_radical_bits[] = {
|
||||
0x40, 0x40, 0x40, 0x20, 0x20, 0x20, 0x17, 0x14, 0x1c, 0x08, 0x08};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_summation_width 6
|
||||
#define tiny_math_summation_height 9
|
||||
#define tiny_math_summation_x_hot 0
|
||||
#define tiny_math_summation_y_hot 7
|
||||
static unsigned char tiny_math_summation_bits[] = {
|
||||
0x1f, 0x11, 0x02, 0x04, 0x08, 0x04, 0x02, 0x11, 0x1f};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_x_width 8
|
||||
#define tiny_math_x_height 6
|
||||
#define tiny_math_x_x_hot 0
|
||||
#define tiny_math_x_y_hot 5
|
||||
static unsigned char tiny_math_x_bits[] = {
|
||||
0x26, 0x14, 0x08, 0x14, 0x53, 0x21};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_math_y_width 7
|
||||
#define tiny_math_y_height 9
|
||||
#define tiny_math_y_x_hot 1
|
||||
#define tiny_math_y_y_hot 6
|
||||
static unsigned char tiny_math_y_bits[] = {
|
||||
0x26, 0x24, 0x24, 0x14, 0x18, 0x08, 0x08, 0x05, 0x03};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_notdef_width 4
|
||||
#define tiny_notdef_height 5
|
||||
#define tiny_notdef_x_hot 0
|
||||
#define tiny_notdef_y_hot 4
|
||||
static unsigned char tiny_notdef_bits[] = {
|
||||
0x07, 0x07, 0x07, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_numbersign_width 6
|
||||
#define tiny_numbersign_height 6
|
||||
#define tiny_numbersign_x_hot 0
|
||||
#define tiny_numbersign_y_hot 5
|
||||
static unsigned char tiny_numbersign_bits[] = {
|
||||
0x0a, 0x1f, 0x0a, 0x0a, 0x1f, 0x0a};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_one_width 3
|
||||
#define tiny_one_height 7
|
||||
#define tiny_one_x_hot 0
|
||||
#define tiny_one_y_hot 6
|
||||
static unsigned char tiny_one_bits[] = {
|
||||
0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_overscore_width 6
|
||||
#define tiny_overscore_height 9
|
||||
#define tiny_overscore_x_hot 1
|
||||
#define tiny_overscore_y_hot 8
|
||||
static unsigned char tiny_overscore_bits[] = {
|
||||
0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_parenleft_width 4
|
||||
#define tiny_parenleft_height 9
|
||||
#define tiny_parenleft_x_hot 0
|
||||
#define tiny_parenleft_y_hot 7
|
||||
static unsigned char tiny_parenleft_bits[] = {
|
||||
0x04, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x02, 0x04};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_parenright_width 4
|
||||
#define tiny_parenright_height 9
|
||||
#define tiny_parenright_x_hot 0
|
||||
#define tiny_parenright_y_hot 7
|
||||
static unsigned char tiny_parenright_bits[] = {
|
||||
0x01, 0x02, 0x02, 0x04, 0x04, 0x04, 0x02, 0x02, 0x01};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_period_width 3
|
||||
#define tiny_period_height 2
|
||||
#define tiny_period_x_hot 0
|
||||
#define tiny_period_y_hot 1
|
||||
static unsigned char tiny_period_bits[] = {
|
||||
0x03, 0x03};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_quotedbl_width 4
|
||||
#define tiny_quotedbl_height 7
|
||||
#define tiny_quotedbl_x_hot 0
|
||||
#define tiny_quotedbl_y_hot 6
|
||||
static unsigned char tiny_quotedbl_bits[] = {
|
||||
0x05, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_slash_width 4
|
||||
#define tiny_slash_height 7
|
||||
#define tiny_slash_x_hot 0
|
||||
#define tiny_slash_y_hot 6
|
||||
static unsigned char tiny_slash_bits[] = {
|
||||
0x04, 0x04, 0x02, 0x02, 0x02, 0x01, 0x01};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_three_width 5
|
||||
#define tiny_three_height 7
|
||||
#define tiny_three_x_hot 0
|
||||
#define tiny_three_y_hot 6
|
||||
static unsigned char tiny_three_bits[] = {
|
||||
0x06, 0x09, 0x08, 0x06, 0x08, 0x09, 0x06};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_two_width 5
|
||||
#define tiny_two_height 7
|
||||
#define tiny_two_x_hot 0
|
||||
#define tiny_two_y_hot 6
|
||||
static unsigned char tiny_two_bits[] = {
|
||||
0x06, 0x09, 0x08, 0x08, 0x04, 0x02, 0x0f};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_twosuperior_width 5
|
||||
#define tiny_twosuperior_height 9
|
||||
#define tiny_twosuperior_x_hot 0
|
||||
#define tiny_twosuperior_y_hot 8
|
||||
static unsigned char tiny_twosuperior_bits[] = {
|
||||
0x02, 0x05, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_underscore_width 6
|
||||
#define tiny_underscore_height 3
|
||||
#define tiny_underscore_x_hot 1
|
||||
#define tiny_underscore_y_hot 0
|
||||
static unsigned char tiny_underscore_bits[] = {
|
||||
0x00, 0x00, 0x3f};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_xsuperior_width 5
|
||||
#define tiny_xsuperior_height 9
|
||||
#define tiny_xsuperior_x_hot 0
|
||||
#define tiny_xsuperior_y_hot 8
|
||||
static unsigned char tiny_xsuperior_bits[] = {
|
||||
0x12, 0x0c, 0x04, 0x0a, 0x09, 0x00, 0x00, 0x00, 0x00};
|
|
@ -1,6 +0,0 @@
|
|||
#define tiny_zero_width 5
|
||||
#define tiny_zero_height 7
|
||||
#define tiny_zero_x_hot 0
|
||||
#define tiny_zero_y_hot 6
|
||||
static unsigned char tiny_zero_bits[] = {
|
||||
0x06, 0x09, 0x09, 0x09, 0x09, 0x09, 0x06};
|
|
@ -20,8 +20,6 @@
|
|||
#include "ui.h"
|
||||
#include "s3c2410.h"
|
||||
#include "ui_bitmaps.h"
|
||||
#include "ui_tiny_font.h"
|
||||
#include "ui_regular_font.h"
|
||||
|
||||
#include "gdbstub.h"
|
||||
|
||||
|
|
|
@ -1,310 +0,0 @@
|
|||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include <cairo.h>
|
||||
|
||||
#include "options.h"
|
||||
#include "ui_symbol.h"
|
||||
#include "ui_glyphname.h"
|
||||
#include "ui_regular_font.h"
|
||||
|
||||
static void _regular_font_symbol_path( cairo_t* cr, double size, double xoffset, double yoffset, const x49gp_symbol_t* symbol )
|
||||
{
|
||||
const symbol_path_t* path;
|
||||
const cairo_path_data_t* data;
|
||||
|
||||
path = symbol->path;
|
||||
if ( NULL == path )
|
||||
return;
|
||||
|
||||
cairo_move_to( cr, xoffset, yoffset );
|
||||
|
||||
for ( int i = 0; i < path->num_data; i += path->data[ i ].header.length ) {
|
||||
data = &path->data[ i ];
|
||||
|
||||
switch ( data->header.type ) {
|
||||
case CAIRO_PATH_MOVE_TO:
|
||||
cairo_rel_move_to( cr, size * data[ 1 ].point.x, -size * data[ 1 ].point.y );
|
||||
break;
|
||||
case CAIRO_PATH_LINE_TO:
|
||||
cairo_rel_line_to( cr, size * data[ 1 ].point.x, -size * data[ 1 ].point.y );
|
||||
break;
|
||||
case CAIRO_PATH_CURVE_TO:
|
||||
cairo_rel_curve_to( cr, size * data[ 1 ].point.x, -size * data[ 1 ].point.y, size * data[ 2 ].point.x,
|
||||
-size * data[ 2 ].point.y, size * data[ 3 ].point.x, -size * data[ 3 ].point.y );
|
||||
break;
|
||||
case CAIRO_PATH_CLOSE_PATH:
|
||||
cairo_close_path( cr );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static bool _regular_font_lookup_glyph( const char* name, int namelen, gunichar* glyph )
|
||||
{
|
||||
for ( int i = 0; i < NR_GLYPHNAMES; i++ ) {
|
||||
if ( ( strlen( x49gp_glyphs[ i ].name ) == namelen ) && !strncmp( x49gp_glyphs[ i ].name, name, namelen ) ) {
|
||||
if ( glyph )
|
||||
*glyph = x49gp_glyphs[ i ].unichar;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int _regular_font_text_strlen( const char* text )
|
||||
{
|
||||
const char *p, *q;
|
||||
char c;
|
||||
int namelen;
|
||||
int n = 0;
|
||||
|
||||
p = text;
|
||||
while ( ( c = *p++ ) ) {
|
||||
if ( c != '\\' ) {
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
q = p;
|
||||
while ( *q ) {
|
||||
if ( ( *q == '\\' ) || ( *q == ' ' ) )
|
||||
break;
|
||||
q++;
|
||||
}
|
||||
if ( q == p ) {
|
||||
n++;
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
namelen = q - p;
|
||||
if ( *q == ' ' )
|
||||
q++;
|
||||
|
||||
if ( symbol_lookup_glyph_by_name( p, namelen, NULL ) ) {
|
||||
p = q;
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( _regular_font_lookup_glyph( p, namelen, NULL ) ) {
|
||||
p = q;
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert symbol .notdef here...
|
||||
*/
|
||||
p = q;
|
||||
n++;
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static int _regular_font_text_to_ucs4( const char* text, gunichar** ucs4p )
|
||||
{
|
||||
const char *p, *q;
|
||||
gunichar glyph;
|
||||
gunichar* ucs4;
|
||||
char c;
|
||||
int namelen;
|
||||
int i = 0;
|
||||
int n = _regular_font_text_strlen( text );
|
||||
|
||||
if ( n <= 0 )
|
||||
return n;
|
||||
|
||||
ucs4 = malloc( n * sizeof( gunichar ) );
|
||||
|
||||
p = text;
|
||||
while ( ( c = *p++ ) ) {
|
||||
if ( i == n ) {
|
||||
free( ucs4 );
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( c != '\\' ) {
|
||||
ucs4[ i++ ] = c;
|
||||
continue;
|
||||
}
|
||||
|
||||
q = p;
|
||||
while ( *q ) {
|
||||
if ( ( *q == '\\' ) || ( *q == ' ' ) )
|
||||
break;
|
||||
q++;
|
||||
}
|
||||
if ( q == p ) {
|
||||
ucs4[ i++ ] = *p++;
|
||||
continue;
|
||||
}
|
||||
namelen = q - p;
|
||||
if ( *q == ' ' )
|
||||
q++;
|
||||
|
||||
if ( symbol_lookup_glyph_by_name( p, namelen, &glyph ) ) {
|
||||
ucs4[ i++ ] = glyph;
|
||||
p = q;
|
||||
continue;
|
||||
}
|
||||
|
||||
if ( _regular_font_lookup_glyph( p, namelen, &glyph ) ) {
|
||||
ucs4[ i++ ] = glyph;
|
||||
p = q;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Insert symbol .notdef here...
|
||||
*/
|
||||
ucs4[ i++ ] = 0xe000;
|
||||
p = q;
|
||||
}
|
||||
|
||||
*ucs4p = ucs4;
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static void _regular_font_vtext_path( cairo_t* cr, double size, double x, double y, va_list ap )
|
||||
{
|
||||
cairo_text_extents_t extents;
|
||||
cairo_font_weight_t weight;
|
||||
cairo_font_slant_t slant;
|
||||
const x49gp_symbol_t* symbol;
|
||||
const char* text;
|
||||
gunichar* ucs4;
|
||||
char out[ 8 ];
|
||||
int bytes;
|
||||
int len;
|
||||
|
||||
slant = va_arg( ap, cairo_font_slant_t );
|
||||
weight = va_arg( ap, cairo_font_weight_t );
|
||||
text = va_arg( ap, const char* );
|
||||
|
||||
cairo_select_font_face( cr, opt.font, slant, weight );
|
||||
cairo_set_font_size( cr, size );
|
||||
|
||||
ucs4 = NULL;
|
||||
len = _regular_font_text_to_ucs4( text, &ucs4 );
|
||||
if ( len <= 0 )
|
||||
return;
|
||||
|
||||
for ( int j = 0; j < len; j++ ) {
|
||||
if ( g_unichar_type( ucs4[ j ] ) == G_UNICODE_PRIVATE_USE ) {
|
||||
/*
|
||||
* Draw Symbol, Increment x...
|
||||
*/
|
||||
symbol = symbol_get_by_glyph( ucs4[ j ] );
|
||||
if ( NULL == symbol )
|
||||
symbol = symbol_get_by_glyph( 0xe000 );
|
||||
|
||||
size *= symbol->prescale;
|
||||
|
||||
_regular_font_symbol_path( cr, size, x, y, symbol );
|
||||
|
||||
x += size * symbol->x_advance;
|
||||
y -= size * symbol->y_advance;
|
||||
|
||||
size *= symbol->postscale;
|
||||
|
||||
if ( symbol->prescale * symbol->postscale != 1. )
|
||||
cairo_set_font_size( cr, size );
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
bytes = g_unichar_to_utf8( ucs4[ j ], out );
|
||||
out[ bytes ] = '\0';
|
||||
|
||||
cairo_text_extents( cr, out, &extents );
|
||||
|
||||
cairo_move_to( cr, x, y );
|
||||
|
||||
cairo_text_path( cr, out );
|
||||
|
||||
x += extents.x_advance;
|
||||
y += extents.y_advance;
|
||||
}
|
||||
|
||||
free( ucs4 );
|
||||
}
|
||||
|
||||
void regular_font_measure_text( cairo_t* cr, double size, double* x_bearing, double* y_bearing, double* width, double* height,
|
||||
double* ascent, double* descent, ... )
|
||||
{
|
||||
va_list ap0, ap1;
|
||||
cairo_font_extents_t font_extents;
|
||||
cairo_font_weight_t weight;
|
||||
cairo_font_slant_t slant;
|
||||
double x1, y1, x2, y2, a, d;
|
||||
const char* text;
|
||||
|
||||
va_start( ap0, descent );
|
||||
va_copy( ap1, ap0 );
|
||||
|
||||
_regular_font_vtext_path( cr, size, 0.0, 0.0, ap0 );
|
||||
|
||||
va_end( ap0 );
|
||||
|
||||
cairo_fill_extents( cr, &x1, &y1, &x2, &y2 );
|
||||
|
||||
if ( y2 < 0.0 )
|
||||
y2 = 0.0;
|
||||
|
||||
a = 0.0;
|
||||
d = 0.0;
|
||||
|
||||
slant = va_arg( ap1, cairo_font_slant_t );
|
||||
weight = va_arg( ap1, cairo_font_weight_t );
|
||||
text = va_arg( ap1, const char* );
|
||||
( void )text;
|
||||
|
||||
cairo_select_font_face( cr, opt.font, slant, weight );
|
||||
cairo_set_font_size( cr, size );
|
||||
|
||||
cairo_font_extents( cr, &font_extents );
|
||||
|
||||
/*
|
||||
* Cairo seems to return overall height in ascent,
|
||||
* so fix this by calculating ascent = height - descent.
|
||||
*/
|
||||
if ( font_extents.ascent - font_extents.descent > a )
|
||||
a = font_extents.ascent - font_extents.descent;
|
||||
if ( font_extents.descent > -d )
|
||||
d = -font_extents.descent;
|
||||
|
||||
*x_bearing = x1;
|
||||
*y_bearing = y2;
|
||||
*width = x2 - x1;
|
||||
*height = y2 - y1;
|
||||
*ascent = a;
|
||||
*descent = d;
|
||||
|
||||
va_end( ap1 );
|
||||
}
|
||||
|
||||
void regular_font_draw_text( cairo_t* cr, GdkColor* color, double size, double line_width, int xoffset, int yoffset, ... )
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
va_start( ap, yoffset );
|
||||
|
||||
cairo_set_line_width( cr, line_width );
|
||||
cairo_set_source_rgb( cr, ( ( double )color->red ) / 65535.0, ( ( double )color->green ) / 65535.0,
|
||||
( ( double )color->blue ) / 65535.0 );
|
||||
|
||||
_regular_font_vtext_path( cr, size, xoffset, yoffset, ap );
|
||||
|
||||
if ( line_width == 0.0 )
|
||||
cairo_fill( cr );
|
||||
else
|
||||
cairo_stroke( cr );
|
||||
|
||||
va_end( ap );
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
/* $Id: bitmap_font.h,v 1.5 2008/12/11 12:18:17 ecd Exp $
|
||||
*/
|
||||
|
||||
#ifndef _REGULAR_FONT_H
|
||||
#define _REGULAR_FONT_H 1
|
||||
|
||||
#include <cairo.h>
|
||||
|
||||
void regular_font_measure_text( cairo_t* cr, double size, double* x_bearing, double* y_bearing, double* width, double* height,
|
||||
double* ascent, double* descent, ... );
|
||||
void regular_font_draw_text( cairo_t* cr, GdkColor* color, double size, double line_width, int xoffset, int yoffset, ... );
|
||||
|
||||
#endif /* !(_REGULAR_FONT_H) */
|
|
@ -1,516 +0,0 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
#include "ui_tiny_font.h"
|
||||
|
||||
#include "bitmaps/tiny_notdef.xbm"
|
||||
|
||||
#include "bitmaps/tiny_quotedbl.xbm"
|
||||
#include "bitmaps/tiny_numbersign.xbm"
|
||||
#include "bitmaps/tiny_ampersand.xbm"
|
||||
#include "bitmaps/tiny_parenleft.xbm"
|
||||
#include "bitmaps/tiny_parenright.xbm"
|
||||
#include "bitmaps/tiny_comma.xbm"
|
||||
#include "bitmaps/tiny_hyphen.xbm"
|
||||
#include "bitmaps/tiny_period.xbm"
|
||||
#include "bitmaps/tiny_slash.xbm"
|
||||
#include "bitmaps/tiny_colon.xbm"
|
||||
#include "bitmaps/tiny_less.xbm"
|
||||
#include "bitmaps/tiny_equal.xbm"
|
||||
#include "bitmaps/tiny_greater.xbm"
|
||||
#include "bitmaps/tiny_bracketleft.xbm"
|
||||
#include "bitmaps/tiny_bracketright.xbm"
|
||||
#include "bitmaps/tiny_underscore.xbm"
|
||||
#include "bitmaps/tiny_braceleft.xbm"
|
||||
#include "bitmaps/tiny_braceright.xbm"
|
||||
|
||||
#include "bitmaps/tiny_guillemotleft.xbm"
|
||||
#include "bitmaps/tiny_guillemotright.xbm"
|
||||
#include "bitmaps/tiny_arrowleft.xbm"
|
||||
#include "bitmaps/tiny_arrowright.xbm"
|
||||
|
||||
#include "bitmaps/tiny_large_comma.xbm"
|
||||
#include "bitmaps/tiny_overscore.xbm"
|
||||
|
||||
#include "bitmaps/tiny_xsuperior.xbm"
|
||||
#include "bitmaps/tiny_twosuperior.xbm"
|
||||
|
||||
#include "bitmaps/tiny_math_e.xbm"
|
||||
#include "bitmaps/tiny_math_x.xbm"
|
||||
#include "bitmaps/tiny_math_y.xbm"
|
||||
#include "bitmaps/tiny_math_pi.xbm"
|
||||
#include "bitmaps/tiny_math_summation.xbm"
|
||||
#include "bitmaps/tiny_math_radical.xbm"
|
||||
#include "bitmaps/tiny_math_partialdiff.xbm"
|
||||
#include "bitmaps/tiny_math_integral.xbm"
|
||||
#include "bitmaps/tiny_math_infinity.xbm"
|
||||
|
||||
#include "bitmaps/tiny_math_numbersign.xbm"
|
||||
#include "bitmaps/tiny_math_less.xbm"
|
||||
#include "bitmaps/tiny_math_greater.xbm"
|
||||
#include "bitmaps/tiny_math_lessequal.xbm"
|
||||
#include "bitmaps/tiny_math_greaterequal.xbm"
|
||||
#include "bitmaps/tiny_math_equal.xbm"
|
||||
#include "bitmaps/tiny_math_notequal.xbm"
|
||||
|
||||
#include "bitmaps/tiny_math_arrowleft.xbm"
|
||||
#include "bitmaps/tiny_math_arrowright.xbm"
|
||||
#include "bitmaps/tiny_math_downarrowleft.xbm"
|
||||
#include "bitmaps/tiny_math_downarrowright.xbm"
|
||||
|
||||
#include "bitmaps/tiny_zero.xbm"
|
||||
#include "bitmaps/tiny_one.xbm"
|
||||
#include "bitmaps/tiny_two.xbm"
|
||||
#include "bitmaps/tiny_three.xbm"
|
||||
|
||||
#include "bitmaps/tiny_A.xbm"
|
||||
#include "bitmaps/tiny_B.xbm"
|
||||
#include "bitmaps/tiny_C.xbm"
|
||||
#include "bitmaps/tiny_D.xbm"
|
||||
#include "bitmaps/tiny_E.xbm"
|
||||
#include "bitmaps/tiny_F.xbm"
|
||||
#include "bitmaps/tiny_G.xbm"
|
||||
#include "bitmaps/tiny_H.xbm"
|
||||
#include "bitmaps/tiny_I.xbm"
|
||||
#include "bitmaps/tiny_J.xbm"
|
||||
#include "bitmaps/tiny_K.xbm"
|
||||
#include "bitmaps/tiny_L.xbm"
|
||||
#include "bitmaps/tiny_M.xbm"
|
||||
#include "bitmaps/tiny_N.xbm"
|
||||
#include "bitmaps/tiny_O.xbm"
|
||||
#include "bitmaps/tiny_P.xbm"
|
||||
#include "bitmaps/tiny_Q.xbm"
|
||||
#include "bitmaps/tiny_R.xbm"
|
||||
#include "bitmaps/tiny_S.xbm"
|
||||
#include "bitmaps/tiny_T.xbm"
|
||||
#include "bitmaps/tiny_U.xbm"
|
||||
#include "bitmaps/tiny_V.xbm"
|
||||
#include "bitmaps/tiny_W.xbm"
|
||||
#include "bitmaps/tiny_X.xbm"
|
||||
#include "bitmaps/tiny_Y.xbm"
|
||||
#include "bitmaps/tiny_Z.xbm"
|
||||
|
||||
#include "bitmaps/tiny__i.xbm"
|
||||
|
||||
const tiny_font_t tiny_font = {
|
||||
7,
|
||||
-3,
|
||||
{ GLYPH( tiny, notdef ),
|
||||
|
||||
SPACE( "space", 4, 0 ),
|
||||
GLYPH( tiny, quotedbl ),
|
||||
GLYPH( tiny, numbersign ),
|
||||
GLYPH( tiny, ampersand ),
|
||||
GLYPH( tiny, parenleft ),
|
||||
GLYPH( tiny, parenright ),
|
||||
GLYPH( tiny, comma ),
|
||||
GLYPH( tiny, hyphen ),
|
||||
GLYPH( tiny, period ),
|
||||
GLYPH( tiny, slash ),
|
||||
|
||||
GLYPH( tiny, zero ),
|
||||
GLYPH( tiny, one ),
|
||||
GLYPH( tiny, two ),
|
||||
GLYPH( tiny, three ),
|
||||
|
||||
GLYPH( tiny, colon ),
|
||||
|
||||
GLYPH( tiny, less ),
|
||||
GLYPH( tiny, equal ),
|
||||
GLYPH( tiny, greater ),
|
||||
|
||||
GLYPH( tiny, A ),
|
||||
GLYPH( tiny, B ),
|
||||
GLYPH( tiny, C ),
|
||||
GLYPH( tiny, D ),
|
||||
GLYPH( tiny, E ),
|
||||
GLYPH( tiny, F ),
|
||||
GLYPH( tiny, G ),
|
||||
GLYPH( tiny, H ),
|
||||
GLYPH( tiny, I ),
|
||||
GLYPH( tiny, J ),
|
||||
GLYPH( tiny, K ),
|
||||
GLYPH( tiny, L ),
|
||||
GLYPH( tiny, M ),
|
||||
GLYPH( tiny, N ),
|
||||
GLYPH( tiny, O ),
|
||||
GLYPH( tiny, P ),
|
||||
GLYPH( tiny, Q ),
|
||||
GLYPH( tiny, R ),
|
||||
GLYPH( tiny, S ),
|
||||
GLYPH( tiny, T ),
|
||||
GLYPH( tiny, U ),
|
||||
GLYPH( tiny, V ),
|
||||
GLYPH( tiny, W ),
|
||||
GLYPH( tiny, X ),
|
||||
GLYPH( tiny, Y ),
|
||||
GLYPH( tiny, Z ),
|
||||
|
||||
GLYPH( tiny, bracketleft ),
|
||||
GLYPH( tiny, bracketright ),
|
||||
GLYPH( tiny, underscore ),
|
||||
|
||||
GLYPH( tiny, i ),
|
||||
|
||||
GLYPH( tiny, overscore ),
|
||||
GLYPH( tiny, arrowleft ),
|
||||
GLYPH( tiny, arrowright ),
|
||||
GLYPH( tiny, guillemotleft ),
|
||||
GLYPH( tiny, guillemotright ),
|
||||
|
||||
GLYPH( tiny, braceleft ),
|
||||
GLYPH( tiny, braceright ),
|
||||
|
||||
GLYPH( tiny, large_comma ),
|
||||
|
||||
GLYPH( tiny, xsuperior ),
|
||||
GLYPH( tiny, twosuperior ),
|
||||
|
||||
GLYPH( tiny, math_e ),
|
||||
GLYPH( tiny, math_x ),
|
||||
GLYPH( tiny, math_y ),
|
||||
GLYPH( tiny, math_pi ),
|
||||
GLYPH( tiny, math_summation ),
|
||||
GLYPH( tiny, math_radical ),
|
||||
GLYPH( tiny, math_partialdiff ),
|
||||
GLYPH( tiny, math_integral ),
|
||||
GLYPH( tiny, math_infinity ),
|
||||
|
||||
GLYPH( tiny, math_numbersign ),
|
||||
GLYPH( tiny, math_less ),
|
||||
GLYPH( tiny, math_greater ),
|
||||
GLYPH( tiny, math_lessequal ),
|
||||
GLYPH( tiny, math_greaterequal ),
|
||||
GLYPH( tiny, math_equal ),
|
||||
GLYPH( tiny, math_notequal ),
|
||||
|
||||
GLYPH( tiny, math_arrowleft ),
|
||||
GLYPH( tiny, math_arrowright ),
|
||||
GLYPH( tiny, math_downarrowleft ),
|
||||
GLYPH( tiny, math_downarrowright ),
|
||||
|
||||
SPACE( "kern-1", -1, -1 ),
|
||||
SPACE( "kern-2", -2, -2 ),
|
||||
SPACE( "kern-3", -3, -3 ),
|
||||
SPACE( "kern-4", -4, -4 ),
|
||||
SPACE( "kern-5", -5, -5 ),
|
||||
SPACE( "kern-6", -6, -6 ),
|
||||
SPACE( "kern-7", -7, -7 ),
|
||||
|
||||
{ NULL } }
|
||||
};
|
||||
|
||||
static unsigned char _tiny_font_lookup_glyph( const char* name, int namelen )
|
||||
{
|
||||
for ( int i = 0; tiny_font.glyphs[ i ].name; i++ )
|
||||
if ( ( strlen( tiny_font.glyphs[ i ].name ) == namelen ) && !strncmp( tiny_font.glyphs[ i ].name, name, namelen ) )
|
||||
return i;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static unsigned char _tiny_font_lookup_ascii( char c )
|
||||
{
|
||||
int namelen = 0;
|
||||
char* name;
|
||||
|
||||
switch ( c ) {
|
||||
case ' ':
|
||||
name = "space";
|
||||
break;
|
||||
case '!':
|
||||
name = "exclam";
|
||||
break;
|
||||
case '"':
|
||||
name = "quotedbl";
|
||||
break;
|
||||
case '#':
|
||||
name = "numbersign";
|
||||
break;
|
||||
case '$':
|
||||
name = "dollar";
|
||||
break;
|
||||
case '%':
|
||||
name = "percent";
|
||||
break;
|
||||
case '&':
|
||||
name = "ampersand";
|
||||
break;
|
||||
case '(':
|
||||
name = "parenleft";
|
||||
break;
|
||||
case ')':
|
||||
name = "parenright";
|
||||
break;
|
||||
case '*':
|
||||
name = "asterisk";
|
||||
break;
|
||||
case '+':
|
||||
name = "plus";
|
||||
break;
|
||||
case ',':
|
||||
name = "comma";
|
||||
break;
|
||||
case '-':
|
||||
name = "hyphen";
|
||||
break;
|
||||
case '.':
|
||||
name = "period";
|
||||
break;
|
||||
case '/':
|
||||
name = "slash";
|
||||
break;
|
||||
case '0':
|
||||
name = "zero";
|
||||
break;
|
||||
case '1':
|
||||
name = "one";
|
||||
break;
|
||||
case '2':
|
||||
name = "two";
|
||||
break;
|
||||
case '3':
|
||||
name = "three";
|
||||
break;
|
||||
case '4':
|
||||
name = "four";
|
||||
break;
|
||||
case '5':
|
||||
name = "five";
|
||||
break;
|
||||
case '6':
|
||||
name = "six";
|
||||
break;
|
||||
case '7':
|
||||
name = "seven";
|
||||
break;
|
||||
case '8':
|
||||
name = "eight";
|
||||
break;
|
||||
case '9':
|
||||
name = "nine";
|
||||
break;
|
||||
case ':':
|
||||
name = "colon";
|
||||
break;
|
||||
case ';':
|
||||
name = "semicolon";
|
||||
break;
|
||||
case '<':
|
||||
name = "less";
|
||||
break;
|
||||
case '=':
|
||||
name = "equal";
|
||||
break;
|
||||
case '>':
|
||||
name = "greater";
|
||||
break;
|
||||
case '?':
|
||||
name = "question";
|
||||
break;
|
||||
case '@':
|
||||
name = "at";
|
||||
break;
|
||||
case '[':
|
||||
name = "bracketleft";
|
||||
break;
|
||||
case '\\':
|
||||
name = "backslash";
|
||||
break;
|
||||
case ']':
|
||||
name = "bracketright";
|
||||
break;
|
||||
case '^':
|
||||
name = "asciicircum";
|
||||
break;
|
||||
case '_':
|
||||
name = "underscore";
|
||||
break;
|
||||
case '`':
|
||||
name = "quoteleft";
|
||||
break;
|
||||
case '{':
|
||||
name = "braceleft";
|
||||
break;
|
||||
case '|':
|
||||
name = "bar";
|
||||
break;
|
||||
case '}':
|
||||
name = "braceright";
|
||||
break;
|
||||
case '~':
|
||||
name = "asciitilde";
|
||||
break;
|
||||
default:
|
||||
name = &c;
|
||||
namelen = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
if ( 0 == namelen )
|
||||
namelen = strlen( name );
|
||||
|
||||
return _tiny_font_lookup_glyph( name, namelen );
|
||||
}
|
||||
|
||||
static inline int _tiny_font_strlen( const char* text )
|
||||
{
|
||||
const char *p, *q;
|
||||
char c;
|
||||
int n = 0;
|
||||
|
||||
p = text;
|
||||
while ( ( c = *p++ ) ) {
|
||||
if ( c != '\\' ) {
|
||||
n++;
|
||||
continue;
|
||||
}
|
||||
|
||||
q = p;
|
||||
while ( *q ) {
|
||||
if ( ( *q == '\\' ) || ( *q == ' ' ) )
|
||||
break;
|
||||
q++;
|
||||
}
|
||||
if ( q == p ) {
|
||||
n++;
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
if ( *q == ' ' )
|
||||
q++;
|
||||
|
||||
n++;
|
||||
p = q;
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
static int _tiny_font_text_to_glyphs( const char* text, unsigned char** glyphp )
|
||||
{
|
||||
unsigned char* glyphs;
|
||||
const char *p, *q;
|
||||
unsigned char c;
|
||||
int namelen;
|
||||
int i, n;
|
||||
|
||||
n = _tiny_font_strlen( text );
|
||||
if ( n <= 0 )
|
||||
return n;
|
||||
|
||||
glyphs = malloc( n );
|
||||
|
||||
i = 0;
|
||||
|
||||
p = text;
|
||||
while ( ( c = *p++ ) ) {
|
||||
if ( i == n ) {
|
||||
free( glyphs );
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( c != '\\' ) {
|
||||
glyphs[ i++ ] = _tiny_font_lookup_ascii( c );
|
||||
continue;
|
||||
}
|
||||
|
||||
q = p;
|
||||
while ( *q ) {
|
||||
if ( ( *q == '\\' ) || ( *q == ' ' ) )
|
||||
break;
|
||||
q++;
|
||||
}
|
||||
if ( q == p ) {
|
||||
glyphs[ i++ ] = _tiny_font_lookup_ascii( *p++ );
|
||||
continue;
|
||||
}
|
||||
namelen = q - p;
|
||||
if ( *q == ' ' )
|
||||
q++;
|
||||
|
||||
glyphs[ i++ ] = _tiny_font_lookup_glyph( p, namelen );
|
||||
p = q;
|
||||
}
|
||||
|
||||
*glyphp = glyphs;
|
||||
return n;
|
||||
}
|
||||
|
||||
void tiny_font_measure_text( const char* text, int* width, int* height, int* ascent, int* descent )
|
||||
{
|
||||
const tiny_glyph_t* glyph;
|
||||
unsigned char* glyphs;
|
||||
int n, w, a, d;
|
||||
|
||||
w = 0;
|
||||
a = 0;
|
||||
d = 0;
|
||||
|
||||
n = _tiny_font_text_to_glyphs( text, &glyphs );
|
||||
|
||||
for ( int i = 0; i < n; i++ ) {
|
||||
glyph = &tiny_font.glyphs[ glyphs[ i ] ];
|
||||
|
||||
w += glyph->width;
|
||||
|
||||
if ( glyph->ascent > a )
|
||||
a = glyph->ascent;
|
||||
if ( glyph->descent < d )
|
||||
d = glyph->descent;
|
||||
}
|
||||
|
||||
*width = w - 1;
|
||||
*height = tiny_font.ascent - tiny_font.descent;
|
||||
*ascent = a;
|
||||
*descent = d;
|
||||
|
||||
if ( n > 0 )
|
||||
free( glyphs );
|
||||
}
|
||||
|
||||
void tiny_font_draw_text( GdkDrawable* drawable, GdkColor* color, int x, int y, const char* text )
|
||||
{
|
||||
const tiny_glyph_t* glyph;
|
||||
unsigned char* glyphs;
|
||||
GdkBitmap* bitmap;
|
||||
GdkGC* gc;
|
||||
int n, w, h;
|
||||
|
||||
gc = gdk_gc_new( drawable );
|
||||
gdk_gc_set_rgb_fg_color( gc, color );
|
||||
|
||||
n = _tiny_font_text_to_glyphs( text, &glyphs );
|
||||
|
||||
for ( int i = 0; i < n; i++ ) {
|
||||
glyph = &tiny_font.glyphs[ glyphs[ i ] ];
|
||||
|
||||
w = glyph->width - glyph->kern;
|
||||
h = glyph->ascent - glyph->descent;
|
||||
|
||||
if ( w <= 0 || h <= 0 ) {
|
||||
x += glyph->width;
|
||||
continue;
|
||||
}
|
||||
|
||||
bitmap = gdk_bitmap_create_from_data( NULL, ( char* )glyph->bits, w, h );
|
||||
|
||||
gdk_gc_set_ts_origin( gc, x + glyph->kern, y + tiny_font.ascent - glyph->ascent );
|
||||
gdk_gc_set_stipple( gc, bitmap );
|
||||
gdk_gc_set_fill( gc, GDK_STIPPLED );
|
||||
|
||||
gdk_draw_rectangle( drawable, gc, true, x + glyph->kern, y + tiny_font.ascent - glyph->ascent, w, h );
|
||||
|
||||
g_object_unref( bitmap );
|
||||
|
||||
x += glyph->width;
|
||||
}
|
||||
|
||||
g_object_unref( gc );
|
||||
|
||||
if ( n > 0 )
|
||||
free( glyphs );
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
#ifndef _X49GP_TINY_FONT_H
|
||||
#define _X49GP_TINY_FONT_H 1
|
||||
|
||||
typedef struct {
|
||||
const char* name;
|
||||
int width;
|
||||
int kern;
|
||||
int ascent;
|
||||
int descent;
|
||||
const unsigned char* bits;
|
||||
} tiny_glyph_t;
|
||||
|
||||
typedef struct {
|
||||
int ascent;
|
||||
int descent;
|
||||
tiny_glyph_t glyphs[];
|
||||
} tiny_font_t;
|
||||
|
||||
#define GLYPH( font, name ) \
|
||||
{ #name, \
|
||||
font##_##name##_width - font##_##name##_x_hot, \
|
||||
-font##_##name##_x_hot, \
|
||||
font##_##name##_y_hot + 1, \
|
||||
font##_##name##_y_hot + 1 - font##_##name##_height, \
|
||||
font##_##name##_bits }
|
||||
|
||||
#define SPACE( name, width, kern ) { name, width, kern, 0, 0, NULL }
|
||||
|
||||
extern const tiny_font_t tiny_font;
|
||||
|
||||
void tiny_font_measure_text( const char* text, int* width, int* height, int* ascent, int* descent );
|
||||
void tiny_font_draw_text( GdkDrawable* drawable, GdkColor* color, int x, int y, const char* text );
|
||||
|
||||
#endif /* !(_X49GP_TINY_FONT_H) */
|
Loading…
Reference in a new issue