On 7 June 2012 14:41, Tudor Girba <[email protected]> wrote:
> Hi,
>
> On Thu, Jun 7, 2012 at 2:06 PM, Igor Stasenko <[email protected]> wrote:
>> Hi, Tudor.
>>
>> Yes, i did not implemented support for Strike fonts.
>> Because strike fonts are not scalable, and because no way they can be
>> correctly rendered by Athens:
>> fonts holding a pre-rendered glyph with subpixel accuracy... which
>> working well as long
>> as you don't rotate/scale the bitmap.. and if you do, then output is
>> even worse than gray-scale)
>> So it is useless, and that's why i didn't added support for them in a
>> first place.
>> But if you need it, i can add it. It should be easy to do. Tell me if
>> you need it.
>
> I see. If it is not expensive, I think the support for StrikeFonts
> would still make sense for helping us transition the application from
> the old canvas to the Athens one without requiring a Cairo-enabled VM.
> Like that, once we have migrated the code to the new API, we can
> simply switch to the Cairo/Pango backend. Or do you have another
> proposal?
>
> On another note, how do I make "AthensTextRenderTest test1." work? I
> mean how should I initialize the default font (or how do I pass it to
> the AthensTextScanner)?
>

ouch.. looks like extension methods is wiped from LogicalFont..
i will add them back..

But in overall , i want to tell you the situation:
 as you may see, there is no high-level API defined yet in
Canvas/Surface for text rendering.
And i am going to introduce it , once i'll deal with VM bundling..
because telling people to install cairo and do jumps and hops just to
see it works is
wasting a time.


Now the idea how i want to introduce it is simple.
You can use any object as font (as long at it should conform to some
minimal font protocol,
which has to be defined). I don't like to inherit AbstractFont
protocol, because it is too
pixel-wise centric.
Now, to start using that font on a surface, once should tell font:

renderer := font getRendererOn: surface.

this should answer a subclass of GlyphRenderer, which then can be used later
to render the text on given surface using given font.

renderer setPosition: ..
renderer renderGlyphsIn: 'abcde'  from: 1  to: ('abcde' size)
etc.

of course there is missing some convenience protocol(s), but just to
give you an idea.

About pango:
pango is framework for text layout, not rendering. So, it can be used
along with Athens,
but it will be never an integral part of Athens.

In Athens, i don't want to provide a high-level and highly complex
semantics for text layout,
because it is a separate domain and you can spend whole life there.
Athens should support only basic drawing operations, like draw
character span at certain position.
The rest (layout) should be handled externally.


-- 
Best regards,
Igor Stasenko.

Reply via email to