#pragma once

#include "holly/ta_parameter.hpp"

namespace glyph {
  constexpr int texture_width = 128;
  constexpr int texture_height = 256;
  constexpr int width = 9;
  constexpr int height = 12;
  constexpr int hori_advance = 8;
  constexpr int vert_advance = 9;
  constexpr int row_stride = glyph::texture_width / glyph::width;

  const int horizontal_bar = 0x16;
  const int interpunct = 0xb7;
};

void transfer_global_polygon_glyph(ta_parameter_writer& writer);

void transfer_glyph(ta_parameter_writer& writer, int c,
                    float x, float y, float z,
                    int base_color);

int transfer_string(ta_parameter_writer& writer, const char * s,
                    float x, float y, float z,
                    int base_color);

int transfer_integer(ta_parameter_writer& writer, int n,
                     float x, float y, float z,
                     int length, int fill,
                     int base_color);

int transfer_hex_integer(ta_parameter_writer& writer, int n,
                         float x, float y, float z,
                         int length, int fill,
                         int base_color);

int transfer_hex_integer(ta_parameter_writer& writer, int n, int x, int y,
                         int length, int fill,
                         int base_color);

void transfer_rectangle(ta_parameter_writer& writer,
                        float x, float y, float z,
                        float width, float height,
                        int base_color);

void transfer_vertical_border(ta_parameter_writer& writer, float x, float y, int length);

void transfer_horizontal_border(ta_parameter_writer& writer, float x, float y, int length);
