Scalable Screen Font: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
[unchecked revision][unchecked revision]
mNo edit summary
Line 30:
ssfn_dst.y = 200;
 
/* render one glyphtext directly to the screen and then adjust ssfn_dst.x and ssfn_dst.y */
ssfn_putc(0x41'H');
ssfn_putc('e');
ssfn_putc('l');
ssfn_putc('l');
ssfn_putc('o');
</source>
 
Line 70 ⟶ 74:
buf.fg = 0xFF808080; /* foreground color */
 
/* rasterize the first glyph in an UTF-8 string into a 32 bit packed pixel buffer. Returns how many bytes were consumed from the string */
ssfn_render(&ctx, &buf, "AHello");
ssfn_render(&ctx, &buf, "ello");
ssfn_render(&ctx, &buf, "llo"); /* assuming there's a ligature for "ll" in the font */
ssfn_render(&ctx, &buf, "o");
 
/* free resources */
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu