#pragma once

#include <string>
#include <vector>

struct Resolved_font {
    std::string family_name {};   // "Crimson Pro"
    std::string dir_name {};      // "crimson-pro"
    std::string font_dir {};      // Full path to font directory
    std::string css_file {};      // Full path to .css file
    bool from_cache = false;
    // .ttf filenames for each variant (empty if variant not available):
    std::string regular {};
    std::string bold {};
    std::string italic {};
    std::string bold_italic {};
    float xheight_ratio = 0.0f;   // x-height / unitsPerEm from OS/2 table
    float capheight_ratio = 0.0f;  // cap-height / unitsPerEm from OS/2 table
};

std::string name_to_dirname(std::string name);
std::string name_to_google_query(std::string name);
Resolved_font resolve_font(std::string family_name);
void install_resolved_font(const Resolved_font& font, std::string output_dir);
