Bitmap font help

Started by
9 comments, last by Splizxer 20 years ago
Here is my routine for creating a bitmap font. It uses the GetGlyphyOutline() function to get the GLYPHMETRICS info for each character. Maybe this will help:

void oglFontBitmapDisplayList::CreateInternal(HDC hDC, oglFontDescriptor &_fontDesc){		// Create spot for the font metrics to be placed	int count = lastChar - firstChar + 1;	fontMetrics = new GLYPHMETRICS[count];	memset(fontMetrics, 0, sizeof(GLYPHMETRICS) * count);		// Create identity matrix 	MAT2 mat;	memset(&mat, 0, sizeof(mat));	mat.eM11.value = 1;	mat.eM22.value = 1;		// Get font metrics for each font	for( int i = 0; i < count; i++ )		GetGlyphOutline( hDC, i + firstChar, GGO_METRICS, &fontMetrics[i], 0, NULL, &mat );	fontCreated = (wglUseFontBitmaps(hDC, firstChar, lastChar, listBase) == TRUE);	if (!fontCreated) {		std::string s = strFormat("oglFontDisplayListBase::Create error %ld\n", GetLastError());		OutputDebugStr(s.c_str());	}}



- onebeer
- onebeer

This topic is closed to new replies.

Advertisement