#pragma once #include "types.h" #include "enums.h" namespace artery_font { template struct Glyph { uint32 codepoint; uint32 image; struct { REAL l, b, r, t; } planeBounds, imageBounds; struct { REAL h, v; } advance; }; template struct KernPair { uint32 codepoint1, codepoint2; struct { REAL h, v; } advance; }; template class LIST, class STRING> struct FontVariant { uint32 flags; uint32 weight; CodepointType codepointType; ImageType imageType; uint32 fallbackVariant; uint32 fallbackGlyph; struct Metrics { // In pixels: REAL fontSize; REAL distanceRange; // Proportional to font size: REAL emSize; REAL ascender, descender; REAL lineHeight; REAL underlineY, underlineThickness; REAL reserved[24]; } metrics; STRING name; STRING metadata; LIST > glyphs; LIST > kernPairs; }; template struct FontImage { uint32 flags; ImageEncoding encoding; uint32 width, height; uint32 channels; PixelFormat pixelFormat; ImageType imageType; struct { uint32 rowLength; ImageOrientation orientation; } rawBinaryFormat; uint32 childImages; uint32 textureFlags; STRING metadata; BYTE_ARRAY data; }; template struct FontAppendix { STRING metadata; BYTE_ARRAY data; }; template class LIST, class BYTE_ARRAY, class STRING> struct ArteryFont { typedef FontVariant Variant; typedef FontImage Image; typedef FontAppendix Appendix; MetadataFormat metadataFormat; STRING metadata; LIST variants; LIST images; LIST appendices; }; }