unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* quick change of face-size?
@ 2005-11-06 21:26 knubee
  2005-11-06 21:29 ` knubee
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: knubee @ 2005-11-06 21:26 UTC (permalink / raw)


When using an overhead projector to show some file in emacs, it would
be nice if there was a way to quickly change the face-size displayed.
Something similar to c-+ and c-- in many gnome applications. Are there
such short-cut bindings in emacs? If not, is there some command that
will do this? (Note: I don't want to change my default font -- so emacs
should just revert to my defaults the next time I start it up.)

I'm using emacs 24.1.1 under linux, if that makes a difference.

thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: quick change of face-size?
  2005-11-06 21:26 quick change of face-size? knubee
@ 2005-11-06 21:29 ` knubee
  2005-11-06 22:03 ` Peter Dyballa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: knubee @ 2005-11-06 21:29 UTC (permalink / raw)


uh, that's emacs 21.4.1 i'm using :-)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: quick change of face-size?
  2005-11-06 21:26 quick change of face-size? knubee
  2005-11-06 21:29 ` knubee
@ 2005-11-06 22:03 ` Peter Dyballa
  2005-11-07  1:13 ` Drew Adams
       [not found] ` <mailman.14214.1131326015.20277.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 12+ messages in thread
From: Peter Dyballa @ 2005-11-06 22:03 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 06.11.2005 um 22:26 schrieb knubee:

> When using an overhead projector to show some file in emacs, it would
> be nice if there was a way to quickly change the face-size displayed.

You can edit setq x-fixed-font-alist in some site init file à la:

    '("X11 Font Menu"
       ("Misc fixed"
;; For these, we specify the pixel height and width.
        ("«ProFont»" "»ProFont«")
        ("ISO 10646-1" 
"-misc-profontwindows-medium-r-normal--0-*-*-*-m-*-iso10646-1" "ISO 
10646-1")
        ("ISO 8859-15" 
"-misc-profontwindows-medium-r-normal--0-*-*-*-m-*-iso8859-15" "ISO 
8859-15")
        ("fcd 8859-15" 
"-misc-profontwindows-medium-r-normal--0-*-*-*-m-*-fcd8859-15" "fcd 
8859-15")
        ("ISO 8859-9"  
"-misc-profontwindows-medium-r-normal--0-*-*-*-m-*-iso8859-9"  "ISO 
8859-9")
        ("ISO 8859-1"  
"-misc-profontwindows-medium-r-normal--0-*-*-*-m-*-iso8859-1"  "ISO 
8859-1")
        ("ASCII-0"     
"-misc-profontwindows-medium-r-normal--0-*-*-*-m-*-ascii-0"    
"ASCII-0")
        ("fixed" "fixed")
        (  "4x6" "-misc-fixed-medium-r-normal--6-*-*-*-c-40-iso10646-1"  
    "4x6")
        (  "5x7" "-misc-fixed-medium-r-normal--7-*-*-*-c-50-iso10646-1"  
    "5x7")
        (  "5x8" "-misc-fixed-medium-r-normal--8-*-*-*-c-50-iso10646-1"  
    "5x8")
        (  "6x9" "-misc-fixed-medium-r-normal--9-*-*-*-c-60-iso10646-1"  
    "6x9")
        ( "6x10" "-misc-fixed-medium-r-normal--10-*-*-*-c-60-iso10646-1" 
   "6x10")
        ( "6x12" 
"-misc-fixed-medium-r-semicondensed--12-*-*-*-c-60-iso10646-1" "6x12")
        ( "6x13" 
"-misc-fixed-medium-r-semicondensed--13-*-*-*-c-60-iso10646-1" "6x13")
        ( "7x13" "-misc-fixed-medium-r-normal--13-*-*-*-c-70-iso10646-1" 
   "7x13")
        ( "7x14" "-misc-fixed-medium-r-normal--14-*-*-*-c-70-iso10646-1" 
   "7x14")
        ( "8x13" "-misc-fixed-medium-r-normal--13-*-*-*-c-80-iso10646-1" 
   "8x13")
        ( "9x15" "-misc-fixed-medium-r-normal--15-*-*-*-c-90-iso10646-1" 
   "9x15")
        ("10x20" 
"-misc-fixed-medium-r-normal--20-*-*-*-c-100-iso10646-1" "10x20")
        ("11x18" 
"-misc-fixed-medium-r-normal--18-*-*-*-c-110-iso10646-1" "11x18")
        ("12x24" 
"-misc-fixed-medium-r-normal--24-*-*-*-c-120-iso10646-1" "12x24")
        )
       ("Lucida Sans Typewriter 75 DPI"
;; For these, we specify the point height and the DPIs.
        ( "8" 	      
	"-*-lucidatypewriter-medium-r-normal-*-80-75-75-m-*-iso10646-1")
        ("10" 	      
	"-*-lucidatypewriter-medium-r-normal-*-100-75-75-m-*-iso10646-1")
        ("12" 	      
	"-*-lucidatypewriter-medium-r-normal-*-120-75-75-m-*-iso10646-1")
        ("14" 	      
	"-*-lucidatypewriter-medium-r-normal-*-140-75-75-m-*-iso10646-1")
        ("18" 	      
	"-*-lucidatypewriter-medium-r-normal-*-180-75-75-m-*-iso10646-1")
        ("19" 	      
	"-*-lucidatypewriter-medium-r-normal-*-190-75-75-m-*-iso10646-1")
        ("24" 	      
	"-*-lucidatypewriter-medium-r-normal-*-240-75-75-m-*-iso10646-1")
        ( "8 bold"       
"-*-lucidatypewriter-bold-r-normal-*-80-75-75-m-*-iso10646-1")
        ("10 bold"       
"-*-lucidatypewriter-bold-r-normal-*-100-75-75-m-*-iso10646-1")
        ("12 bold"       
"-*-lucidatypewriter-bold-r-normal-*-120-75-75-m-*-iso10646-1")
        ("14 bold"       
"-*-lucidatypewriter-bold-r-normal-*-140-75-75-m-*-iso10646-1")
        ("18 bold"       
"-*-lucidatypewriter-bold-r-normal-*-180-75-75-m-*-iso10646-1")
        ("19 bold"       
"-*-lucidatypewriter-bold-r-normal-*-190-75-75-m-*-iso10646-1")
        ("24 bold"       
"-*-lucidatypewriter-bold-r-normal-*-240-75-75-m-*-iso10646-1")
        ( "8 slant"      
"-*-lucidatypewriter-medium-o-normal-*-80-75-75-m-*-iso10646-1")
        ("10 slant"      
"-*-lucidatypewriter-medium-o-normal-*-100-75-75-m-*-iso10646-1")
        ("12 slant"      
"-*-lucidatypewriter-medium-o-normal-*-120-75-75-m-*-iso10646-1")
        ("14 slant"      
"-*-lucidatypewriter-medium-o-normal-*-140-75-75-m-*-iso10646-1")
        ("18 slant"      
"-*-lucidatypewriter-medium-o-normal-*-180-75-75-m-*-iso10646-1")
        ("19 slant"      
"-*-lucidatypewriter-medium-o-normal-*-190-75-75-m-*-iso10646-1")
        ("24 slant"      
"-*-lucidatypewriter-medium-o-normal-*-240-75-75-m-*-iso10646-1")
        ( "8 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-80-75-75-m-*-iso10646-1")
        ("10 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-100-75-75-m-*-iso10646-1")
        ("12 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-120-75-75-m-*-iso10646-1")
        ("14 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-140-75-75-m-*-iso10646-1")
        ("18 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-180-75-75-m-*-iso10646-1")
        ("19 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-190-75-75-m-*-iso10646-1")
        ("24 bold slant" 
"-*-lucidatypewriter-bold-o-normal-*-240-75-75-m-*-iso10646-1")
       )
       ("Courier @ 100 DPI" ...)

and create some fontsets. Shift-mouse-1 pops up a menu to choose either 
a font or a fontset. Make the default visible there. Create a 
return-to-default-font function too and bind it to some key.

--
Greetings

   Pete

Time is an illusion. Lunchtime, doubly so.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: quick change of face-size?
  2005-11-06 21:26 quick change of face-size? knubee
  2005-11-06 21:29 ` knubee
  2005-11-06 22:03 ` Peter Dyballa
@ 2005-11-07  1:13 ` Drew Adams
       [not found] ` <mailman.14214.1131326015.20277.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2005-11-07  1:13 UTC (permalink / raw)


    When using an overhead projector to show some file in emacs, it would
    be nice if there was a way to quickly change the face-size displayed.
    Something similar to c-+ and c-- in many gnome applications. Are there
    such short-cut bindings in emacs? If not, is there some command that
    will do this? (Note: I don't want to change my default font -- so emacs
    should just revert to my defaults the next time I start it up.)

http://www.emacswiki.org/cgi-bin/wiki/zoom-frm.el - commands to zoom a frame
in or out (changing the font size).

;;  Suggested key bindings:
;;
;;  (define-key global-map [S-mouse-1] 'zoom-frm-in)
;;  (define-key global-map [C-S-mouse-1] 'zoom-frm-out)
;;  ;; Get rid of `mouse-set-font':
;;  (define-key global-map [S-down-mouse-1] nil)

Or bind to `C-+' and `C--', if you prefer.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* quick change of face-size?
@ 2005-11-07  9:10 David Reitter
  0 siblings, 0 replies; 12+ messages in thread
From: David Reitter @ 2005-11-07  9:10 UTC (permalink / raw)
  Cc: Emacs help


[-- Attachment #1.1: Type: text/plain, Size: 262 bytes --]

> When using an overhead projector to show some file in emacs, it would
> be nice if there was a way to quickly change the face-size displayed.

Take a look at DoReMi - it allows for "direct manipulation" in Emacs:

http://www.emacswiki.org/cgi-bin/wiki/DoReMi


[-- Attachment #1.2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2400 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: quick change of face-size?
       [not found] ` <mailman.14214.1131326015.20277.help-gnu-emacs@gnu.org>
@ 2005-11-08  9:46   ` knubee
  2005-11-08 14:57     ` Drew Adams
       [not found]     ` <mailman.14390.1131461852.20277.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 12+ messages in thread
From: knubee @ 2005-11-08  9:46 UTC (permalink / raw)


> http://www.emacswiki.org/cgi-bin/wiki/zoom-frm.el - commands to zoom a frame
> in or out (changing the font size).

Thanks for this pointer. However, when I zoom in, I get the following
error:

Font `-Misc-Fixed-Medium-R-SemiCondensed--14-*-75-75-C-*-ISO8859-1' is
not defined

My default font is:

"-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1"

How can I ensure that my emacs has the correct fonts (or font
definitions) so that your zoom utility will do the right thing?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: quick change of face-size?
  2005-11-08  9:46   ` knubee
@ 2005-11-08 14:57     ` Drew Adams
       [not found]     ` <mailman.14390.1131461852.20277.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 12+ messages in thread
From: Drew Adams @ 2005-11-08 14:57 UTC (permalink / raw)


    > http://www.emacswiki.org/cgi-bin/wiki/zoom-frm.el - commands
    > to zoom a frame in or out (changing the font size).

    Thanks for this pointer. However, when I zoom in, I get the following
    error:

    Font `-Misc-Fixed-Medium-R-SemiCondensed--14-*-75-75-C-*-ISO8859-1' is
    not defined

    My default font is:

    "-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1"

    How can I ensure that my emacs has the correct fonts (or font
    definitions) so that your zoom utility will do the right thing?

I dunno. Zooming in this way just changes the font _size_ parameter. If you
try to set a font size that you don't have, you'll get an error. If you
have, say, a different increment between existing font sizes, try changing
the zoom increment. For instance, if you have size 13 and size 15, but not
14, try a zoom increment of 2, not 1. User option
`frame-zoom-font-difference' is the zoom increment - customize it as needed.

HTH. - Drew

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: quick change of face-size?
       [not found]     ` <mailman.14390.1131461852.20277.help-gnu-emacs@gnu.org>
@ 2005-11-08 20:56       ` knubee
  2005-11-08 22:02         ` Drew Adams
                           ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: knubee @ 2005-11-08 20:56 UTC (permalink / raw)


>     How can I ensure that my emacs has the correct fonts (or font
>     definitions) so that your zoom utility will do the right thing?
>
> I dunno. Zooming in this way just changes the font _size_ parameter. If you
> try to set a font size that you don't have, you'll get an error.

Ok. I poked around a bit in the different files associated with
zoom-frame.el and I think I see what is happening. Your code relies on
frame-parameter to extract the frame font info. In my case, this is:

"-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1"

Then, your code simply changes the frame font with the size value
incremented by value of 1 (or some user-specified value).

I understand that this makes the code fairly straight-forward to write,
but it relies on the existence of fonts that correspond to those size
increments. It seems to me that a more general solution would:

a) get a listing of the existing fonts in different sizes for the
current frame's font-family
b) zoom in/out by "one unit", where this means the next available size
of the font-family

My question: do you or someone else know how to return such a listing
of the installed fonts within emacs? I tried a few things, but wasn't
able to do it.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: quick change of face-size?
  2005-11-08 20:56       ` knubee
@ 2005-11-08 22:02         ` Drew Adams
  2005-11-10  1:25         ` rgb
       [not found]         ` <mailman.14456.1131487390.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2005-11-08 22:02 UTC (permalink / raw)


    >     How can I ensure that my emacs has the correct fonts (or font
    >     definitions) so that your zoom utility will do the right thing?
    >
    > I dunno. Zooming in this way just changes the font _size_
    parameter. If you
    > try to set a font size that you don't have, you'll get an error.

    Ok. I poked around a bit in the different files associated with
    zoom-frame.el and I think I see what is happening. Your code relies on
    frame-parameter to extract the frame font info. In my case, this is:

    "-Misc-Fixed-Medium-R-SemiCondensed--13-120-75-75-C-60-ISO8859-1"

    Then, your code simply changes the frame font with the size value
    incremented by value of 1 (or some user-specified value).

    I understand that this makes the code fairly straight-forward to write,
    but it relies on the existence of fonts that correspond to those size
    increments.

Yes. But, as I said, you can control the increment size.

    It seems to me that a more general solution would:

    a) get a listing of the existing fonts in different sizes for the
    current frame's font-family
    b) zoom in/out by "one unit", where this means the next available size
    of the font-family

Yes, probably.

    My question: do you or someone else know how to return such a listing
    of the installed fonts within emacs? I tried a few things, but wasn't
    able to do it.

Not I.  I know next to nothing about fonts in Emacs.  Someone else can
probably help you though.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: quick change of face-size?
  2005-11-08 20:56       ` knubee
  2005-11-08 22:02         ` Drew Adams
@ 2005-11-10  1:25         ` rgb
       [not found]         ` <mailman.14456.1131487390.20277.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 12+ messages in thread
From: rgb @ 2005-11-10  1:25 UTC (permalink / raw)



> My question: do you or someone else know how to return such a listing
> of the installed fonts within emacs?

(x-list-fonts "*")  Lists them all.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: quick change of face-size?
       [not found]         ` <mailman.14456.1131487390.20277.help-gnu-emacs@gnu.org>
@ 2005-11-12 15:58           ` knubee
  2005-11-12 17:06             ` Drew Adams
  0 siblings, 1 reply; 12+ messages in thread
From: knubee @ 2005-11-12 15:58 UTC (permalink / raw)


>> it it relies on the existence of fonts that correspond to those
>> size increments.
>
> Yes. But, as I said, you can control the increment size.

Drew, I think it is great how you write and post so many emacs utility
files. However, this last comment of yours (and several others you
have made) suggests that I am not being clear about why the solution
implemented in zoom-frm.el is fragile.

Consider that someone has a family of fonts in the following sizes:

9
10
12
14
15
22

Simply selecting the NUMBER associated with the current font size and
incrementing/decrementing that value by some fixed numerical value is
not guaranteed to consistently return an existing font, no matter what
the increment/decrement value.

When I get the time, I will try to hack together a solution based on
your zoom-frm.el and some of the results returned by
x-list-fonts (thanks for the pointer, rgb).

^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: quick change of face-size?
  2005-11-12 15:58           ` knubee
@ 2005-11-12 17:06             ` Drew Adams
  0 siblings, 0 replies; 12+ messages in thread
From: Drew Adams @ 2005-11-12 17:06 UTC (permalink / raw)


    >> it it relies on the existence of fonts that correspond to those
    >> size increments.
    >
    > Yes. But, as I said, you can control the increment size.

    Drew, I think it is great how you write and post so many emacs utility
    files. However, this last comment of yours (and several others you
    have made) suggests that I am not being clear about why the solution
    implemented in zoom-frm.el is fragile.

You were clear. Perhaps I was not.

    Consider that someone has a family of fonts in the following sizes:

    9, 10, 12, 14, 15, 22

    Simply selecting the NUMBER associated with the current font size and
    incrementing/decrementing that value by some fixed numerical value is
    not guaranteed to consistently return an existing font, no matter what
    the increment/decrement value.

Yes, you're right. I didn't mean to suggest otherwise. I should have said,
"_If_ the sizes of your fonts differ by the same increment, _then_ you can
use zoom-frm.el as is, by changing the increment size to fit your fonts."

    When I get the time, I will try to hack together a solution based on
    your zoom-frm.el and some of the results returned by
    x-list-fonts (thanks for the pointer, rgb).

That would be great. You might also check out Miles Bader's email to the
emacs-devel list (emacs-devel@gnu.org), subject: "Default-face grow/shrink
commands", date: May 10, 2004. It includes a source-code attachment. Miles
used a different (perhaps simpler and less fragile) approach than I. His
message specifically mentions the problem of missing fonts (I think his code
just skips such fonts, however).

Consider, as a first attempt, just using the zoom-frm.el code, modifying it
to:

1. increment by 1
2. if there is no such font (use a condition-case to trap the error), then
repeat #1; else you're done

HTH,

  Drew

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2005-11-12 17:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-06 21:26 quick change of face-size? knubee
2005-11-06 21:29 ` knubee
2005-11-06 22:03 ` Peter Dyballa
2005-11-07  1:13 ` Drew Adams
     [not found] ` <mailman.14214.1131326015.20277.help-gnu-emacs@gnu.org>
2005-11-08  9:46   ` knubee
2005-11-08 14:57     ` Drew Adams
     [not found]     ` <mailman.14390.1131461852.20277.help-gnu-emacs@gnu.org>
2005-11-08 20:56       ` knubee
2005-11-08 22:02         ` Drew Adams
2005-11-10  1:25         ` rgb
     [not found]         ` <mailman.14456.1131487390.20277.help-gnu-emacs@gnu.org>
2005-11-12 15:58           ` knubee
2005-11-12 17:06             ` Drew Adams
  -- strict thread matches above, loose matches on Subject: below --
2005-11-07  9:10 David Reitter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).