Advertisement

Fonts and procedure... Please help me... Newbie Inside :)

Started by October 18, 2000 07:06 AM
1 comment, last by KappaMic 24 years, 4 months ago
(Sorry for my English... I''m Italian... The problem is that i want to create a standard proc to build fonts. I''ve got that function from a tut (don''t remember which one). It was BuildFont(); That function was declared in the pgm, and i''m porting it to a standard unit (so i can use it with different fonts in my programs at the same time). I know that i''ve to pass some values to the proc like HFont, and the famous "array". Can someone convert it to a standard procedure? (passing it the correct parameters?) I''ve got many problems while passing the array. Sorry, i''m a newbie... (i know that the array must return modified. I need a proc and a simple example of how to call that proc. Can someone help me? An help would be great... Many thank to all who will help me in this very big problem. Does this code modify the array? Why doesn''t this code work??? grrrrrrrr!!!!!!! I got an error (compiler error): Delphi error: "Incompatible types" Here''s how I''ve declared my procedure: -------------------------------------- procedure BuildFont(Text_Font : string; font : HFONT; gmf : array of GLYPHMETRICSFLOAT); begin Base_Font := glGenLists(256); // Storage For 96 Characters font := CreateFont(-12, // Height Of Font 0, // Width Of Font 0, // Angle Of Escapement 0, // Orientation Angle FW_BOLD, // Font Weight 0, // Italic 0, // Underline 0, // Strikeout ANSI_CHARSET, // Character Set Identifier OUT_TT_PRECIS, // Output Precision CLIP_DEFAULT_PRECIS, // Clipping Precision ANTIALIASED_QUALITY, // Output Quality FF_DONTCARE or DEFAULT_PITCH, // Family And Pitch PChar(Text_Font)); // Font Name ''Comic Sans MS'' SelectObject(h_DC, font); // Selects The Font We Want wglUseFontOutlines( h_DC, // Select The Current DC 0, // Starting Character 255, // Number Of Display Lists To Build Base_Font, // Starting Display Lists 0.0, // Deviation From The True Outlines 0.2, // Font Thickness In The Z Direction WGL_FONT_POLYGONS, // Use Polygons, Not Lines @gmf); // Address Of Buffer To Recieve Data end; Here''s how I''ve defined my vars ------------------------------- Text_Font: HFONT; Text_gmf : array [0..255] of GLYPHMETRICSFLOAT; Here''s how I call the procedure: -------------------------------- BuildFont(''Comic Sans MS'', Text_Font, Text_gmf);
Someone can help me????


Advertisement
http://www.frii.com/~martz/oglfaq/

http://members.xoom.com/myBollux

This topic is closed to new replies.

Advertisement