Hehe, very true. Havn't really started on thoose functions soOriginally Posted by cairnswm
Haha, hopefully you understand how to use it atleast, I will write a small demo showing off how to write a custom texture loader when I got the time, could be used for loading fractals for example.Originally Posted by cairnswm
Hehe, stealing is goodOriginally Posted by cairnswm
Well, the next project, after the imageList class with all the simple Draw functions in place (Draw, StrechDraw, TileDraw, DrawRotate, DrawAlpha etc) is done is the font renderer.
What i have in mind is creating an abstractation between a font and a text renderer, ie the THPXFont class only contains the bitmap texture as well as glyph information (width, heigt, offset etc) and the loading functions and display lists.
Then the text renderer(s ?) handles all the rendering routines, could be TPHXTextRendererPlain, TPGXTextRendererHtml and whatever you want. Ie something like this:
[pascal]
Font = FontList.LoadFont('Arial.png');
TextRenderer = TPHXTextRendererPlain.Create();
TextRenderer.TextOut(Font, 10, 10, 'My little text');
TextRenderer.WrapText(Font, 10, 10, 200, 200, 'My very very very long text, it will not fit in one row ';
TextRenderer2 := TPHXTextRendererHtml.Create();
TextRenderer2.addFont(fsItalic, Font);
TextRenderer2.addFont(fsBold, Font2);
TextRenderer2.addFont('p', ParagraphFont);
TextRenderer2.TextOut(Font, 10, 10, 'SomeHtml text<br>with <p>Styles</p>)';
[/pascal]
Something like that, ofc it wont be a full html renderer, but could still be usefull
Edit:
Or rather the creation of a font renderer would be more like this:
[pascal]
Renderer := TPHXTextRenderer.getRenderer("html");
[/pascal]
This way you could register your own renderers quite easy:
[pascal]
TPHXTextRenderer.registerRenderer('rtf', TMyRTFRenderer);
[/pascal]
Any ideas or suggestions ?
Bookmarks