font.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. * font.h -- `Soft' font definitions
  3. *
  4. * Created 1995 by Geert Uytterhoeven
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file COPYING in the main directory of this archive
  8. * for more details.
  9. */
  10. #ifndef _VIDEO_FONT_H
  11. #define _VIDEO_FONT_H
  12. #include <linux/types.h>
  13. struct font_desc {
  14. int idx;
  15. const char *name;
  16. int width, height;
  17. const void *data;
  18. int pref;
  19. };
  20. #define VGA8x8_IDX 0
  21. #define VGA8x16_IDX 1
  22. #define PEARL8x8_IDX 2
  23. #define VGA6x11_IDX 3
  24. #define FONT7x14_IDX 4
  25. #define FONT10x18_IDX 5
  26. #define SUN8x16_IDX 6
  27. #define SUN12x22_IDX 7
  28. #define ACORN8x8_IDX 8
  29. #define MINI4x6_IDX 9
  30. #define FONT6x10_IDX 10
  31. #define TER16x32_IDX 11
  32. #define FONT6x8_IDX 12
  33. extern const struct font_desc font_vga_8x8,
  34. font_vga_8x16,
  35. font_pearl_8x8,
  36. font_vga_6x11,
  37. font_7x14,
  38. font_10x18,
  39. font_sun_8x16,
  40. font_sun_12x22,
  41. font_acorn_8x8,
  42. font_mini_4x6,
  43. font_6x10,
  44. font_ter_16x32,
  45. font_6x8;
  46. /* Find a font with a specific name */
  47. extern const struct font_desc *find_font(const char *name);
  48. /* Get the default font for a specific screen size */
  49. extern const struct font_desc *get_default_font(int xres, int yres,
  50. u32 font_w, u32 font_h);
  51. /* Max. length for the name of a predefined font */
  52. #define MAX_FONT_NAME 32
  53. /* Extra word getters */
  54. #define REFCOUNT(fd) (((int *)(fd))[-1])
  55. #define FNTSIZE(fd) (((int *)(fd))[-2])
  56. #define FNTCHARCNT(fd) (((int *)(fd))[-3])
  57. #define FNTSUM(fd) (((int *)(fd))[-4])
  58. #define FONT_EXTRA_WORDS 4
  59. struct font_data {
  60. unsigned int extra[FONT_EXTRA_WORDS];
  61. const unsigned char data[];
  62. } __packed;
  63. #endif /* _VIDEO_FONT_H */