Hi Marc,

Thanks for your reply and for all you've put in to urxvt!

It looks like I cannot get the letter spacing to update dynamically using the escape sequence:
---
$self->resource(letterSpace => $spacing);
$self->cmd_parse(sprintf "\33]710;%s\007", $font);
---
In fact, even if I set it to a large value (say 100), I don't see a change in spacing. This occurs even if I try to force an update with a font size change or window resize.

Also, I couldn't get the rxvtperl.xs to work, even with the blank lines. I'm using "$term->set_fonts();" to access it, is there something else I should be diong?
---
urxvt: Can't locate object method "set_fonts" via package "urxvt::term" at (eval 14) line 4.
---

---
[src]$ diff rxvtperl.xs{.orig,}
2489a2490,2494
>
> void
> rxvt_term::set_fonts ()
>
>
---

I was wondering if there's a better way to achieve this goal. Ideally, I would use the dimensions of the window to calculate the maximum font size and appropriate spacing for a given width. I've been attempting this brute force solution since I thought it would be easier to implement, but maybe I'm mistaken - is there a better approach I could take?

Thanks so much for all your help!
--Zak

On 06/03/2015 12:55 PM, Marc Lehmann wrote:
On Wed, Jun 03, 2015 at 11:20:05AM -0500, "Estrada, Zachary J" 
<[email protected]> wrote:
Short version:
I'm developing an extension and am running into trouble. I have two
(hopefully quick) questions:
1) How can I set letter spacing dynamically?
    $term->resource(letterSpace => $spacing); #Does not appear to change 
anything

    $term->letterSpace ($spacing);

This should do the trick of updating it, but it will not cause a relayout:

2) If I update sizing information in an on_user_command hook, $term->ncol
does not get updated.  Calling $term->want_refresh() doesn't seem to update
it. What can I do?

Right, the refresh really just refreshes the text, it doesn't relayout due to
window size or font changes.

The right thing to do would probably be to call set_fonts, which you cannot,
at the moment, do from an extension.

We can add this for the next release though. In the meantime, you could
hack your way around this by re-setting fonts with the font change OSC
sequence (e.g. using $term->cmd_parse). I didn't test this, but it should do
the tirck, as steting a new fontset will make urxvt take letterSpace into
account.

You can also add an interface yourself and recompile urxvt, by adding this
to the end of src/rxvtperl.xs (there need to be a newlines around it):

    void
    rxvt_term::set_fonts ()

Before we expose this, we might want to rename the method though, so both
methods are likely temporary.

This adventure started with this question:
http://unix.stackexchange.com/questions/183343/urxvt-force-column-width

Interesting problem.

I would like to automatically resize the contents (font size, letter
spacing) of a terminal to maintain a desired width with arbitrary window
dimensions (useful with tiling window managers). I realize this may appear
ugly with mismatched window and font geomtry, but for my common case it
should work fine.

Only one way to find out, I can imagine it would be a funny effect to
have, regardless of its limitations.



_______________________________________________
rxvt-unicode mailing list
[email protected]
http://lists.schmorp.de/cgi-bin/mailman/listinfo/rxvt-unicode

Reply via email to