forked from hkc/cc-stuff
They use 6x9 font, not 8x11...
- https://github.com/cc-tweaked/CC-Tweaked/issues/1987 - https://github.com/cc-tweaked/CC-Tweaked/blob/mc-1.20.x/projects/common/src/client/java/dan200/computercraft/client/render/text/FixedWidthFontRenderer.java#L38-L39
This commit is contained in:
parent
36c19b23dc
commit
d0cf362c1b
12
cpi2png.c
12
cpi2png.c
|
@ -49,7 +49,7 @@ int main(int argc, char **argv) {
|
|||
assert(false && "Failed to read size: unsupported version");
|
||||
}
|
||||
|
||||
union color *canvas = malloc(width * height * 8 * 11 * sizeof(union color));
|
||||
union color *canvas = malloc(width * height * 6 * 9 * sizeof(union color));
|
||||
|
||||
|
||||
// XXX: may change in future when we introduce variable-size palettes
|
||||
|
@ -73,16 +73,16 @@ int main(int argc, char **argv) {
|
|||
unsigned char color = fgetc(fp_in);
|
||||
union color background = colors[color & 0xF];
|
||||
union color foreground = colors[color >> 4];
|
||||
for (int oy = 0; oy < 11; oy++) {
|
||||
for (int ox = 0; ox < 8; ox++) {
|
||||
union color pix = ((0x80 >> ox) & cc_font_atlas[sym][oy]) ? foreground : background;
|
||||
canvas[ox + (x + (y * 11 + oy) * width) * 8] = pix;
|
||||
for (int oy = 0; oy < 9; oy++) {
|
||||
for (int ox = 0; ox < 6; ox++) {
|
||||
union color pix = ((0x80 >> (ox + 1)) & cc_font_atlas[sym][oy + 1]) ? foreground : background;
|
||||
canvas[ox + (x + (y * 9 + oy) * width) * 6] = pix;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stbi_write_png(argv[2], width * 8, height * 11, 4, canvas, 0);
|
||||
stbi_write_png(argv[2], width * 6, height * 9, 4, canvas, 0);
|
||||
|
||||
free(colors);
|
||||
free(canvas);
|
||||
|
|
Loading…
Reference in New Issue