Font Testing

This commit is contained in:
2022-10-24 13:48:17 -07:00
parent e4806d380f
commit 6ba8720667
15 changed files with 270 additions and 93 deletions

View File

@ -0,0 +1,39 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include "FontMeasure.hpp"
using namespace Dawn;
float_t FontMeasure::getWidth() {
return this->width;
}
float_t FontMeasure::getHeight() {
return this->height;
}
int32_t FontMeasure::getQuadCount() {
return this->realLength;
}
size_t FontMeasure::getLineCount() {
return this->lines.size();
}
int32_t FontMeasure::getQuadsOnLine(int32_t line) {
return this->lines[line].length;
}
int32_t FontMeasure::getQuadIndexOnLine(int32_t line) {
return this->lines[line].start;
}
void FontMeasure::addLine(int32_t start, int32_t len) {
struct FontLineMeasure info;
info.start = start;
info.length = len;
this->lines.push_back(info);
}