// Copyright (c) 2024 Caleb Hearon // Stuff common to all perspectives on fonts: CSS, OS fonts, querying, etc. #pragma once #include #include enum class FontStyle { Normal, Italic, Oblique }; enum class FontVariant { Normal, SmallCaps }; // Descriptors and properties (see next comments) struct FontBase { uint16_t weight{400}; FontVariant variant{FontVariant::Normal}; FontStyle style{FontStyle::Normal}; }; // Descriptors describe real fonts on the OS struct FontDescriptor : FontBase { std::unique_ptr family; std::unique_ptr url = nullptr; std::unique_ptr data = nullptr; size_t data_len = 0; }; // Properties describe desired fonts from CSS/ctx.font struct FontProperties : FontBase { std::vector families; double size{16.0f}; };