|
@@ -156,7 +156,7 @@ static void fbcon_store ( struct fbcon *fbcon, struct fbcon_text_cell *cell,
|
156
|
156
|
*/
|
157
|
157
|
static void fbcon_draw ( struct fbcon *fbcon, struct fbcon_text_cell *cell,
|
158
|
158
|
unsigned int xpos, unsigned int ypos ) {
|
159
|
|
- struct fbcon_font_glyph glyph;
|
|
159
|
+ uint8_t glyph[fbcon->font->height];
|
160
|
160
|
size_t offset;
|
161
|
161
|
size_t pixel_len;
|
162
|
162
|
size_t skip_len;
|
|
@@ -167,9 +167,7 @@ static void fbcon_draw ( struct fbcon *fbcon, struct fbcon_text_cell *cell,
|
167
|
167
|
void *src;
|
168
|
168
|
|
169
|
169
|
/* Get font character */
|
170
|
|
- copy_from_user ( &glyph, fbcon->font->start,
|
171
|
|
- ( cell->character * sizeof ( glyph ) ),
|
172
|
|
- sizeof ( glyph ) );
|
|
170
|
+ fbcon->font->glyph ( cell->character, glyph );
|
173
|
171
|
|
174
|
172
|
/* Calculate pixel geometry */
|
175
|
173
|
offset = ( fbcon->indent +
|
|
@@ -182,7 +180,7 @@ static void fbcon_draw ( struct fbcon *fbcon, struct fbcon_text_cell *cell,
|
182
|
180
|
transparent = ( cell->background == FBCON_TRANSPARENT );
|
183
|
181
|
|
184
|
182
|
/* Draw character rows */
|
185
|
|
- for ( row = 0 ; row < FBCON_CHAR_HEIGHT ; row++ ) {
|
|
183
|
+ for ( row = 0 ; row < fbcon->font->height ; row++ ) {
|
186
|
184
|
|
187
|
185
|
/* Draw background picture, if applicable */
|
188
|
186
|
if ( transparent ) {
|
|
@@ -197,7 +195,7 @@ static void fbcon_draw ( struct fbcon *fbcon, struct fbcon_text_cell *cell,
|
197
|
195
|
}
|
198
|
196
|
|
199
|
197
|
/* Draw character row */
|
200
|
|
- for ( column = FBCON_CHAR_WIDTH, bitmask = glyph.bitmask[row] ;
|
|
198
|
+ for ( column = FBCON_CHAR_WIDTH, bitmask = glyph[row] ;
|
201
|
199
|
column ; column--, bitmask <<= 1, offset += pixel_len ) {
|
202
|
200
|
if ( bitmask & 0x80 ) {
|
203
|
201
|
src = &cell->foreground;
|
|
@@ -614,7 +612,8 @@ int fbcon_init ( struct fbcon *fbcon, userptr_t start,
|
614
|
612
|
/* Expand margin to accommodate whole characters */
|
615
|
613
|
width = ( pixel->width - margin->left - margin->right );
|
616
|
614
|
height = ( pixel->height - margin->top - margin->bottom );
|
617
|
|
- if ( ( width < FBCON_CHAR_WIDTH ) || ( height < FBCON_CHAR_HEIGHT ) ) {
|
|
615
|
+ if ( ( width < FBCON_CHAR_WIDTH ) ||
|
|
616
|
+ ( height < ( ( int ) font->height ) ) ) {
|
618
|
617
|
DBGC ( fbcon, "FBCON %p has unusable character area "
|
619
|
618
|
"[%d-%d),[%d-%d)\n", fbcon,
|
620
|
619
|
margin->left, ( pixel->width - margin->right ),
|
|
@@ -623,7 +622,7 @@ int fbcon_init ( struct fbcon *fbcon, userptr_t start,
|
623
|
622
|
goto err_margin;
|
624
|
623
|
}
|
625
|
624
|
xgap = ( width % FBCON_CHAR_WIDTH );
|
626
|
|
- ygap = ( height % FBCON_CHAR_HEIGHT );
|
|
625
|
+ ygap = ( height % font->height );
|
627
|
626
|
fbcon->margin.left = ( margin->left + ( xgap / 2 ) );
|
628
|
627
|
fbcon->margin.top = ( margin->top + ( ygap / 2 ) );
|
629
|
628
|
fbcon->margin.right = ( margin->right + ( xgap - ( xgap / 2 ) ) );
|
|
@@ -633,9 +632,9 @@ int fbcon_init ( struct fbcon *fbcon, userptr_t start,
|
633
|
632
|
|
634
|
633
|
/* Derive character geometry from pixel geometry */
|
635
|
634
|
fbcon->character.width = ( width / FBCON_CHAR_WIDTH );
|
636
|
|
- fbcon->character.height = ( height / FBCON_CHAR_HEIGHT );
|
|
635
|
+ fbcon->character.height = ( height / font->height );
|
637
|
636
|
fbcon->character.len = ( pixel->len * FBCON_CHAR_WIDTH );
|
638
|
|
- fbcon->character.stride = ( pixel->stride * FBCON_CHAR_HEIGHT );
|
|
637
|
+ fbcon->character.stride = ( pixel->stride * font->height );
|
639
|
638
|
DBGC ( fbcon, "FBCON %p is pixel %dx%d, char %dx%d at "
|
640
|
639
|
"[%d-%d),[%d-%d)\n", fbcon, fbcon->pixel->width,
|
641
|
640
|
fbcon->pixel->height, fbcon->character.width,
|