/* font_internal.h - Font declarations for use internally by the font module.
 * Users of the font module should not include this header. */
/*
 *  GRUB  --  GRand Unified Bootloader
 *  Copyright (C) 2003,2005,2006,2007,2008  Free Software Foundation, Inc.
 *
 *  GRUB is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  GRUB is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef GRUB_FONT_INTERNAL_HEADER
#define GRUB_FONT_INTERNAL_HEADER 1

#include <grub/file.h>
#include <grub/misc.h>
#include <grub/dl.h>
#include <grub/normal.h>
#include <grub/types.h>
#include <grub/mm.h>
#include <grub/font.h>

#define FONT_DEBUG 0

struct char_index_entry
{
  grub_uint32_t code;
  grub_uint8_t storage_flags;
  grub_uint32_t offset;
  struct grub_font_glyph *glyph;   /* Glyph if loaded, or null. */
};

struct grub_font
{
  char *name;
  grub_file_t file;
  short max_char_width;
  short max_char_height;
  short ascent;
  short descent;
  grub_uint32_t num_chars;
  struct char_index_entry *char_index;
};

struct font_node
{
  struct font_node *next;
  struct grub_font *value;
};

extern struct font_node *grub_font_list;


/****** loader.c ******/

/* Initialize the font loader module. */
void
grub_font_loader_init (void);


#endif /* ! GRUB_FONT_INTERNAL_HEADER */

