Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Di Mai 14, 2024 18:55

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Autor Nachricht
BeitragVerfasst: Di Apr 19, 2005 10:42 
Offline
DGL Member

Registriert: Mi Mai 12, 2004 08:40
Beiträge: 4
hi,
i have problem with fonts !
How to rotate font with wglUseFontBitmaps ?

Code:
  1. font := CreateFont(-24,                        
  2.                       0,                                  
  3.                       0,                                  // < ------ escapement no work !!!!!
  4.                       0,                                  // <--------orientation no work !!!!!
  5.                       FW_BOLD,                  
  6.                       0,                                  
  7.                       0,                                  
  8.                       0,                                
  9.                       ANSI_CHARSET,                      
  10.                       OUT_TT_PRECIS,                      
  11.                       CLIP_DEFAULT_PRECIS,                
  12.                       ANTIALIASED_QUALITY,                
  13.                       FF_DONTCARE or DEFAULT_PITCH,      
  14.                       'Courier New');              
  15.   SelectObject(h_dc,font);                              
  16.   wglUseFontBitmaps(h_dc,32,96,base);                    
  17.  

help me !!!!!

thanks

Moderiert von Lossy eX: Pascal Tags added


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Apr 19, 2005 11:27 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 05, 2002 10:35
Beiträge: 4234
Wohnort: Dortmund
I don't know if it possible. I've never tryed out. But BitmapFonts are not very flexible. It's better you use Texturefonts. There where normally polygons with some parts of an textur they contained a complete list of chars. Then it's possible to rotate the text dynamically.

I've made an class that contains this functionality. But at this moment i dosn't uploaded the generation tool. But i can do it.

glText.pas with Font classes (TglTextureText is intresting for you)
glBitmap.pas where needed.

You also need our OpenGL Header.


Dateianhänge:
Dateikommentar: Tahoma sample font until i uploaded the generator.
tahoma.zip [4.6 KiB]
287-mal heruntergeladen
Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Apr 20, 2005 09:31 
Offline
DGL Member

Registriert: Mi Mai 12, 2004 08:40
Beiträge: 4
thanks for your answer !
i am beginer.
I can find some example?

thanks.


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Apr 20, 2005 11:12 
Offline
DGL Member
Benutzeravatar

Registriert: Do Dez 05, 2002 10:35
Beiträge: 4234
Wohnort: Dortmund
Creating Font
Code:
  1.   Font := TglTextureText.Create(); // Create Fontclass
  2.   Font.Texture := TglBitmap2D.Create();  // Create and Assign Fonttexture
  3.   Font.Texture.LoadFromFile('Tahoma.bmp');  // Load Fonttexture
  4.   Font.Texture.SetFilter(GL_NEAREST, GL_NEAREST);  // No Texturefiltering
  5.   Font.Texture.BuildMipMaps := False; // No MipMaps
  6.   Font.Texture.TextureFormat := tf32Bit; // 32 Bits color Delpth. Also could be tf16. But tfCompressed could have bad quality with some fonts
  7.   Font.Texture.GenTexture;  // Create OpenGL Texture
  8.   Font.UseAlphaFunc := True;  // using Alphafunc when drawing Font
  9.   Font.UseBlendFunc := True;  // using Blendfunc when drawing Font
  10.   Font.ReadCharWidthsFromIni('Tahoma.ini', 'Char Widths');  // Read char widths from ini
  11.   Font.BuildFont;  // Generate Displaylists with chars


Destroying Font
Code:
  1.   Font.Texture.Free;
  2. Font.Free;


Texture can be shared so you must create and free it separately.

Drawing with Font
Code:
  1.  
  2.   glColor;
  3.   glPushMatrix;
  4.     glTranslate;
  5.     Font.PrintText('Text');
  6.   glPopMatrix;
  7.  


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Apr 26, 2005 08:35 
Offline
DGL Member

Registriert: Mi Mai 12, 2004 08:40
Beiträge: 4
Thank !!


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 5 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 4 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.021s | 18 Queries | GZIP : On ]