summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJonathan Bradley <jcb@pikum.xyz>2025-02-17 10:49:00 -0500
committerJonathan Bradley <jcb@pikum.xyz>2025-02-17 10:49:00 -0500
commitcdad60ab666ac27209138ba127d91caf7337e6fc (patch)
treeff93eb6ebe562d6ec4263e7cc9f8d6d0312ee6da /editor
parent5f77c5f905d2a3063230bde1176372ebd074bc99 (diff)
pke: more mtsdf work, refactor code for debugging
Diffstat (limited to 'editor')
-rw-r--r--editor/editor.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp
index d246c66..27d993e 100644
--- a/editor/editor.cpp
+++ b/editor/editor.cpp
@@ -795,16 +795,18 @@ void GenerateMTSDF(FontTypeMSDFSettings *msdf_settings, const Asset *a) {
arr_glyphs.stride = sizeof(FontGlyphChar);
pk_arr_resize(&arr_glyphs, glyphs.size());
FontGlyphChar *arr = reinterpret_cast<FontGlyphChar *>(arr_glyphs.data);
+ uint32_t u;
for (uint64_t i = 0; i < glyphs.size(); ++i) {
arr[i].advance = glyphs[i].getAdvance();
arr[i].unicode = glyphs[i].getCodepoint();
arr[i].is_whitespace = glyphs[i].isWhitespace();
- glyphs[i].getBoxRect(ibounds.x, ibounds.y, ibounds.z, ibounds.a);
+ u = arr[i].unicode;
+ (void)u;
// TODO double-check this math
- glyphs[i].getQuadAtlasBounds(dbounds.x, dbounds.y, dbounds.z, dbounds.a);
- arr[i].baseline_bounding_box = dbounds - glm::dvec4(ibounds);
+ glyphs[i].getQuadPlaneBounds(dbounds.x, dbounds.y, dbounds.z, dbounds.a);
+ arr[i].baseline_bounding_box = dbounds;
// library counts up from the bottom of the image to the bottom of the glyph
ibounds.y = height - (ibounds.y + ibounds.a);
@@ -845,7 +847,7 @@ void RecordImGuiAssets() {
// User should input these values on a per-font basis.
struct FontTypeMSDFSettings msdf_settings{};
msdf_settings.minimum_scale = 7 * 2;
- msdf_settings.px_range = 1;
+ msdf_settings.px_range = 2;
static ImGuiTableFlags tableFlags{
ImGuiTableFlags_Borders |