Skip to content

Commit

Permalink
Fix RGBA fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
tcdude committed Jul 22, 2024
1 parent 0b2aa39 commit 7f2bbe4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Kinc
Submodule Kinc updated 34 files
+4 −0 Backends/Graphics4/Direct3D9/Sources/kinc/backend/graphics4/Direct3D9.cpp
+30 −1 Backends/Graphics4/G4onG5/Sources/kinc/backend/graphics4/G4.c.h
+14 −13 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/Direct3D12.c.h
+12 −0 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/commandlist.c.h
+6 −4 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/d3d12mini.h
+1 −1 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/d3d12unit.cpp
+12 −0 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/pipeline.c.h
+2 −0 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/pipeline.h
+1 −1 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/rendertarget.c.h
+2 −0 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/shader.c.h
+4 −0 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/shader.h
+39 −7 Backends/Graphics5/Direct3D12/Sources/kinc/backend/graphics5/texture.c.h
+6 −2 Backends/System/Linux/Sources/kinc/backend/wayland/system.c.h
+19 −9 Backends/System/Linux/Sources/kinc/backend/wayland/wayland.h
+106 −45 Backends/System/Linux/Sources/kinc/backend/wayland/window.c.h
+109 −0 KongShaders/g2.kong
+270 −0 Sources/kinc/graphics2/colored_painter.c.h
+7 −0 Sources/kinc/graphics2/g2unit.c
+665 −0 Sources/kinc/graphics2/graphics.c.h
+52 −0 Sources/kinc/graphics2/graphics.h
+4 −0 Sources/kinc/graphics2/graphics_soft.c
+253 −0 Sources/kinc/graphics2/image_painter.c.h
+269 −0 Sources/kinc/graphics2/text_painter.c.h
+2 −0 Sources/kinc/graphics4/constantbuffer.h
+4 −0 Sources/kinc/graphics4/graphics.h
+3 −1 Sources/kinc/image.h
+8 −8 Sources/kinc/io/filereader.h
+10 −0 Sources/kinc/math/matrix.h
+1 −1 Tools/linux_arm
+1 −1 Tools/linux_arm64
+1 −1 Tools/linux_x64
+1 −1 Tools/macos
+1 −1 Tools/windows_x64
+1 −0 kfile.js
5 changes: 3 additions & 2 deletions Sources/krink/graphics2/ttf.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ static inline float myround(float v) {
return (float)((int)(v + 0.5f));
}

typedef struct kr_ttf_image {
struct kr_ttf_image {
float m_size;
stbtt_bakedchar *chars;
kinc_g4_texture_t *tex;
int width, height, first_unused_y;
float baseline, descent, line_gap;
bool owns_tex;
} kr_ttf_image_t;
};

void kr_ttf_load_font_blob_internal(kr_ttf_font_t *font, const char *fontpath) {
kinc_file_reader_t fh;
Expand Down Expand Up @@ -238,6 +238,7 @@ void kr_ttf_load(kr_ttf_font_t *font, int size) {
kinc_image_init_from_bytes(&fontimg, pixels, width, height, KR_FONT_IMAGE_FORMAT);
img->tex = (kinc_g4_texture_t *)kr_malloc(sizeof(kinc_g4_texture_t));
kinc_g4_texture_init_from_image(img->tex, &fontimg);
kinc_g4_texture_generate_mipmaps(img->tex, 1);
kinc_image_destroy(&fontimg);
kr_free(pixels);
}
Expand Down

0 comments on commit 7f2bbe4

Please sign in to comment.