comp.lang.ada
 help / color / mirror / Atom feed
* Re: Ada facility for determining dimensions (height/width) for display/print character string?
       [not found] <mailman.1035925742.9365.comp.lang.ada@ada.eu.org>
@ 2002-10-29 23:48 ` tmoran
  2002-10-30 10:59   ` Larry Kilgallen
  0 siblings, 1 reply; 7+ messages in thread
From: tmoran @ 2002-10-29 23:48 UTC (permalink / raw)


>Does Ada have a facility for determining the dimensions (height and =
>width) that it will take to display/print a given string of characters?
  Yes.  When an Ada program is controlling a skywriter, characters are
100 meters square.
  If the Ada program is controlling a Patriot missile, an attempt to
display a string of characters gives an output of zero size.
  Or perhaps you are thinking of, say, a Windows platform.  If you are
using Claw, function Claw.Attributes.Size(Canvas, Text) returns the
height and width of the string Text when displayed on the given Canvas
in its current font.
  Ada is used in many contexts.  There is no single "Ada facility" for
doing what you want.  It depends on the platform and your library.



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

* Re: Ada facility for determining dimensions (height/width) for display/print character string?
  2002-10-29 23:48 ` tmoran
@ 2002-10-30 10:59   ` Larry Kilgallen
  0 siblings, 0 replies; 7+ messages in thread
From: Larry Kilgallen @ 2002-10-30 10:59 UTC (permalink / raw)


In article <d7Fv9.159526$qM2.49673@sccrnsc02>, tmoran@acm.org writes:
>>Does Ada have a facility for determining the dimensions (height and =
>>width) that it will take to display/print a given string of characters?
>   Yes.  When an Ada program is controlling a skywriter, characters are
> 100 meters square.

But don't think your program will automatically port to the new
generation of 200 meters square skywriters, as you may get an
arithmetic overflow and if your program does not handle the exception
correctly you will spill skywriter ink all over the sports stadium :-)



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

* Re: Ada facility for determining dimensions (height/width) for display/print character string?
  2002-11-01  3:17 Ada facility for determining dimensions (height/width) for display/print character string? RussJohnson@frontiernet.net
@ 2002-11-01  2:37 ` Larry Kilgallen
  2002-11-05 11:21 ` Georg Bauhaus
  2002-11-06  8:06 ` Matthew Baulch
  2 siblings, 0 replies; 7+ messages in thread
From: Larry Kilgallen @ 2002-11-01  2:37 UTC (permalink / raw)


In article <mailman.1036120741.28142.comp.lang.ada@ada.eu.org>, "RussJohnson@frontiernet.net" <russjohnson@frontiernet.net> writes:
> Does Ada have a facility for determining the dimensions (height and width)
> that it will take to display/print a given string of characters?

Actually, Ada does not change that often, so the answer is the same
one that Tom Moran posted two days ago when you previously posted
the question.



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

* Ada facility for determining dimensions (height/width) for display/print character string?
@ 2002-11-01  3:17 RussJohnson@frontiernet.net
  2002-11-01  2:37 ` Larry Kilgallen
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: RussJohnson@frontiernet.net @ 2002-11-01  3:17 UTC (permalink / raw)


Does Ada have a facility for determining the dimensions (height and width)
that it will take to display/print a given string of characters?

- Russ Johnson

   JohnsonRuss@NetZero.com
   Terre Hill, PA




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

* Re: Ada facility for determining dimensions (height/width) for display/print character string?
  2002-11-01  3:17 Ada facility for determining dimensions (height/width) for display/print character string? RussJohnson@frontiernet.net
  2002-11-01  2:37 ` Larry Kilgallen
@ 2002-11-05 11:21 ` Georg Bauhaus
  2002-11-12 20:54   ` Russell L Johnson
  2002-11-06  8:06 ` Matthew Baulch
  2 siblings, 1 reply; 7+ messages in thread
From: Georg Bauhaus @ 2002-11-05 11:21 UTC (permalink / raw)


RussJohnson@frontiernet.net <russjohnson@frontiernet.net> wrote:
: Does Ada have a facility for determining the dimensions (height and width)
: that it will take to display/print a given string of characters?

The only programming language I know of that has a facility like this
(using the language proper, i.e. not asking the operating systems using
some function of the operating system's API or some such)
is PostScript, which has builtin operators for text strings and
bounding box heights of characters and fonts.

Again, where does your text live? Is it a string "in Windows"?
Use a call to the appropriate operating system's library function to find
its dimensions. This is the same in any language.
Are you dealing with a typwriter like printer?
In that case the number of characters should give enough hints.
Do you have to ask a Java Virtual Machine for the dimensions
of specific characters in specific fonts? Etc.

-- georg



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

* Re: Ada facility for determining dimensions (height/width) for display/print character string?
  2002-11-01  3:17 Ada facility for determining dimensions (height/width) for display/print character string? RussJohnson@frontiernet.net
  2002-11-01  2:37 ` Larry Kilgallen
  2002-11-05 11:21 ` Georg Bauhaus
@ 2002-11-06  8:06 ` Matthew Baulch
  2 siblings, 0 replies; 7+ messages in thread
From: Matthew Baulch @ 2002-11-06  8:06 UTC (permalink / raw)


On Thu, 31 Oct 2002 22:17:52 +0000, RussJohnson@frontiernet.net wrote:

> Does Ada have a facility for determining the dimensions (height and width)
> that it will take to display/print a given string of characters?
> 
> - Russ Johnson
> 
>    JohnsonRuss@NetZero.com
>    Terre Hill, PA

If you are talking about width/height in terms of columns/rows in test
mode then you can find out these figures by dividing the number of chars
by the width of your string and finding the roof of that number. In the
case that C.R's are important then you will have to account for these
accordingly.



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

* Re: Ada facility for determining dimensions (height/width) for display/print character string?
  2002-11-05 11:21 ` Georg Bauhaus
@ 2002-11-12 20:54   ` Russell L Johnson
  0 siblings, 0 replies; 7+ messages in thread
From: Russell L Johnson @ 2002-11-12 20:54 UTC (permalink / raw)


The text will be in Windows and it looks what I need is either
Graph.TextHeight (and Graph.TextWidth) or the Windows GetTextExtent function
[unless I decide to use TeX or PostScript :^) ].

Thanks to all for your helpful information. Sorry I accidentally posted my
original post twice.

- Russ

"Georg Bauhaus" <sb463ba@l1-hrz.uni-duisburg.de> wrote in message
news:aq89j9$dht$1@a1-hrz.uni-duisburg.de...
> RussJohnson@frontiernet.net <russjohnson@frontiernet.net> wrote:
> : Does Ada have a facility for determining the dimensions (height and
width)
> : that it will take to display/print a given string of characters?
>
> The only programming language I know of that has a facility like this
> (using the language proper, i.e. not asking the operating systems using
> some function of the operating system's API or some such)
> is PostScript, which has builtin operators for text strings and
> bounding box heights of characters and fonts.
>
> Again, where does your text live? Is it a string "in Windows"?
> Use a call to the appropriate operating system's library function to find
> its dimensions. This is the same in any language.
> Are you dealing with a typwriter like printer?
> In that case the number of characters should give enough hints.
> Do you have to ask a Java Virtual Machine for the dimensions
> of specific characters in specific fonts? Etc.
>
> -- georg





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

end of thread, other threads:[~2002-11-12 20:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-01  3:17 Ada facility for determining dimensions (height/width) for display/print character string? RussJohnson@frontiernet.net
2002-11-01  2:37 ` Larry Kilgallen
2002-11-05 11:21 ` Georg Bauhaus
2002-11-12 20:54   ` Russell L Johnson
2002-11-06  8:06 ` Matthew Baulch
     [not found] <mailman.1035925742.9365.comp.lang.ada@ada.eu.org>
2002-10-29 23:48 ` tmoran
2002-10-30 10:59   ` Larry Kilgallen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox