/*
 * Kangaroo Punch MultiPlayer Game Server Mark II
 * Copyright (C) 2020-2021  Scott Duensing
 *
 * This program 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.
 *
 * This program 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 this program.  If not, see <https://www.gnu.org/licenses/>.
 *
 */


#ifndef FONT_H
#define FONT_H


#include "os.h"
#include "vesa.h"


typedef struct FontS {
	uint8_t   width;         // Width of each character in pixels.
	uint8_t   height;        // Height of each character in pixels.
	uint8_t   span;          // Number of characters per line in font data.
	uint8_t   count;         // Number of characters in font, minus 1.
	uint16_t  widthPixels;   // Width of line of font data in pixels/bits.
	uint16_t  heightPixels;  // Number of lines of font data in pixels/bits.
	uint8_t  *bits;          // Actual font bits.
} FontT;


FontT    *fontFromRAMLoad(uint8_t *pointer);
uint16_t  fontHeightGet(FontT *font);
FontT    *fontLoad(char *filename);
void      fontRender(FontT *font, char *string, ColorT foreground, ColorT background, uint16_t x, uint16_t y);
void      fontUnload(FontT **font);
uint16_t  fontWidthGet(FontT *font);


#endif // FONT_H
