fix fonts
This commit is contained in:
parent
4c84d0ca40
commit
70fd05f1e0
10
fonts.d
10
fonts.d
@ -12,6 +12,7 @@ struct FontAtlas
|
|||||||
f32 ascent;
|
f32 ascent;
|
||||||
f32 descent;
|
f32 descent;
|
||||||
f32 line_gap;
|
f32 line_gap;
|
||||||
|
f32 max_advance;
|
||||||
u32 width;
|
u32 width;
|
||||||
u32 height;
|
u32 height;
|
||||||
Glyph[128] glyphs;
|
Glyph[128] glyphs;
|
||||||
@ -105,8 +106,7 @@ CreateAtlas(Arena* arena, FontFace font, f32 size, u32 dimension)
|
|||||||
abuf.atlas.ascent = cast(f32)font.ascender;
|
abuf.atlas.ascent = cast(f32)font.ascender;
|
||||||
abuf.atlas.descent = cast(f32)font.descender;
|
abuf.atlas.descent = cast(f32)font.descender;
|
||||||
abuf.atlas.line_gap = cast(f32)(font.height - font.ascender + font.descender);
|
abuf.atlas.line_gap = cast(f32)(font.height - font.ascender + font.descender);
|
||||||
|
abuf.atlas.max_advance = cast(f32)(font.max_advance_width);
|
||||||
Logf("%f %f %f", font.height, font.ascender, font.descender);
|
|
||||||
|
|
||||||
u32 max_w, max_h, current_h, count;
|
u32 max_w, max_h, current_h, count;
|
||||||
|
|
||||||
@ -259,9 +259,3 @@ CreateAtlas(Arena* arena, FontFace font, f32 size, u32 dimension)
|
|||||||
|
|
||||||
return abuf;
|
return abuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
unittest
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
2
test.sh
2
test.sh
@ -4,7 +4,7 @@ name="Test_Runner"
|
|||||||
|
|
||||||
/bin/bash ./build.sh build
|
/bin/bash ./build.sh build
|
||||||
|
|
||||||
ldc2 platform.d aliases.d math.d util.d alloc.d assets.d external/xxhash/xxhash.d build/libcglm.a -d-version=DLIB_TEST -Xcc=-mno-sse -P-I/usr/include/freetype2 -L-lfreetype --main --unittest -g --of=$name -verrors=8
|
ldc2 platform.d fonts.d aliases.d math.d util.d alloc.d assets.d external/xxhash/xxhash.d build/libcglm.a -d-version=DLIB_TEST -Xcc=-mno-sse -P-I/usr/include/freetype2 -L-lfreetype --main --unittest -g --of=$name -verrors=8
|
||||||
|
|
||||||
rm $name.o
|
rm $name.o
|
||||||
./$name
|
./$name
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user