# Tk text tag\_configure

**URL:** <https://www.ruby-forum.com/t/tk-text-tag-configure/83318>\
**Category:** Ruby\
**Created:** [January 25, 2007, 3:06am UTC](https://www.ruby-forum.com/t/tk-text-tag-configure/83318 "2007-01-25T03:06:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ed\_Redman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b4bc9f/32.png) [@Ed\_Redman](https://www.ruby-forum.com/u/Ed_Redman)\
**Post date:** [January 25, 2007, 3:06am UTC](https://www.ruby-forum.com/t/tk-text-tag-configure/83318/1 "2007-01-25T03:06:24Z")

</div>

I am trying to use Ruby/tk and a TkText object and change the text font  
on  
each line.

I can set the font and fontsize but when I do change the Tktext object.  
All the text is changed. I believe I have to tag the text object in some  
way but I am missing some point.

I am using a tcl file font.tcl as a model. There is a line in the tcl  
code  
that I can’t seem to get the ruby context.

.t tag configue f[incr count] -font [list $family 10]

if I have an object text = TkText.new could someone help me translate  
this  
into ruby/tk.  
I believe it is something like “text.tag\_configure” but after this I am  
lost.

thanks in advance

---

<div class="post-metadata">

**Author:** ![Ed\_Redman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b4bc9f/32.png) [@Ed\_Redman](https://www.ruby-forum.com/u/Ed_Redman)\
**Post date:** [January 25, 2007, 5:12am UTC](https://www.ruby-forum.com/t/tk-text-tag-configure/83318/2 "2007-01-25T05:12:35Z")

</div>

Ed Redman wrote:

> .t tag configue f[incr count] -font [list $family 10]
> 
> if I have an object text = TkText.new could someone help me translate this  
> into ruby/tk.  
> I believe it is something like “text.tag\_configure” but after this I am  
> lost.
> 
> thanks in advance

Take a look at sample/demos-en/style.rb. It creates a text box with  
multiple fonts, faces, etc.

---

<div class="post-metadata">

**Author:** ![Ed\_Redman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/b4bc9f/32.png) [@Ed\_Redman](https://www.ruby-forum.com/u/Ed_Redman)\
**Post date:** [January 25, 2007, 7:40am UTC](https://www.ruby-forum.com/t/tk-text-tag-configure/83318/3 "2007-01-25T07:40:43Z")

</div>

On Jan 24, 2007, at 11:12 PM, Joel VanderWerf wrote:

> multiple fonts, faces, etc.  
> Just to clarify things a little, the full URL is

[http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/sample/demos-](http://www.ruby-lang.org/cgi-bin/cvsweb.cgi/ruby/ext/tk/sample/demos-)  
en/style.rb

Regards, Morton
