-
- /* Choose masks and copy font data to local variables */
- i_char_mask = (i_style & VOID_TEXT) ? 0 : 0xff;
- i_border_mask = (i_style & OUTLINED_TEXT) ? 0xff : 0;
- i_bg_mask = (i_style & OPAQUE_TEXT) ? 0xff : 0;
-
- i_font_bytes_per_line = p_font->i_bytes_per_line;
- i_font_height = p_font->i_height;
- i_interspacing = i_bytes_per_pixel * ((i_style & WIDE_TEXT) ?
- p_font->i_interspacing * 2 :
- p_font->i_interspacing);
-
- /* compute where to stop... */
- i_end = (int) (i_percent * strlen(psz_text) / 100LL);
- if(i_end > strlen(psz_text))
- i_end = strlen(psz_text);
-
-
- /* Print text */
- for( i_position = 0; i_position < i_end; i_position++ ,psz_text++ )
- {
- /* Check that the character is valid */
- if( (*psz_text >= p_font->i_first) && (*psz_text <= p_font->i_last) )
- {
- /* Select character - bytes per char is always valid, event for
- * non fixed fonts */
- p_char = p_font->p_data + (*psz_text - p_font->i_first) * p_font->i_bytes_per_char;
- p_border = p_char + (p_font->i_last - p_font->i_first + 1) * p_font->i_bytes_per_char;
-
- /* Select base address for output */
- switch( p_font->i_type )
- {
- case VOUT_FIXED_FONT:
- /*
- * Simple fixed width font
- */
-
- /* Italic text: shift picture start right */
- if( i_style & ITALIC_TEXT )
- {
- p_pic += i_bytes_per_pixel * (p_font->i_height / 3);
- }
-
- /* Print character */
- for( i_line = 0; i_line < i_font_height; i_line ++ )
- {
- for( i_byte = 0; i_byte < i_font_bytes_per_line; i_byte++, p_char++, p_border++)
- {
- /* Put pixels */
- p_PutByte( p_pic + i_bytes_per_line * i_line, i_byte,
- *p_char & i_char_mask, *p_border & i_border_mask, i_bg_mask,
- i_char_color, i_border_color, i_bg_color );
- }
-
- /* Italic text: shift picture start left */
- if( (i_style & ITALIC_TEXT) && !(i_line % 3) )
- {
- p_pic -= i_bytes_per_pixel;
- }
- }
-
- /* Jump to next character */
- p_pic += i_interspacing;
- break;
-#ifdef DEBUG
- default:
- intf_DbgMsg("error: unknown font type %d", p_font->i_type );
- break;
-#endif
- }
- }
-
- }
-}
-
-/* following functions are local */
-
-/*****************************************************************************
- * PutByte8: print a fixed width font character byte in 1 Bpp
- *****************************************************************************/
-static void PutByte8( u8 *p_pic, int i_byte, int i_char, int i_border,
- int i_bg, u32 i_char_color, u32 i_border_color,
- u32 i_bg_color )
-{
- /* Computes position offset and background mask */
- p_pic += 8 * i_byte;
- i_bg &= ~(i_char | i_border);
-
- /* Put character bits */
- PUT_BYTE_MASK(i_char, i_char_color);
- PUT_BYTE_MASK(i_border, i_border_color);
- PUT_BYTE_MASK(i_bg, i_bg_color);
-}
-
-/*****************************************************************************
- * PutByte16: print a fixed width font character byte in 2 Bpp
- *****************************************************************************/
-static void PutByte16( u16 *p_pic, int i_byte, int i_char, int i_border,
- int i_bg, u32 i_char_color, u32 i_border_color,
- u32 i_bg_color )
-{
- /* Computes position offset and background mask */
- p_pic += 8 * i_byte;
- i_bg &= ~(i_char | i_border);
-
- /* Put character bits */
- PUT_BYTE_MASK(i_char, i_char_color);
- PUT_BYTE_MASK(i_border, i_border_color);
- PUT_BYTE_MASK(i_bg, i_bg_color);