Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
8694e61316 font
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good
2026-03-28 15:04:07 -07:00
8 changed files with 63502 additions and 6046 deletions

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -53,7 +53,7 @@ static int ft2_MwDrawText(MwWidget handle, MwPoint* point, const char* text, int
}
}
x += ttf->face->glyph->metrics.horiAdvance / 64;
x += ttf->face->glyph->metrics.horiAdvance >> 6;
}
p = MwLoadRaw(handle, px, tw, th);
@ -92,7 +92,7 @@ static int ft2_MwTextWidth(MwWidget handle, const char* text) {
FT_Load_Char(ttf->face, c, FT_LOAD_RENDER);
tw += ttf->face->glyph->metrics.horiAdvance / 64;
tw += ttf->face->glyph->metrics.horiAdvance >> 6;
if(tw > mtw) mtw = tw;
}

View file

@ -51,7 +51,7 @@ static void draw(MwWidget handle) {
p.x = (r.width - (r.width / w * w)) / 2 + (MwGetInteger(handle, MwNisRounded) ? MwGetInteger(handle, MwNroundness) : 0);
p.y = r.height / 2;
len = (r.width - p.x * 2) / w;
len = (r.width - p.x * 2) / (w / 1.5);
if(len >= 0) {
show = malloc(len * 4 + 1);
@ -67,10 +67,6 @@ static void draw(MwWidget handle) {
MwDrawText(handle, &p, show, 0, MwALIGNMENT_BEGINNING, text);
textlen = (t->cursor - 1) % len + 1;
for(i = 0; i < textlen; i++) show[i] = 'M';
show[i] = 0;
currc.x = p.x + MwTextWidth(handle, show);
currc.y = (r.height - h) / 2;
currc.width = 1;

View file

@ -33,7 +33,6 @@ int main(int argc, char** argv) {
printf("\n");
printf("/**\n");
printf(" * Copyright notice:\n");
printf(" * \"%s\"\n", rec.u.atom);
printf(" */\n");
printf("MwFont MwFontData[] = {\n");
for(i = 0; i < 0x100; i++) {

View file

@ -1,11 +1,11 @@
#!/bin/sh
for out in src/font/ttf.c src/font/boldttf.c; do
for out in src/text/font/ttf.c src/text/font/boldttf.c; do
echo '#include <Mw/Milsko.h>' > $out
echo '' >> $out
echo '#if defined(USE_STB_TRUETYPE) || defined(USE_FREETYPE2)' >> $out
done
xxd -n MwTTFData -i resource/font/IBMPlexMono.ttf | sed s/_len/Size/ >> src/font/ttf.c
xxd -n MwBoldTTFData -i resource/font/IBMPlexMono-Bold.ttf | sed s/_len/Size/ >> src/font/boldttf.c
for out in src/font/ttf.c src/font/boldttf.c; do
xxd -n MwTTFData -i resource/font/SourceSans3-Regular.ttf | sed s/_len/Size/ >> src/text/font/ttf.c
xxd -n MwBoldTTFData -i resource/font/SourceSans3-Bold.ttf | sed s/_len/Size/ >> src/text/font/boldttf.c
for out in src/text/font/ttf.c src/text/font/boldttf.c; do
echo '#endif' >> $out
done