HTML , Printing labels and spacing

S

Saeed

I have 7 items that detail the customers address and need to print it
in 5 lines where that 5 lines woudl fit in a Lable sticker.

I m using C/C+ when writing to my HTL file using this syntax.
fprintf(fp,"<p class=MsoNormal><b style='mso-bidi-font-
weight:normal'><span style='font-size:11.0pt;font-family:Arial'>
%s<u5:p></u5:p></span></b></p>\n",x);


when x is null teh spacing seems to change between the lines than when
it has a value which screwes the layout on the labels and things go
out of sync.


Is there any solution for this ? that is to say , to be able to leave
a gap of ceratin spacing when i know how many blank lines i have had
and do his gap at the end before the start of the new label ?


Thanks
 
R

rf

Saeed said:
I have 7 items that detail the customers address and need to print it
in 5 lines where that 5 lines woudl fit in a Lable sticker.

I m using C/C+ when writing to my HTL file using this syntax.
fprintf(fp,"<p class=MsoNormal><b style='mso-bidi-font-
weight:normal'><span style='font-size:11.0pt;font-family:Arial'>
%s<u5:p></u5:p></span></b></p>\n",x);

Did you make up these styles or did you scape them off a "microsoft word"
document?
when x is null teh spacing seems to change between the lines than when
it has a value which screwes the layout on the labels and things go
out of sync.
Is there any solution for this ? that is to say , to be able to leave
a gap of ceratin spacing when i know how many blank lines i have had
and do his gap at the end before the start of the new label ?

if (x == "")
x = "&nbsp;"
 
R

rf

Ben C said:
You're using C with undefined behaviour to write invalid HTML, so it's
not surprising if some things haven't worked as expected.


Don't read from NULL pointers. You could use rf's solution (but it's not
in C or C++).

Too much c# recently :)

x is, of course, a string, not a char *.
 
J

Jukka K. Korpela

Saeed said:
I have 7 items that detail the customers address and need to print it
in 5 lines where that 5 lines woudl fit in a Lable sticker.

You just have to decide how to divide them on 5 lines then. The HTML side of
the matter is fairly trivial, but you can either use <br> between lines, or
you could - somewhat more structurally - wrap each line inside <div> markup.
Even a table could be used, but I don't think there's a tangible benefit
_unless_ you want to draw borders around the address, or use background
color for it, and you want its width to be "shrink-to-fit".
I m using C/C+

Quite an odd division operation, is it not? People in the "real programmers
use FORTRAN" school would say that you have division by zero. Read my lips:
the slash "/" is a wicked punctuation mark, intended to confuse both the
reader's mind and the writer's mind.
when writing to my HTL file using this syntax.

Does it matter how you write it? Shouldn't the main concern be what markup
to use? _Then_ you can start worrying about how to generate it.
fprintf(fp,"<p class=MsoNormal><b style='mso-bidi-font-
weight:normal'><span style='font-size:11.0pt;font-family:Arial'>
%s<u5:p></u5:p></span></b></p>\n",x);

Oh my... looks like trolling... but maybe it's just ignorance. There's
really not single item in the markup that is correct. An address is not a
paragraph, to begin with, and using <b> for bolding with a browser-dependent
CSS rule suggesting that the text be _not_ bold is... is... sorry, ran out
of words.
when x is null teh spacing seems to change between the lines than when
it has a value which screwes the layout on the labels and things go
out of sync.

Oh really? So you did not read the Ten Commandments for C Programmers, did
you? "Thou shalt not follow the NULL pointer, since madness and chaos awaits
at its end."
Is there any solution for this ?

Stop creating the problem.
that is to say , to be able to leave
a gap of ceratin spacing when i know how many blank lines i have had
and do his gap at the end before the start of the new label ?

In fact, if you may have _blank_ lines in an address, maybe <pre> is best
markup, despite its primitiveness. Just remember that it sets font face to
something monospace, but you can easily override this, with the usual CSS
caveats, using a single simple rule in CSS.
 
D

dorayme

"Jukka K. Korpela said:
An address is not a
paragraph, to begin with, and using <b> for bolding with a browser-dependent
CSS rule suggesting that the text be _not_ bold is... is... sorry, ran out
of words.

You need to migrate to Australia, you would have the words then.... You
have the front already, it is just that little bit of cultural pull that
you need to loosen the fine European sensibility.

If you do not fancy coming over, see if you can get to see Question Time
in our federal parliament on TV. (And, btw, they are named individuals
speaking in public. So you will be chock full of respect for them).
 
S

Saeed

You need to migrate to Australia, you would have the words then.... You
have the front already, it is just that little bit of cultural pull that
you need to loosen the fine European sensibility.

If you do not fancy coming over, see if you can get to see Question Time
in our federal parliament on TV. (And, btw, they are named individuals
speaking in public. So you will be chock full of respect for them).

The chunk was extracted out of a MS word HTML Document and modified to
get the Job done.
As long as It works , I dont really care if HTML used is legal or
pisses some people off.

Thanks to all those who has a positive contribution to this thread
w'out being a smart A...
 
D

dorayme

Saeed said:
As long as It works , I dont really care if HTML used is legal or
pisses some people off.

The whole point about the concern for legality around these parts, is
that long term it gets not to work or to generally contribute to a
culture where things do not work satisfactorily. There is nothing wrong
with high standards and they are far from identical to pedantry.
 
N

Neredbojias

The whole point about the concern for legality around these parts, is
that long term it gets not to work or to generally contribute to a
culture where things do not work satisfactorily. There is nothing wrong
with high standards and they are far from identical to pedantry.

Bull. "High Standards" usually (though not always) indicates an excess of
pedantry or an attitude very much like it.
 
D

dorayme

Ben C said:
A difficulty with HTML is that validation _is_ much stricter than what
browsers need.

Some things are important not to mess up (for the author's own sanity)
like broken forms and tables and forgetting to close tags. Other things
are really a bit silly. Why do you have to have at least one block-level
element inside a BLOCKQUOTE? I can't see any logical reason for that and
browsers couldn't care less.

It's still preferable to validate than to try and guess what's important
and what isn't, but they probably shouldn't have made the DTD so
exacting in the first place.

Well, maybe so. There are a few people around who use their own (Toby
Inkster does!). Perhaps all those who do should publish theirs so we can
all benefit. Earthlings are so selfish and secretive! When Toby Inkster
and others get to the Gates, St Peter *will* ask pointedly whether they
shared their own DTD and the outcome could be hellish.
 
A

Adrienne Boswell

Why do you have to have at least one block-level
element inside a BLOCKQUOTE? I can't see any logical reason for that and
browsers couldn't care less.

Maybe because it's called BLOCKquote? It's supposed to be for quoting a
block of text, and a block of text would have at least one block level
element in it. It's a wrapper for long quotations, as opposed to the q
element for inline content that doesn't required paragraph breaks. It
makes sense semantically. You could say:
<div class="quotation">
<p>This is paragraph one.</p>
<p>This is paragraph two.</p>
</div>

But, that does not make any sense semantically where this does:
<blockquote cite="http://example.com/reference/">
<p>This is paragraph one.</p>
<p>This is paragraph two.</p>
</blockquote>
 
A

Adrienne Boswell

I would have thought a block of text would just have text in it. It is
a block. Why does it need another block inside it?

Because there is the ability to have one or more block level elements.
Would you go
<blockquote>something long</blockquote>
<blockquote>some more long things on the same subject</blockquote>
<blockquote>even more long things on the same subject</blockquote>

or

<blockquote>
<p>something long</p>
<p>some more long things</p>
<p>even more long things</p>
</blockquote>
 
A

Adrienne Boswell

The latter, but I don't see why blockquote can't be like div-- I can
just put text in it if I'm quoting a couple of sentences, or a few
paragraphs if I'm quoting a few paragraphs.

Because blockquote has sematic meaning, and div does not.
 
D

dorayme

Adrienne Boswell said:
It's a wrapper for long quotations, as opposed to the q
element for inline content that doesn't required paragraph breaks.

Think about this difference. Q is for short quotations and is (as we
say) inline, whereas BLOCKQUOTE is for long ones (one or more). So what
is the *semantic* difference? Nothing much really. The difference in
tools here is greatly for presentational purposes. You can see this when
you have something to quote that is not clearly short or long and could
be done with either tool. There is no meaning difference - except in one
subtle respect which we can leave out for now.
It makes sense semantically. You could say:
<div class="quotation">
<p>This is paragraph one.</p>
<p>This is paragraph two.</p>
</div>

But, that does not make any sense semantically where this does:
<blockquote cite="http://example.com/reference/">
<p>This is paragraph one.</p>
<p>This is paragraph two.</p>
</blockquote>

But here you are case picking. Your argument looks not so strong when
you compare

<div class="quotation">
<p>
God is gives existence to the universe by...
</p>
</div>

to the "possible"

<blockquote cite="http://example.com/reference/">
God is gives existence to the universe by...
</blockquote>

The latter BLOCKQUOTE is better semantically than the div, sure. But it
is not any worse semantically than the over fussy:

<blockquote cite="http://example.com/reference/">
<p>
God is gives existence to the universe by...
<p>
</blockquote>

The difference between BLOCKQUOTE and Q is simply about presentation.
The former is a good tool because it tells the browser to create a block
on a new line, indent it or whatever. Very useful indeed. But, note how
*this* has absolutely nothing to do with whether it should have the
pesky further requirement that Ben is rightly irked by.

(No idea if my efforts above to indent by use of the tab and return key
are successful? Looks good here! <g>)
 
A

Adrienne Boswell

Gazing into my crystal ball I observed dorayme
Think about this difference. Q is for short quotations and is (as we
say) inline, whereas BLOCKQUOTE is for long ones (one or more). So what
is the *semantic* difference? Nothing much really. The difference in
tools here is greatly for presentational purposes. You can see this when
you have something to quote that is not clearly short or long and could
be done with either tool. There is no meaning difference - except in one
subtle respect which we can leave out for now.


But here you are case picking. Your argument looks not so strong when
you compare

<div class="quotation">
<p>
God is gives existence to the universe by...
</p>
</div>

to the "possible"

<blockquote cite="http://example.com/reference/">
God is gives existence to the universe by...
</blockquote>

The latter BLOCKQUOTE is better semantically than the div, sure. But it
is not any worse semantically than the over fussy:

<blockquote cite="http://example.com/reference/">
<p>
God is gives existence to the universe by...
<p>
</blockquote>

The difference between BLOCKQUOTE and Q is simply about presentation.
The former is a good tool because it tells the browser to create a block
on a new line, indent it or whatever. Very useful indeed. But, note how
*this* has absolutely nothing to do with whether it should have the
pesky further requirement that Ben is rightly irked by.

No, it really has nothing to do with presenation. It has to do with
sematics. If I were reading meanings out to you it might go something
like this:
arbpen: This is the main heading
arbpen: This is a paragraph that contains content relavent to the
heading.
arbpen: This is a quotation from example.com
arbpen: This is a paragraph from the quotation
arbpen: This is another paragraph from the quotation
arbpen: This ends the quotation
arbpen: This is a second level heading
arbpen: This is another paragraph the contains content relavent to the
second level heading.
(No idea if my efforts above to indent by use of the tab and return key
are successful? Looks good here! <g>)

Again, it's because the blockquote, like a div, can contain more than
one paragraph. The big difference is that div is a container only, and
has no semantic meaning, where blockquote does.
 
N

Neredbojias

A difficulty with HTML is that validation _is_ much stricter than
what browsers need.

Some things are important not to mess up (for the author's own
sanity) like broken forms and tables and forgetting to close tags.
Other things are really a bit silly. Why do you have to have at least
one block-level element inside a BLOCKQUOTE? I can't see any logical
reason for that and browsers couldn't care less.

I agree with you and can't even see why a(nother) container is needed in
the said:
It's still preferable to validate than to try and guess what's
important and what isn't, but they probably shouldn't have made the
DTD so exacting in the first place.

Probably not. However, my detering remark was meant to address the
common, general meaning of "high standards", not the html/css-specific
one. Those who propound such supposed "ideals" (even if they're right)
are typically overfull of arrogance or smugness and totally full of you-
know-what.
 
D

dorayme

Adrienne Boswell said:
Gazing into my crystal ball I observed dorayme


No, it really has nothing to do with presenation.

*What* exactly has nothing to do with presentation? The difference
between BLOCKQUOTE and Q? The former is a tool for rendering long quotes
that the author feels need presenting as a block, the latter for shorter
ones, happily quoted inline. The matter is fairly subjective in many
cases, the choice seems to be author preference depending on many
factors and background conditions.

But this has little to do with the main issue at hand and that is why it
would have been wrong to allow loose text in a BLOCKQUOTE. The
difference between a div and a BLOCKQUOTE is not suddenly erased because
of the proposal to allow loose text in BLOCKQUOTE.

You keep talking about divs and headings and other things. Talk about
the difference between BLOCKQUOTE and Q. And then talk about why exactly
BLOCKQUOTE would suddenly become a useless tool if one did not have to
put in a block within it. You are doing none of these things at all, yet
these are the only relevant things.
It has to do with
sematics. If I were reading meanings out to you it might go something
like this:
arbpen: This is the main heading
arbpen: This is a paragraph that contains content relavent to the
heading.
arbpen: This is a quotation from example.com
arbpen: This is a paragraph from the quotation
arbpen: This is another paragraph from the quotation
arbpen: This ends the quotation
arbpen: This is a second level heading
arbpen: This is another paragraph the contains content relavent to the
second level heading.
I am sorry Adrienne, but all this is not relevant. No one is proposing
to disallow said:
the blockquote, like a div, can contain more than
one paragraph. The big difference is that div is a container only, and
has no semantic meaning, where blockquote does.

This big difference is not the main concern. The main concern is would
the difference magically disappear if a BLOCKQUOTE could legally contain
a quotation unwrapped in a further element. You present no argumnent
about this. It would, imo, simply not be affected at all.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top