Re: [Pharo-project] native boost is the best thing since COGVM
A taste of what will be available: rendering the same GLabel (the gaucho equivalent to StringMorph), scaling the CairoCanvas. Pesudo Code: "create a label" label := GLabel on : 'hello Pango-Cairo'. "draw it on the canvas" label drawOn: canvas. "scale the canvas" canvas translateBy: aDelta ; scaleBy: aScale. "draw it on the canvas" label drawOn: canvas. "repeat" On Sun, Dec 11, 2011 at 7:43 PM, Javier Pimás <elpochodelagente@gmail.com> wrote:
Cooool!!!
On 12/11/11, Fernando Olivero <fernando.olivero@usi.ch> wrote:
I was able to create the binding to Pango using NB.
The ultimate goal is to provide a cleaner implementation of "text" widgets.
Thanks Igor !
Fernando
-- Lic. Javier Pimás Ciudad de Buenos Aires
I am almost drooling :) Doru On Mon, Dec 12, 2011 at 4:02 PM, Fernando Olivero <fernando.olivero@usi.ch> wrote:
A taste of what will be available: rendering the same GLabel (the gaucho equivalent to StringMorph), scaling the CairoCanvas.
Pesudo Code:
"create a label" label := GLabel on : 'hello Pango-Cairo'.
"draw it on the canvas" label drawOn: canvas.
"scale the canvas" canvas translateBy: aDelta ; scaleBy: aScale.
"draw it on the canvas" label drawOn: canvas.
"repeat"
On Sun, Dec 11, 2011 at 7:43 PM, Javier Pimás <elpochodelagente@gmail.com> wrote:
Cooool!!!
On 12/11/11, Fernando Olivero <fernando.olivero@usi.ch> wrote:
I was able to create the binding to Pango using NB.
The ultimate goal is to provide a cleaner implementation of "text" widgets.
Thanks Igor !
Fernando
-- Lic. Javier Pimás Ciudad de Buenos Aires
-- www.tudorgirba.com "Every thing has its own flow"
CairoSamplePrograms>>rectangleAndText does not works, because it uses a following method: NBCairo>>selectFont: aFamily slant: slant weight: aWeight on: aNBCairoContext <primitive: #primitiveNativeCall module: #NativeBoostPlugin> ^self call: #(void cairo_select_font_face (NBCairoContext aNBCairoContext, String aFamily, cairo_font_slant_t slant, cairo_font_weight_t aWeight) ) and during code generation it barks that it unable to resolve 'cairo_font_slant_t' type. Because NBCairo class does not includes a corresponding shared pool (NBCairoTypes). Also, Fernando, i don't like that you put everything into a single class (NBCairo). This is wrong, not object-oriented. The original organization made by Javier was much more closer to my tastes. This approach to wrapping a library is too mechanical. It is much better to place calls at proper place(s) in proper classes, rather than putting everything into a single one. Which means that in this way you are at least 1 message send farther from real function call. But in your case its not even that.. NBCairoPattern>>status ^ self cairo patternStatusOf: self cairo ^ NBCairo default so , it is 2 extra message sends, instead of direct call to foreign function! -- Best regards, Igor Stasenko.
Igor what is the link between pango cairo and the work you did on the text model in athens? Because I have the impression that you work on text modeling is important. Stef
A taste of what will be available: rendering the same GLabel (the gaucho equivalent to StringMorph), scaling the CairoCanvas.
Pesudo Code:
"create a label" label := GLabel on : 'hello Pango-Cairo'.
"draw it on the canvas" label drawOn: canvas.
"scale the canvas" canvas translateBy: aDelta ; scaleBy: aScale.
"draw it on the canvas" label drawOn: canvas.
"repeat"
On 12 December 2011 18:42, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Igor
what is the link between pango cairo and the work you did on the text model in athens? Because I have the impression that you work on text modeling is important.
i dont know much about pango to say anything, except that it is library for text layout. my impression, that if we will want to use pango for text layout, then we need to use different model for text. Or maybe Text could stay, but morphic related stuff will require serious changes. This is because when i did text layout for Athens, i had to make own paragraph/morph pair, because of hardcoded stuff in existing classes.
Stef
A taste of what will be available: rendering the same GLabel (the gaucho equivalent to StringMorph), scaling the CairoCanvas.
Pesudo Code:
"create a label" label := GLabel on : 'hello Pango-Cairo'.
"draw it on the canvas" label drawOn: canvas.
"scale the canvas" canvas translateBy: aDelta ; scaleBy: aScale.
"draw it on the canvas" label drawOn: canvas.
"repeat"
-- Best regards, Igor Stasenko.
participants (4)
-
Fernando Olivero -
Igor Stasenko -
Stéphane Ducasse -
Tudor Girba