.comment-link {margin-left:.6em;}

Tuesday, October 23, 2007

 

nonjustified text library for phoenix ( pascal delphi )

unit phoenix_extended;

interface
uses phxFonts;
type twh = record
heigth : integer;
width : integer;
end;
var
Fonts : TPHXFontList;

procedure init;
function CenterTextOffset(pchar,cchar : char; fontnumber : integer): integer;
procedure outletter(x,y,fontnumber : integer; c: char);
procedure outline(x,y,fontnumber : integer; outchar: string);

implementation

procedure init;
begin;

end;
function CenterTextOffset(pchar,cchar : char; fontnumber : integer): integer;
var
pcharwidth,ccharwidth : integer;
begin;
pcharwidth := Fonts[fontnumber].TextWidth(pchar);
ccharwidth := Fonts[fontnumber].TextWidth(cchar);
CenterTextOffset := (ccharwidth - pcharwidth) div 2;
end;

procedure outletter(x,y,fontnumber : integer; c: char);
var
OFFSET,posw : integer;
begin;
OFFSET := CenterTextOffset(c,'W',fontnumber);
posw := (Fonts[fontnumber].TextWidth('W') * x) + OFFSET;
Fonts[fontnumber].TextOut(posw,y,c);
end;

procedure outline(x,y,fontnumber : integer; outchar : string);
var
loop : integer;
begin;
for loop := 0 to length(outchar) do begin;
outletter(x + loop, y, fontnumber, outchar[loop]);
end;
end;



initialization
Fonts := TPHXFontList.Create;
end.

Comments: Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?