UHO UHO UHO TUHWFONT COMPONENT SET v0.2 (c) 1996,1998 UHO UHO FOR DELPHI 1&2 (3 - not tested but should!) UHO UHO PART OF UHO FREEWARE PROGRAM UHO * you've got full source UHO * you've got no limits for using and changing this incl. commercial apps UHO * you've got no feedback from me UHO UHO Łukasz Knasiecki uhouho@geocities.com UHO http://www.geocities.com/TimesSquare/Stadium/5611/ UHO ------------------------------------------------------------------------------------------ 1. What is this and how to install 2. UHW Fonts 3. UHW Palette 4. TUHWFONT : Methods and properties 5. TUHWPAL : Methods and properties 6. History 1. What is this and how to install. ----------------------------------- This component lets you to use bitmap fonts with 256 colours. Now You can use in Windows Smooth, Coloured etc. Fonts. It seems to look quite great. Code is quite dirty but it's no time to clean. And it's not fast enough for big texts. DEMO: You can watch demo without installing. Just compile project QUICK! INSTALL: Just register UhwReg file 2. UHW Fonts. ----------------------------------------------------------------------------------------- These are the fonts I used to add to my Dos-programs. The UHW is quite a strange format but well... There is no editor for these fonts, I used my primitive DOS-Program which converts GIF to UHW files. Look at the file UHWEDIT.ZIP and try make your own fonts. 3. UHO Palette ----------------------------------------------------------------------------------------- Another component is TUhwPal. It's a small palette component. You can use many different palettes to one font, so you will be able to change font colors or shadows. 4. Methods and properties for TUHWFONT: ----------------------------------------------------------------------------------------- PROPERTIES ---------- property CharSpace :shortint *** space between each char in pixels property PaletteName :string *** filename of palette for use with font (optional) property UhwStrukt:TUhwStrukt *** font data property Palette : TPal768 You can use different Palettes for any font. So when you need to use the font on different backgrounds just change the palette when you need. You have some examples in COL directory for use with Arial fonts. Palette format is easy 256*3 bytes (RGB values 0-63). It's old Autodesk Animator standard. METHODS ------- procedure LoadFromFile(const Text: string); > loads *.uhw font from a file function TextWidth(const Text: string): Integer; > width of specified text function FontHeight : Integer; > height of current font function CharOut (canvas:TCanvas;X,Y:integer; const Znak: char; ramka:boolean):integer; > writes char on canvas at x,y as result gives width of a char > see what happens when ramka is true procedure TextOut1 (canvas0:TCanvas;X,Y:integer; const Text: string); procedure TextOut2 (canvas0:TCanvas;X,Y:integer; const Text: string); > writes text on canvas, at x,y coords > both procs do the same, they just have different algortyhms. procedure TextOutBox(canvas0:TCanvas;X,Y,XX,YY:integer;Text:string; falignx:Talignment;faligny:TalignmentY); > writes text in a box (x,y:left-top) (xx,yy-width/height) falignx (horizontal allign.) faligny (vertical allign.) procedure TextOutBoxSolid(canvas0:TCanvas;X,Y,XX,YY:integer;Text:string; falignx:Talignment;faligny:TalignmentY;backcolor:TColor); > the same but fills the box before with backcolor procedure TextOutBoxD(canvas0:TCanvas;X,Y,XX,YY:integer;text:obrwsk; falignx:Talignment;faligny:TalignmentY); > same as TextOutBox takes text from obrwsk (like-pointer) variable function TextBoxHeight(canvas0:TCanvas;XX:integer;const Text:string):integer; > height of box with specified width and text function isCharInSet(ch:char):boolean; > is that char definied in the current font? 5. Methods and properties for TUHWPal ----------------------------------------------------------------------------------------- PROPERTIES ---------- FileName :string This only property sets filename of a palette file. I did not made any editor for palettes so it's only way to load it. METHODS ------- procedure LoadFromFile(const Text: string); *** loads palette from file property Palette *** out palette array 6. History ----------------------------------------------------------------------------------------- 0.1 First version 10.03.98 0.2 Fixed error in property editor (using Clear button) Fixed to work with Delphi 2