Cairo

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Cairo

Moviga Technologies
Hi!

What source code would be the best to study in order to learn how to use
the cairo component properly? I am interested in learning more about the
function's that allow one to refresh certain areas of the surface (clip
and matrix?). My long term goals for learning it in the first place is
to be able to first create a simple (perhaps monospaced) text editor,
then a formatted text rendering surface (preferably with images) and
lastly a rich text editor.

Kind regards
Erik

 
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Cairo

Benoît Minisini
Le 10/03/2017 à 22:08, Moviga Technologies a écrit :

> Hi!
>
> What source code would be the best to study in order to learn how to use
> the cairo component properly? I am interested in learning more about the
> function's that allow one to refresh certain areas of the surface (clip
> and matrix?). My long term goals for learning it in the first place is
> to be able to first create a simple (perhaps monospaced) text editor,
> then a formatted text rendering surface (preferably with images) and
> lastly a rich text editor.
>
> Kind regards
> Erik
>

The gb.cairo component has almost the same API as cairo, so any cairo
source code example can be easily transposed to Gambas. Just ask
questions on a specific example if you encounter problems.

As for making a rich text editor, cairo is not enough, as it is
rudimentary when displaying text.

You have to rely on the Pango library, but there is no "gb.pango" component.

And how will you handle input?

For that, you will have to use the gb.gtk component, that uses
internally cairo and pango for the drawing, and handles the input method
stuff for entering non ascii characters with your keyboard.

It's just that the API is not the same, but simpler.

Regards,

--
Benoît Minisini

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Cairo

Fabien Bodard-4
Le 11 mars 2017 00:46, "Benoît Minisini" <[hidden email]> a
écrit :

Le 10/03/2017 à 22:08, Moviga Technologies a écrit :

> Hi!
>
> What source code would be the best to study in order to learn how to use
> the cairo component properly? I am interested in learning more about the
> function's that allow one to refresh certain areas of the surface (clip
> and matrix?). My long term goals for learning it in the first place is
> to be able to first create a simple (perhaps monospaced) text editor,
> then a formatted text rendering surface (preferably with images) and
> lastly a rich text editor.
>
> Kind regards
> Erik
>

The gb.cairo component has almost the same API as cairo, so any cairo
source code example can be easily transposed to Gambas. Just ask
questions on a specific example if you encounter problems.

As for making a rich text editor, cairo is not enough, as it is
rudimentary when displaying text.

You have to rely on the Pango library, but there is no "gb.pango" component.

And how will you handle input?

For that, you will have to use the gb.gtk component, that uses
internally cairo and pango for the drawing, and handles the input method
stuff for entering non ascii characters with your keyboard.

It's just that the API is not the same, but simpler.

Regards,

I think Erik want to replace the old TextEdit widget.  So yes you need to
use a toolkit component as basis.

You can learn a lot with the gb.form.editor widget and gb.form.terminal.

Drawing a text is long. So think about using cached images of letters or
lines for quick refreshing.

I wish you a lot of fun and I'm  waiting for your editor ( I need one too)



--
Benoît Minisini

------------------------------------------------------------
------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Cairo

Moviga Technologies
In reply to this post by Benoît Minisini
I see... Well, I wouldn't really need all the facy stuff. Latin letters
and numbers would go a long way for me.

But, I need to think a bit more about what to do then. Thanks!

Den 11.03.2017 00:44, skrev Benoît Minisini:

> Le 10/03/2017 à 22:08, Moviga Technologies a écrit :
>
>> Hi!
>>
>> What source code would be the best to study in order to learn how to use
>> the cairo component properly? I am interested in learning more about the
>> function's that allow one to refresh certain areas of the surface (clip
>> and matrix?). My long term goals for learning it in the first place is
>> to be able to first create a simple (perhaps monospaced) text editor,
>> then a formatted text rendering surface (preferably with images) and
>> lastly a rich text editor.
>>
>> Kind regards
>> Erik
>
> The gb.cairo component has almost the same API as cairo, so any cairo
> source code example can be easily transposed to Gambas. Just ask
> questions on a specific example if you encounter problems.
>
> As for making a rich text editor, cairo is not enough, as it is
> rudimentary when displaying text.
>
> You have to rely on the Pango library, but there is no "gb.pango" component.
>
> And how will you handle input?
>
> For that, you will have to use the gb.gtk component, that uses
> internally cairo and pango for the drawing, and handles the input method
> stuff for entering non ascii characters with your keyboard.
>
> It's just that the API is not the same, but simpler.
>
> Regards,
 
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user