#pragma once
#include "freetype/freetype.h"
#include "interface/font_interface.h"

class freetype_interface : public font_face_interface {
public:
	[[nodiscard]] std::string get_font_name() const override;
	[[nodiscard]] std::string get_font_family() const override;
	[[nodiscard]] std::string get_font_style() const override;
	[[nodiscard]] bool supports_color_emoji() const override;
	[[nodiscard]] font_v_metrics_t get_metrics() const override;
	[[nodiscard]] std::shared_ptr<image_heap_t> get_glyph_image(int32_t in_glyph_id) const override;
	[[nodiscard]] std::shared_ptr<image_heap_t> get_emoji_image(int32_t in_glyph_id) const override;
	[[nodiscard]] uint32_t find_glyph_index(uint32_t in_unicode_codepoint) const override;
	[[nodiscard]] float get_kerning(uint32_t in_first_glyph_id, uint32_t in_second_glyph_id) const override;
	[[nodiscard]] glyph_shaped_t shape_glyph(uint32_t in_glyph_id) const override;

protected:
	bool on_load() override;
	void on_set_font_size(float in_size) override;
protected:
	FT_Face face_{};
};
