Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ctype.h definition of "printing character"

7 views
Skip to first unread message

Tony Finch

unread,
May 24, 2010, 10:53:31 AM5/24/10
to
Section 7.4 paragraph 3:

The term printing character refers to a member of a locale-specific
set of characters, each of which occupies one printing position on a
display device; the term control character refers to a member of a
locale-specific set of characters that are not printing characters.
All letters and digits are printing characters.

What is "one position on a display device" supposed to be? On a fixed
width display, CJK characters typically occupy two positions. The
phrase seems to make no sense wrt proportional fonts.

Tony.
--
f.anthony.n.finch <d...@dotat.at> http://dotat.at/
FAIR ISLE FAEROES SOUTHEAST ICELAND: VARIABLE 4. SLIGHT OR MODERATE.
OCCASIONAL RAIN OR DRIZZLE, FOG PATCHES. MODERATE OR GOOD, OCCASIONALLY VERY
POOR.

lawrenc...@siemens.com

unread,
May 24, 2010, 6:01:16 PM5/24/10
to
Tony Finch <d...@dotat.at> wrote:
> Section 7.4 paragraph 3:
>
> The term printing character refers to a member of a locale-specific
> set of characters, each of which occupies one printing position on a
> display device; the term control character refers to a member of a
> locale-specific set of characters that are not printing characters.
> All letters and digits are printing characters.
>
> What is "one position on a display device" supposed to be? On a fixed
> width display, CJK characters typically occupy two positions. The
> phrase seems to make no sense wrt proportional fonts.

It's just intended to distinguish between printing characters and
non-printing (control) characters. CJK character printing positions are
typically twice as wide as ASCII character printing positions;
proportional font printing positions are variable width.
--
Larry Jones

Mom would be a lot more fun if she was a little more gullible. -- Calvin

Tony Finch

unread,
May 25, 2010, 12:23:25 PM5/25/10
to

In that case why doesn't a tab count as a single variable-width
printing position?

Tony.
--
f.anthony.n.finch <d...@dotat.at> http://dotat.at/

SOUTH UTSIRE NORTHEAST FORTIES: NORTHWESTERLY 5 TO 7, OCCASIONALLY GALE 8 IN
SOUTH UTSIRE. MODERATE BECOMING ROUGH. RAIN OR SHOWERS. MODERATE OR GOOD.

Fred Bloggs

unread,
May 25, 2010, 2:47:33 PM5/25/10
to
Tony Finch <d...@dotat.at> wrote in news:XCn*F5V-
s...@news.chiark.greenend.org.uk:

> lawrenc...@siemens.com wrote:
>>Tony Finch <d...@dotat.at> wrote:
>>> Section 7.4 paragraph 3:
>>>
>>> The term printing character refers to a member of a locale-specific
>>> set of characters, each of which occupies one printing position on a
>>> display device; the term control character refers to a member of a
>>> locale-specific set of characters that are not printing characters.
>>> All letters and digits are printing characters.
>>>
>>> What is "one position on a display device" supposed to be? On a fixed
>>> width display, CJK characters typically occupy two positions. The
>>> phrase seems to make no sense wrt proportional fonts.
>>
>>It's just intended to distinguish between printing characters and
>>non-printing (control) characters. CJK character printing positions are
>>typically twice as wide as ASCII character printing positions;
>>proportional font printing positions are variable width.
>
> In that case why doesn't a tab count as a single variable-width
> printing position?
>
> Tony.

Because it's a control character!

lawrenc...@siemens.com

unread,
May 25, 2010, 3:39:12 PM5/25/10
to
Tony Finch <d...@dotat.at> wrote:

> lawrenc...@siemens.com wrote:
> >
> >It's just intended to distinguish between printing characters and
> >non-printing (control) characters. CJK character printing positions are
> >typically twice as wide as ASCII character printing positions;
> >proportional font printing positions are variable width.
>
> In that case why doesn't a tab count as a single variable-width
> printing position?

Because the amount of space "occupied" by a tab character varies. A
proportional font has variable width printing positions but a particular
character always occupies the same amount of space.
--
Larry Jones

I'm getting disillusioned with these New Years. -- Calvin

John Aldridge

unread,
May 25, 2010, 9:16:04 PM5/25/10
to
In article <0kltc7-...@jones.homeip.net>, lawrenc...@siemens.com
says...

> Tony Finch <d...@dotat.at> wrote:
> > lawrenc...@siemens.com wrote:
> > In that case why doesn't a tab count as a single variable-width
> > printing position?
>
> Because the amount of space "occupied" by a tab character varies. A
> proportional font has variable width printing positions but a particular
> character always occupies the same amount of space.

That's not necessarily true, e.g. when kerning is used.

--
Cheers,
John

Keith Thompson

unread,
May 25, 2010, 10:40:46 PM5/25/10
to

Good point.

I'm not sure there's a simple and consistent definition of "printing
character" that includes space (and CJK characters, and so forth)
but excludes tab (and no-break space, and ...). The simplest answer
may be that tab is a control character because the standards say so.

--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

lawrenc...@siemens.com

unread,
May 26, 2010, 11:52:13 AM5/26/10
to
John Aldridge <no....@jjdash.demon.co.uk> wrote:
> In article <0kltc7-...@jones.homeip.net>, lawrenc...@siemens.com
> says...
> > Because the amount of space "occupied" by a tab character varies. A
> > proportional font has variable width printing positions but a particular
> > character always occupies the same amount of space.
>
> That's not necessarily true, e.g. when kerning is used.

Kerning adjusts the locations of the printing positions, not their
sizes, just like tracking and leading do.
--
Larry Jones

The authorities are trying to silence any view contrary to their own!
-- Calvin

John Aldridge

unread,
May 26, 2010, 8:28:55 PM5/26/10
to
In article <dmsvc7-...@jones.homeip.net>, lawrenc...@siemens.com
says...

> John Aldridge <no....@jjdash.demon.co.uk> wrote:
> > In article <0kltc7-...@jones.homeip.net>, lawrenc...@siemens.com
> > says...
> > > Because the amount of space "occupied" by a tab character varies. A
> > > proportional font has variable width printing positions but a particular
> > > character always occupies the same amount of space.
> >
> > That's not necessarily true, e.g. when kerning is used.
>
> Kerning adjusts the locations of the printing positions, not their
> sizes, just like tracking and leading do.

Yes, indeed. Just like tab.

--
Cheers,
John

lawrenc...@siemens.com

unread,
May 27, 2010, 12:25:47 PM5/27/10
to
John Aldridge <no....@jjdash.demon.co.uk> wrote:
> In article <dmsvc7-...@jones.homeip.net>, lawrenc...@siemens.com
> says...

> >
> > Kerning adjusts the locations of the printing positions, not their
> > sizes, just like tracking and leading do.
>
> Yes, indeed. Just like tab.

Which is why tab is a control character, not a printing character: it
adjusts the location of the current printing position rather than
occupying it.
--
Larry Jones

I can do that! It's a free country! I've got my rights! -- Calvin

Richard Bos

unread,
Jun 9, 2010, 7:33:12 AM6/9/10
to
lawrenc...@siemens.com wrote:

> > > Because the amount of space "occupied" by a tab character varies. A


> > > proportional font has variable width printing positions but a particular
> > > character always occupies the same amount of space.
> >
> > That's not necessarily true, e.g. when kerning is used.
>
> Kerning adjusts the locations of the printing positions, not their
> sizes, just like tracking and leading do.

Modern fonts (and old-fashioned lead ones!) can adjust the sizes of
characters depending on context. E.g., what is an 'r' in source code
could be represented by different glyphs, with different widths,
depending on whether it follows an 'i' or an 'o'.
In lead, this was common for some letters, even when no ligatures were
used. It is now becoming more and more normal again for computer-typeset
text, thanks to OpenType. For output from C code, it is still highly
unlikely, of course.

Richard

0 new messages