Interesting. What font are you using? Does it do the same in other
fonts?
I ask because, by definition, an em-space for any given font should
be the same width as the letter 'm' in that font. (And an en-space
should be the same width as the letter 'n'.)
Also by definition, an em-space, en-space and simple space should all
be the same width in a mono-spaced font.
So I'm asking, is this behavior a font thing (based on the font
you're using) or a RealBasic thing?
Kirk
On Mar 28, 2007, at 10:47 AM, joe at strout dot net wrote:
> Unicode &h2003 is the "Em Space" character. It's a whitespace
> character that's significantly longer than your typical space
> character. The code above intercepts any press of the Tab key and
> inserts an Em Space instead.
>
> The result is pretty encouraging — at the beginning of a line, at
> least, this does a very convincing impression of a tab that's about
> 3-4
> characters wide (depending on the font). It properly highlights when
> you select it, gets deleted or cursored-over as a single character,
> etc.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
From Wed 28 Mar 2007 11:44:27 -0600
Return-Path: <realbasic-nug-bounces at lists dot realsoftware dot com>
X-Original-To: listarchive at realsoftware dot com
Delivered-To: listarchive at realsoftware dot com
Received: by xmail.realsoftware.com (Postfix, from userid 1037)
id ADD811D4C79D; Wed, 28 Mar 2007 10:44:37 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.1.1 (2006-03-10) on
www.realsoftware.com
X-Spam-Level:
X-Spam-Status: No, score=-2.8 required=4.5 tests=ALL_TRUSTED,AWL,BAYES_00,
NO_REAL_NAME autolearn=ham version=3.1.1
Received: from lists.realsoftware.com (m.realsoftware.com [66.116.103.65])
by xmail.realsoftware.com (Postfix) with ESMTP id CED471D4C784;
Wed, 28 Mar 2007 10:44:35 -0700 (PDT)
Received: from real-software-mini.local (localhost [127.0.0.1])
by lists.realsoftware.com (Postfix) with ESMTP id 91E5E19685F;
Wed, 28 Mar 2007 12:44:31 -0500 (CDT)
X-Original-To: realbasic-nug at lists dot realsoftware dot com
Delivered-To: realbasic-nug at lists dot realsoftware dot com
Received: from mail.verex.com (mail.verex.com [66.116.103.197])
by lists.realsoftware.com (Postfix) with ESMTP id BBAAB196854
for <realbasic-nug at lists dot realsoftware dot com>;
Wed, 28 Mar 2007 12:44:27 -0500 (CDT)
Received: from [66.116.103.197] (localhost [127.0.0.1])
by mail.verex.com (Postfix) with SMTP id D8B8B721BCB
for <realbasic-nug at lists dot realsoftware dot com>;
Wed, 28 Mar 2007 11:44:27 -0600 (MDT)
Date: Wed, 28 Mar 2007 11:44:27 -0600
Subject: Re: A way to get half-decent tabs in an RB EditField
From: joe at strout dot net
To: realbasic-nug at lists dot realsoftware dot com
In-Reply-To: <9FEEF904-F956-4A8D-A31C-4662C61250BF at bydennis dot com>
X-Mailer: VerEx Email Gateway
Message-Id: <20070328174427 dot D8B8B721BCB at mail dot verex dot com>
X-BeenThere: realbasic-nug at lists dot realsoftware dot com
X-Mailman-Version: 2.1.9
Precedence: list
Reply-To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: realbasic-nug-bounces at lists dot realsoftware dot com
Errors-To: realbasic-nug-bounces at lists dot realsoftware dot com
On Mar 28, 2007, at 17:23 UTC, Kirk Gray wrote:
> Interesting. What font are you using? Does it do the same in other
> fonts?
I was using the system font. But I would expect it to work in any font
on OS X, given the automatic font substitution.
> I ask because, by definition, an em-space for any given font should
> be the same width as the letter 'm' in that font. (And an en-space
> should be the same width as the letter 'n'.)
It's just a little bit longer than a letter "m", but of course that's
much better than the space character, which is about half as wide.
And I see that it is somewhat font-dependent; copying some of that text
and pasting it into a Firefox field (which is theoretically monospaced)
produces an indent almost as wide as two m's.
> Also by definition, an em-space, en-space and simple space should all
> be the same width in a mono-spaced font.
Right. Apparently the monospaced font I'm using doesn't have that
chararcter, so OS X is substituting one from another font, which comes
out a bit wider.
> So I'm asking, is this behavior a font thing (based on the font
> you're using) or a RealBasic thing?
It's certainly not a REALbasic thing, which is simply drawing the
characters as the OS draws them. It's an OS thing. But if it works on
all the major OSes, then I'm fine with that.
Best,
- Joe
--
Joe Strout -- joe at strout dot net
Verified Express, LLC "Making the Internet a Better Place"
http://www.verex.com/
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|