# Bigger font size

**URL:** <https://www.ruby-forum.com/t/bigger-font-size/213065>\
**Category:** Ruby-Gnome 2\
**Created:** [October 22, 2011, 6:40am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065 "2011-10-22T06:40:59Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 22, 2011, 6:40am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/1 "2011-10-22T06:40:59Z")

</div>

Hi all

First, I want to thank you developer, for this great library. I like it  
so  
much and it really helps me a lot  
and now,  
I’m currently making an app for elder people here  
is there a way to make all font in my application bigger, rather than  
set  
them one by one?

Thanks

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 24, 2011, 10:45am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/2 "2011-10-24T10:45:12Z")

</div>

Hi!

I think it depends on how you want to try to solve it.

For instance, if you use Gnome::CanvasText you can do:

@canvas\_text = Gnome::CanvasText.new(@canvas\_group,  
:x =\> 98.0,  
:y =\> 32.0,  
:font =\> “Sans 22”,  
:anchor =\> Gtk::ANCHOR\_CENTER,  
:text =\> “foobar”,  
:fill\_color =\> “black”  
)

And pass in the font value there.

If you want to modify the font of your window, you can do this:

@window.modify\_font(  
Pango::FontDescription.new("#widget.settings.gtk\_font\_nameend 20" ) )

Where @window is of Gtk::Window type.

I think you can also use .modify\_font on other widgets, for instance:

DEFAULT\_FONT = Pango::FontDescription.new(“Sans 30”)  
@label.modify\_font(DEFAULT\_FONT)

I am also using some constants for easier access like this:

module PangoFonts

```
FONT_SANS_BOLD_08 = Pango::FontDescription.new('Sans Bold 08')
FONT_SANS_BOLD_10 = Pango::FontDescription.new('Sans Bold 10')
FONT_SANS_BOLD_11 = Pango::FontDescription.new('Sans Bold 11')
FONT_SANS_BOLD_12 = Pango::FontDescription.new('Sans Bold 12')
FONT_SANS_BOLD_14 = Pango::FontDescription.new('Sans Bold 14')
FONT_SANS_BOLD_16 = Pango::FontDescription.new('Sans Bold 16')
FONT_SANS_BOLD_18 = Pango::FontDescription.new('Sans Bold 18')

FONT_UTOPIA_14 = Pango::FontDescription.new('Utopia 14')
FONT_UTOPIA_16 = Pango::FontDescription.new('Utopia 16')
FONT_UTOPIA_18 = Pango::FontDescription.new('Utopia 18')
FONT_UTOPIA_20 = Pango::FontDescription.new('Utopia 20')

```

end

In a VTE Terminal you could do this:

@vte\_terminal.set\_font(‘Monospace 28’,  
Vte::TerminalAntiAlias::FORCE\_ENABLE)

Not sure if this is helping you, sorry, but perhaps it can be a start.  
🙂

There is probably also an easier way to handle font size in general, I  
am just not sure about it (The GTK way …)

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 24, 2011, 11:11am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/3 "2011-10-24T11:11:45Z")

</div>

On 22 October 2011 06:40, hendra kusuma [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all
> 
> First, I want to thank you developer, for this great library. I like it so  
> much and it really helps me a lot  
> and now,  
> I’m currently making an app for elder people here  
> is there a way to make all font in my application bigger, rather than set  
> them one by one?

Maybe rather than setting font size specifically for your application  
it would be more useful to set large font size in gtk theme so that  
all applications get large fonts?

HTH

Michal

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 24, 2011, 9:40pm UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/4 "2011-10-24T21:40:34Z")

</div>

On 22 October 2011 05:40, hendra kusuma [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi all
> 
> First, I want to thank you developer, for this great library. I like it so much  
> and it really helps me a lot  
> and now,  
> I’m currently making an app for elder people here  
> is there a way to make all font in my application bigger, rather than set them  
> one by one?

If it’s a desktop application to run on your user’s computer, it’d be  
much better to point them towards the control panel to increase the  
font size for all their applications.

If it’s the only application the target users will have access to/use  
on the machine, then it may be worth overriding the default setting  
for your application in Gtk::Settings

e.g.  
Gtk::Settings.default.gtk\_font\_name=“Sans 24”

–  
Random Musing - [http://www.frafferz.com/](http://www.frafferz.com/)  
Geek Blog - [http://geoffyoungs.github.com/](http://geoffyoungs.github.com/)

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 25, 2011, 10:10am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/5 "2011-10-25T10:10:20Z")

</div>

Thank you all for your reply

Gtk::Settings.default.gtk\_font\_name=“Sans 24”

this line works like charm  
of course 24 is too big 🙂

sorry, been away for a moment from this project because my other project  
needs attention.

I’d rather not change all desktop font, since basically it’s a general  
application  
that can be used by all, not just elders

it’s a karaoke program 😃

or to be precise, it’s a front end to choose and queue song to play in  
VLC,  
ala karaoke suite  
I make this for my father, he likes singing a lot.  
And most likely my girlfriend will also use this since she likes singing  
too  
🙂

Thanks  
Regards

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 27, 2011, 1:59am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/6 "2011-10-27T01:59:35Z")

</div>

> it’s a karaoke program 😃

Haha great idea! Hope it’ll work nicely 😃

> it’s a front end to choose and queue song to play in VLC

Hmm how do you play it in VLC? Do you actually embed VLC?  
Because that would be kind of awesome!

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 24, 2011, 9:23pm UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/7 "2011-10-24T21:23:34Z")

</div>

In CSS this would be kind of easy.

body {  
font-size: 2em;  
}

And reuse the .css files or load another one.

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 27, 2011, 6:37am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/8 "2011-10-27T06:37:19Z")

</div>

On Thu, Oct 27, 2011 at 7:59 AM, Marc H. \<  
removed\_email\_address@domain.invalid\> wrote:

> > it’s a karaoke program 😃
> 
> Haha great idea! Hope it’ll work nicely 😃

Thanks 🙂  
it’s almost finished. I still have a problem I haven’t solved yet  
Hope to finish it soon

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [November 3, 2011, 10:32pm UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/9 "2011-11-03T22:32:32Z")

</div>

> Your other question don’t show in gmail for  
> unknown reason.

Hmm. I am using [ruby-forum.com](http://ruby-forum.com) to post content.

There is a little checkbutton “Enable email notification”  
which I usually do not check, before I hit “Submit”.

I try with this post though, perhaps you will see  
a difference? If so then that may have been the reason.

By the way, thank you for that information, really  
appreciate it. 🙂

---

<div class="post-metadata">

**Author:** ![hendra\_kusuma](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/5f8ce5/32.png) [@hendra\_kusuma](https://www.ruby-forum.com/u/hendra_kusuma)\
**Post date:** [October 31, 2011, 5:32am UTC](https://www.ruby-forum.com/t/bigger-font-size/213065/10 "2011-10-31T05:32:22Z")

</div>

On Thu, Oct 27, 2011 at 7:59 AM, Marc H. \<  
removed\_email\_address@domain.invalid\> wrote:

> > it’s a karaoke program 😃
> 
> Haha great idea! Hope it’ll work nicely 😃
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Your other question don’t show in gmail for unknown reason. I just find  
it  
out when googling

Hmm how do you play it in VLC? Do you actually embed VLC?  
Because that would be kind of awesome!

For the time being, I use VLC itself in remote control mode  
and control it using popen4 library to input stdin  
and I use a very rough/bad method to get stdout since popen4 can’t get  
stdout without closing stdin or seems like it  
but it’s already in usable state.

I want to release this, but installation won’t be as easy as next next  
finish  
as I don’t know anything about making installer in Ruby

I actually do some research to embed vlc, there something at  
[http://www.gtkforums.com/viewtopic.php?t=4285](http://www.gtkforums.com/viewtopic.php?t=4285)  
that shows it can be done, but it’s in C, not Ruby  
and I sucks at C -\_-;

Can’t seem to find any ruby related about this  
If you guys know anything to do so,  
a help or pointer would be very helpful

Thanks
