52 lines
1.1 KiB
C++
52 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <iostream>
|
|
#include <stdint.h>
|
|
#include "IFont.h"
|
|
|
|
class TrueTypeFont : public IFont
|
|
{
|
|
public:
|
|
|
|
using Fixed = int32_t;
|
|
using LongDateTime = int64_t;
|
|
using FWord = int16_t;
|
|
|
|
// https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html
|
|
struct HeadTable
|
|
{
|
|
Fixed version{0};
|
|
Fixed fontRevision{0};
|
|
uint32_t checksumAdjustment{0};
|
|
uint32_t magicNumber{0};
|
|
uint16_t flags{0};
|
|
uint16_t unitsPerEm{0};
|
|
LongDateTime created{0};
|
|
LongDateTime modified{0};
|
|
FWord xMin{0};
|
|
FWord yMin{0};
|
|
FWord xMax{0};
|
|
FWord yMax{0};
|
|
uint16_t macStyle{0};
|
|
uint16_t lowestRecPPEM{0};
|
|
int16_t fontDirectionHint{0};
|
|
int16_t indexToLocFormat{0};
|
|
int16_t glyphDataFormat{0};
|
|
};
|
|
|
|
std::string logHeadTable() const;
|
|
|
|
void setHeadTable(const HeadTable& table)
|
|
{
|
|
mHeadTable = table;
|
|
}
|
|
|
|
void dumpInfo() override
|
|
{
|
|
std::cout << "Got ttf" << std::endl;
|
|
}
|
|
|
|
private:
|
|
|
|
HeadTable mHeadTable;
|
|
};
|