Change font HL_GTK_TEX_VIEW #276
Replies: 11 comments 2 replies
-
Welcome to gtk-fortran! I found no example of setting other fonts in our gtk-fortran examples. But this StackOverflow answer suggest that you could use Pango markups in your strings (Pango is the GTK library for managing fonts): The Gnome Discourse may also help you: https://discourse.gnome.org/c/platform/5 Please report here if you succeed. |
Beta Was this translation helpful? Give feedback.
-
Hi Vicent,
Thanks a lot for your anwer, great job yours.
I did something like the CSS in MENUBAR example and works fine.
Thanks a lot and have a nice day,
Ivo Wolff Gersberg
COPPE/Federal University of Rio de Janeiro
…On Tue, Aug 1, 2023 at 7:02 AM Vincent Magnin ***@***.***> wrote:
Welcome to gtk-fortran!
The HL library is easing coding but does not offer every possible options.
But you can without problem mix HL functions and GTK functions. In the
TextView widget offers only a function to set a monospace font:
https://docs.gtk.org/gtk4/property.TextView.monospace.html
I found no example of setting other fonts in our gtk-fortran examples. But
this StackOverflow <https://stackoverflow.com/a/76773652/13785587> answer
suggest that you could use Pango markups in your strings (Pango is the GTK
library for managing fonts):
https://docs.gtk.org/Pango/pango_markup.html
The Gnome Discourse may also help you:
https://discourse.gnome.org/c/platform/5
Please report here if you succeed.
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ7SHOSAOT242I46ER636LXTDH4TANCNFSM6AAAAAA26LI56I>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
*...*
*Ivo Wolff Gersberg*
|
Beta Was this translation helpful? Give feedback.
-
Dear Vincent,
I think the function "hl_gtk_file_chooser" has a print inside showing the
filename.
Always print the filename at the terminal.
Thanks and great job,
Ivo Wolff Gersberg
COPPE/Federal University of Rio de Janeiro
…On Tue, Aug 1, 2023 at 7:02 AM Vincent Magnin ***@***.***> wrote:
Welcome to gtk-fortran!
The HL library is easing coding but does not offer every possible options.
But you can without problem mix HL functions and GTK functions. In the
TextView widget offers only a function to set a monospace font:
https://docs.gtk.org/gtk4/property.TextView.monospace.html
I found no example of setting other fonts in our gtk-fortran examples. But
this StackOverflow <https://stackoverflow.com/a/76773652/13785587> answer
suggest that you could use Pango markups in your strings (Pango is the GTK
library for managing fonts):
https://docs.gtk.org/Pango/pango_markup.html
The Gnome Discourse may also help you:
https://discourse.gnome.org/c/platform/5
Please report here if you succeed.
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ7SHOSAOT242I46ER636LXTDH4TANCNFSM6AAAAAA26LI56I>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
*...*
*Ivo Wolff Gersberg*
|
Beta Was this translation helpful? Give feedback.
-
Thanks for pointing that, I will remove it later in August. |
Beta Was this translation helpful? Give feedback.
-
Hi Vincent,
! A multiline text editor in which to display the file.
tedit = hl_gtk_text_view_new(buttonsBox, editable=TRUE, &
& changed=c_funloc(file_edited), ssize = [ 1600_c_int, 600_c_int ] )
call gtk_widget_set_name (tedit, "tedit"//c_null_char)
call hl_gtk_box_pack(baseBox, buttonsBox)
provider = gtk_css_provider_new ()
display = gtk_widget_get_display (window)
call gtk_css_provider_load_from_data (provider, &
"textview#tedit {background-color: black;font-family: monospace;font-size:
16px;}" &
//c_null_char, length)
call gtk_style_context_add_provider_for_display (display, provider, 800)
…On Tue, Aug 1, 2023 at 2:29 PM Vincent Magnin ***@***.***> wrote:
Great Ivo! Could you post here the main lines of code you use to modify
your font in your TextView?
I could then try to include it in one of the gtk-fortran example.
—
Reply to this email directly, view it on GitHub
<#276 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ7SHJNK4NGQKYLNSWWDMTXTE4JJANCNFSM6AAAAAA26LI56I>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
*...*
*Ivo Wolff Gersberg*
|
Beta Was this translation helpful? Give feedback.
-
Thanks a lot Ivo. |
Beta Was this translation helpful? Give feedback.
-
Hi Vincent,
Thank you for your great job.
Have a nice day,
Ivo
…On Wed, Aug 2, 2023, 6:21 AM Vincent Magnin ***@***.***> wrote:
Thanks a lot Ivo.
So the CSS Provider is applied to the GTK window, and the TextView widget
is then referenced in the CSS code.
I will later try to add such a code in an example as this is a useful
basic feature but not so trivial as we could hope...
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ7SHNVLMYU3IWH3VJCJPDXTIL2DANCNFSM6AAAAAA26LI56I>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I have updated the |
Beta Was this translation helpful? Give feedback.
-
I have also noted that in GTK 4.12, The replacement method will be |
Beta Was this translation helpful? Give feedback.
-
;)
Nice.
Big hug,
Ivo
…On Mon, Aug 7, 2023, 4:58 PM Vincent Magnin ***@***.***> wrote:
I have updated the examples/bazaar.f90: the TextView now has an ivory
background and a Times font. Thanks @ivogersberg
<https://github.com/ivogersberg>
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ7SHOR7JWGB4SQOJWZAFDXUFCGDANCNFSM6AAAAAA26LI56I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi Vincent,
Thanks for the advice.
I will try the new function later.
Great job.
Hugs,
Ivo
…On Mon, Aug 7, 2023, 5:01 PM Vincent Magnin ***@***.***> wrote:
I have also noted that in GTK 4.12, gtk_css_provider_load_from_data will
be deprecated (therefore still available in GTK<5):
https://docs.gtk.org/gtk4/method.CssProvider.load_from_data.html
The replacement method will be gtk_css_provider_load_from_string:
https://docs.gtk.org/gtk4/method.CssProvider.load_from_string.html
—
Reply to this email directly, view it on GitHub
<#276 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABJ7SHNUW7YUVJJUMDC334TXUFCQ3ANCNFSM6AAAAAA26LI56I>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Sorry to bother you, I am a newbie using GTK-FORTRAN. I saw the examples, but I still have problems to change the FONT of a multiline text editor created with de function "hl_gtk_text_view_new". Can I change the font name and the font size? Thanks a lot in advance.
Beta Was this translation helpful? Give feedback.
All reactions