blog/cpp/fonts/core/font.cpp

24 lines
493 B
C++
Raw Normal View History

2024-09-13 15:10:58 +08:00
#include "font.h"
#include "tables/table_name.h"
#include "reader/buffer.h"
#include <iostream>
#include "../reader/file.h"
font::font(const char* fontFile){
file rd(fontFile);
path = rd.getPath();
read(&rd);
}
void font::read(reader* rd){
//读取字体头
head.read(rd);
//读取表信息
table.read(rd, head.getTableCount());
}
void font::display(){
std::cout<<"font file"<<path<<" readed."<<std::endl;
head.display();
table.display();
}