added font sources to documentation

painter and fonts are now user creatable properties
added font option to fpmake
implemented font styles for gl freetype
started work on glut font class
clean-up of nvglutwidgets class


git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2243 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
blaszijk
2012-01-10 17:09:26 +00:00
parent 58a55210d5
commit 8e6492da6f
63 changed files with 1822 additions and 165 deletions

View File

@ -16,15 +16,19 @@ type
FAngle: double;
FFlags: word;
FName: string;
FSize: integer;
function GetFlags(AIndex: integer): boolean;
procedure SetFlags(AIndex: integer; AValue: boolean);
protected
FSize: integer;
procedure SetAngle(AValue: double); virtual;
procedure SetFlags(AIndex: integer; AValue: boolean); virtual;
public
constructor Create(AName: string; ASize: integer); virtual;
//add stylized fonts
procedure Add(AName: string; ABold, AItalic, AStrikeTrough, AUnderline: boolean); virtual; abstract;
//font characteristics
property Name: string read FName;
property Size: integer read FSize;
@ -32,7 +36,7 @@ type
//text metrics
function TextHeight(Text: string): integer; virtual; abstract;
function TextWidth(Text: string): integer; virtual; abstract;
procedure TextSize(Text: string; var w, h: integer); virtual; abstract;
procedure TextSize(Text: string; var w, h: integer); virtual;
//font flags <<possibly not implemented for all font classes>>
property Angle: double read FAngle write SetAngle;
@ -77,5 +81,11 @@ begin
FSize := ASize;
end;
procedure TNVBaseFont.TextSize(Text: string; var w, h: integer);
begin
w := TextWidth(Text);
h := TextHeight(Text);
end;
end.