kernel/source/console/console.cpp
// since we are working with fonts, (x, y) is the origin point of the glyph!
// it is *not* the top-left corner of the character.
since we are working with fonts, (x, y) is the origin point of the glyph.
it is *not* the top-left corner of the character.
since we are working with fonts ( x y ) is the origin point of the glyph . it is * not * the top - left corner of the character .
static void draw(Glpyh* c, int x, int y, uint32_t fg, uint32_t bg)
	{
		uint32_t* ptr = (uint32_t*) (Framebuffer + (y * FramebufferScanWidth + x) * 4);
		ptr += ((MainFont.baseline + c->topOffset) * FramebufferScanWidth);
		ptr += c->lsb;
		if(c->codepoint == ' ' || c->codepoint > 126)
		{
			for(int i = y; i < (y + MainFont.vertAdv); i++)
				krt::util::memfill4b((uint32_t*) (Framebuffer + (i * FramebufferScanWidth + x) * 4), bg, c->horzAdv);
		}
		else
		{
			for(int row = 0; row < c->height; row++)
			{
				auto xptr = ptr;
				for(int col = 0; col < c->width; col++)
				{
					*xptr = c->bitmap[row * c->width + col] | bg;
					xptr++;
				}
				ptr += FramebufferScanWidth;
			}
		}
	}
static void draw ( Glpyh * c , int x , int y , uint32_t fg , uint32_t bg ) { uint32_t * ptr = ( uint32_t * ) ( Framebuffer + ( y * FramebufferScanWidth + x ) * 4 ) ; ptr += ( ( MainFont . baseline + c -> topOffset ) * FramebufferScanWidth ) ; ptr += c -> lsb ; if ( c -> codepoint == ' ' || c -> codepoint > 126 ) { for ( int i = y ; i < ( y + MainFont . vertAdv ) ; i ++ ) krt :: util :: memfill4b ( ( uint32_t * ) ( Framebuffer + ( i * FramebufferScanWidth + x ) * 4 ) , bg , c -> horzAdv ) ; } else { for ( int row = 0 ; row < c -> height ; row ++ ) { auto xptr = ptr ; for ( int col = 0 ; col < c -> width ; col ++ ) { * xptr = c -> bitmap [ row * c -> width + col ] | bg ; xptr ++ ; } ptr += FramebufferScanWidth ; } } }
since we are working with fonts, (x, y) is the origin point of the glyph!
since we are working with fonts ( x y ) is the origin point of the glyph!
// start at the origin // ptr -= (c->ascent * FramebufferScanWidth); // move right by the left-side bearing // now we are at the top-left of the glyph & we can start drawing.