#pragma once

#include <stdint.h>

#include "holly/ta_parameter.hpp"

namespace font {

  struct font {
    uint32_t texture_size;
    uint32_t texture_offset;
    int16_t texture_width;
    int16_t texture_height;
    int8_t hori_advance;
    int8_t width;
    int8_t height;
    int8_t row_stride;

    enum font_type {
      ter_u24n,
      ter_u32n,
    };
  };

  extern const font fonts[];

  void draw_glyph_global(ta_parameter_writer& writer, const font& face);

  void draw_glyph(ta_parameter_writer& writer,
                  const font& face,
                  int c,
                  float x, float y, float z,
                  int base_color);

  void draw_string(ta_parameter_writer& writer,
                   const font& face,
                   const char * s,
                   float x, float y, float z,
                   int base_color);
}
