[TYPO3-dev] pngBuilder Support for enhanced text-rendering

Christopher Torgalson bedlamhotel at gmail.com
Wed Feb 24 16:29:57 CET 2010


Hi,

On Wed, Feb 24, 2010 at 2:32 AM, JoH asenau <info at cybercraft.de> wrote:
>> So shouldn't we think about an enhanced PNG Creation
>> with gifBuilder or - maybe better - an new *pngBuilder* ?
>>
>> I think, Typo3 should have an up-to-date image renderer,
>> that has 32bit PNG-Support and renders Text _really_ nice...
>>
>> So what do you Devs think about that ?
>
>  Although we could still think about a better naming I don't think we have
> to build a new pngbuilder from scratch. Enhanced GIFBUILDER should be
> enough, since it already does almost everything that's necessary except
> handling alpha channels.
>
> Another thing that could be improved is the calculation of height and
> lineheight to get a correct positioning of Text with characters like Ä or g.
> Lineheight calculation as such currently works with automatic line breaks
> only - should be enabled for manual linebreaks as well.
>
> Maybe we should set up a project on forge and start brainmstorming there?


Height and line-height have been my biggest complaints with GIFBUILDER
for years; it'd be wonderful to have improvements there: +1.

In favour of a larger rewrite though are two things:

1. It'd be nice for GIFBUILDER / its replacement to be able to use
either of GDlib / ImageMagick if necessary
2. I'd like it to be possible to be able to specify the construction
of text-based images in TYPO3 with a CSS-like syntax (i.e. use the
model already familiar to every web developer)

In case it's not clear what I mean by point 2, I think it'd be great
to specify a text based image's properties like this;

background-color:#ff9900;
background-image:url(path/to/image.jpg);
background-repeat:repeat-x;
border-color:#000;
border-style:dotted;
border-width:2px;
color:#000033;
font-size:24px;
font-weight:bold;
line-height:36px;
opacity:.5;
padding:12px;
text-transform:uppercase;

Excepting 'opacity' and the dotted border, it's possible to build the
image above in GIFBUILDER now, so this might be mostly a matter of
mapping CSS or SVG style declarations onto the existing properties.

I've actually built such a (standalone, GD lib only) tool in the past.
Parsing the CSS was a minor pain, but when I'd finished it, I was
surprised how much easier it was to use than GIFBUILDER.

-- 
Christopher Torgalson
http://www.typo3apprentice.com/




More information about the TYPO3-dev mailing list