[futurebasic] CGContext & CGFonts

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2011 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Wed, 20 Jul 2011 22:44:40 -0400
In passing, Sofia lamented:

>Missing Windows LOGFONT desperately...

then mentioned:

>I am not inclined to make use of QuickDraw unless there's no other choice.

There is one other choice for drawiing fonts in FB that has escaped 
notice here: OpenGL. OpenGL has the advantage of being available in 
legacy versions of OS X all the way to the newest.

And does this look familiar!?!?

Windows LOGFONT structure:

typedef struct tagLOGFONT {
   LONG  lfHeight;
   LONG  lfWidth;
   LONG  lfEscapement;
   LONG  lfOrientation;
   LONG  lfWeight;
   BYTE  lfItalic;
   BYTE  lfUnderline;
   BYTE  lfStrikeOut;
   BYTE  lfCharSet;
   BYTE  lfOutPrecision;
   BYTE  lfClipPrecision;
   BYTE  lfQuality;
   BYTE  lfPitchAndFamily;

How about this:

OpenGL LOGFONT Structure:

LOGFONT logfont;

logfont.lfHeight = -12;
logfont.lfWidth = 0;
logfont.lfEscapement = 0;
logfont.lfOrientation = 0;
logfont.lfWeight = FW_NORMAL;
logfont.lfItalic = FALSE;
logfont.lfUnderline = TRUE;
logfont.lfStrikeOut = FALSE;
logfont.lfCharSet = ANSI_CHARSET;
logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logfont.lfQuality = PROOF_QUALITY;
logfont.lfPitchAndFamily = DEFAULT_PITCH || FF_ROMAN;

For a starter, take a look at Examples -> Graphics -> OpenGL. These 
demos will show you how to get an OpenGL app up and running in FB.