Re: [Gimp-user] font size

2010-08-04 Thread saulgoode
Quoting Kevin :

> I'm trying to write a script to create text layers using the currently
> selected font.
> :
> :
> Is it possible to get the current font size, or to create a text   
> layer without having to specify a font size?

Not to my knowledge.

If your ultimate goal is to fit text within a certain area -- for  
example sizing a label to fit on a button -- then you might find the  
following function useful for determining your font size. It's not  
pretty (but it works).

The fontsize% argument is a percentage value that allows you to  
effectively specify a "padding" around the text. For example, 100%  
means determine the largest fontsize possible such that the text will  
fit within the boundaries. Note that most fonts already include some  
padding around the characters (so you might find a value larger than  
100 desirable).

Example: (set! fontsize (calc-fontsize "Hello" "Sans" 80 60 20))


   (define (calc-fontsize text font fontsize% width height)
 (let* (
 (fontsize 6) ;; minimum possible fontsize
 (extents nil)
 (last-extents nil)
 (last-fontsize 3)
 (adjust 2)
 )
   (set! extents (gimp-text-get-extents-fontname text fontsize  
PIXELS font))
   (set! width (* width fontsize% 0.01))
   (set! height (* height fontsize% 0.01))
   (while (and (<> last-fontsize fontsize) (not (equal? extents  
last-extents)))
 (if (or (> (car extents) width) (> (cadr extents) height))
   (begin
 (set! fontsize last-fontsize)
 (set! adjust (+ (* (- adjust 1) 0.5) 1))
 )
   (begin
 (set! last-extents extents)
 (set! last-fontsize fontsize)
 )
   )
 (set! fontsize (truncate (* fontsize adjust)))
 (set! extents (gimp-text-get-extents-fontname text fontsize  
PIXELS font))
 )
   (max fontsize 6)
   )
 )

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Font size in Gimp

2007-08-14 Thread Sven Neumann
Hi,

On Tue, 2007-08-14 at 12:06 -0700, David Arnold wrote:

> Is there a simple way to change add a them with a larger font size?

Should be sufficient to add a line like

gtk-font-name = "Sans 24"

to your ~/.gimp-2.2/gtkrc file


Sven


___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Font size?

2007-05-22 Thread John R. Culleton
On Tuesday 22 May 2007 10:25, Patrick Shanahan wrote:
> * John R. Culleton <[EMAIL PROTECTED]> [05-22-07 10:14]:
> > Using gimp 2.3.13:
> > When I select the tool Font (big letter A) and then click on a
> > layer I get to a dialog that allows me to enter text. When I
> > select dialogs>font I get to the dialog that allows me to choose
> > a typeface. But there is another dialog I remember that allows me
> > to select the size of the type and the color as well as the
> > typeface.
>
> Look again at the dialog where you are given the opportunity to
> select the font.  It's the same dialog you get when you select the
> font tool from the tool box, BEFORE you click on the "Aa".
>

It is tool options on the dialog menu for the text tool. Hidden in 
plain sight.  I use to be able to get this with a right click on the 
tool.

-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com

___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Font size?

2007-05-22 Thread Patrick Shanahan
* John R. Culleton <[EMAIL PROTECTED]> [05-22-07 10:14]:
> Using gimp 2.3.13:
> When I select the tool Font (big letter A) and then click on a layer  
> I get to a dialog that allows me to enter text. When I select 
> dialogs>font I get to the dialog that allows me to choose a typeface. 
> But there is another dialog I remember that allows me to select the 
> size of the type and the color as well as the typeface. 

Look again at the dialog where you are given the opportunity to select
the font.  It's the same dialog you get when you select the font tool
from the tool box, BEFORE you click on the "Aa".

> Sorry for my senior moment but now I am stymied. 

Spend a lot of time there   :^)

-- 
Patrick Shanahan Plainfield, Indiana, USAHOG # US1244711
http://wahoo.no-ip.org Photo Album:  http://wahoo.no-ip.org/gallery2
OpenSUSE Linux   http://en.opensuse.org/
Registered Linux User #207535@ http://counter.li.org
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user


Re: [Gimp-user] Font size

2006-05-30 Thread Matt Gushee

Paul Bloch wrote:
So I've noticed that although there are different palettes for when 
you're placing text (text field, font selector) I can't find anyway to 
edit the size of the text!


That's strange. Normally you can just select existing text with the text 
tool, which allows you to change the size. That's assuming that the text 
is still in its original state--a separate text layer. If you have 
merged it into another layer or applied transformations to it (e.g. 
scaling, rotation, etc.) then it has been converted to a graphical 
object, and you can no longer perform text operations on it.


Does that help at all?

--
Matt Gushee
The Reluctant Geek: http://matt.gushee.net/rg/
___
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user