font.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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. unsigned int width, height;
  17. unsigned int charcount;
  18. const void *data;
  19. int pref;
  20. };
  21. #define VGA8x8_IDX 0
  22. #define VGA8x16_IDX 1
  23. #define PEARL8x8_IDX 2
  24. #define VGA6x11_IDX 3
  25. #define FONT7x14_IDX 4
  26. #define FONT10x18_IDX 5
  27. #define SUN8x16_IDX 6
  28. #define SUN12x22_IDX 7
  29. #define ACORN8x8_IDX 8
  30. #define MINI4x6_IDX 9
  31. #define FONT6x10_IDX 10
  32. #define TER16x32_IDX 11
  33. #define FONT6x8_IDX 12
  34. extern const struct font_desc font_vga_8x8,
  35. font_vga_8x16,
  36. font_pearl_8x8,
  37. font_vga_6x11,
  38. font_7x14,
  39. font_10x18,
  40. font_sun_8x16,
  41. font_sun_12x22,
  42. font_acorn_8x8,
  43. font_mini_4x6,
  44. font_6x10,
  45. font_ter_16x32,
  46. font_6x8;
  47. /* Find a font with a specific name */
  48. extern const struct font_desc *find_font(const char *name);
  49. /* Get the default font for a specific screen size */
  50. extern const struct font_desc *get_default_font(int xres, int yres,
  51. u32 font_w, u32 font_h);
  52. /* Max. length for the name of a predefined font */
  53. #define MAX_FONT_NAME 32
  54. /* Extra word getters */
  55. #define REFCOUNT(fd) (((int *)(fd))[-1])
  56. #define FNTSIZE(fd) (((int *)(fd))[-2])
  57. #define FNTCHARCNT(fd) (((int *)(fd))[-3])
  58. #define FNTSUM(fd) (((int *)(fd))[-4])
  59. #define FONT_EXTRA_WORDS 4
  60. struct font_data {
  61. unsigned int extra[FONT_EXTRA_WORDS];
  62. const unsigned char data[];
  63. } __packed;
  64. #endif /* _VIDEO_FONT_H */