diff --git a/api/windows_opengl.C b/api/windows_opengl.C index 360408420a..a27c12bdca 100755 --- a/api/windows_opengl.C +++ b/api/windows_opengl.C @@ -383,7 +383,7 @@ void SetupPixelFormat(HDC hDC) // good to go. } -GLYPHMETRICSFLOAT gmf[256]; +float txt_widths[256]; unsigned int MyCreateFont(char *fontName, int Size, int weight) { // windows font @@ -416,5 +416,15 @@ unsigned int MyCreateFont(char *fontName, int Size, int weight) { #if 0 wglUseFontOutlines(hDC,0,255,mylistbase,0.0f,0.2f,WGL_FONT_POLYGONS,gmf); #endif + + TEXTMETRIC met; + GetTextMetrics(myhDC,&met); + GetCharWidthFloat(myhDC,met.tmFirstChar,met.tmLastChar,txt_widths); + return mylistbase; } + +float get_char_width(unsigned char c) +{ + return txt_widths[c]; +} diff --git a/checkin_notes b/checkin_notes index c285cb7605..c52e94cd06 100755 --- a/checkin_notes +++ b/checkin_notes @@ -6763,8 +6763,10 @@ David Oct 14 2003 Oliver Oct 14 2003 - stars now draw in visible pyramid with original coordinate system - axis draws vertices in correct CCW order + - added font width function api/ gutil.C,h reduce.c + windows_opengl.C