mirror of
https://github.com/godotengine/godot.git
synced 2024-12-27 11:24:59 +08:00
4c3f7d1290
Adds multi-channel SDF font texture generation and rendering support. Adds per-font oversampling support. Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading. Adds BMFont binary format and outline support.
19 lines
252 B
C++
19 lines
252 B
C++
|
|
#pragma once
|
|
|
|
#include "arithmetics.hpp"
|
|
|
|
namespace msdfgen {
|
|
|
|
typedef unsigned char byte;
|
|
|
|
inline byte pixelFloatToByte(float x) {
|
|
return byte(clamp(256.f*x, 255.f));
|
|
}
|
|
|
|
inline float pixelByteToFloat(byte x) {
|
|
return 1.f/255.f*float(x);
|
|
}
|
|
|
|
}
|