PDA

View Full Version : Strange font colors


pdstein
05-09-2000, 01:13 PM
I have a client who created a web page and is seeing some very strange font colors.[nbsp][nbsp]The page is at http://www.ourchurch.com/view/?pageID=14704[nbsp][nbsp]If you view source and scroll down to the text of the page, you will see

<font face=”VERDANA”><font color=”RED”><center>
<H1>FROM KAYE, THE KING'S KID</H1>


[nbsp]<H3>[b]PRAYER[nbsp][nbsp]of[nbsp][nbsp]SHAME[nbsp][nbsp]ç¿ç[nbsp][nbsp][<< tears]</H3>




Note how the font color is set to red in the HTML but when you look at the page the font is actually shown in green.[nbsp][nbsp]It's bizzare.[nbsp][nbsp]Other font colors further down in the page also don't seem to match the HTML.

Can anyone tell me what's going on here?[nbsp][nbsp]I looked at it with both Netscape and MSIE and got the same thing.

Justin
05-09-2000, 01:17 PM
Is &quot;RED&quot; a valid font color? Shouldn't you instead use #FF0000 to specify a font color? I know *some* browsers support these &quot;friendly&quot; names, but I wouldn't rely on them (who is to say what exactly RED is? Could be #FF0000 or could be #CC0000...)

At any rate, if you do insist on using textual names, I suspect it may be the all caps, or maybe RED isn't valid (might be magenta or something else you are looking for)...

Hope this helps.

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support

pdstein
05-09-2000, 01:25 PM
Wow, that was a quick response Justin, thanks.

Actually, I thought about that as well and tried it with <font color=&quot;#FF0000&quot;> and it does the same thing.[nbsp][nbsp]In fact, just to be sure, I'll change it to that again.

pdstein
05-09-2000, 01:26 PM
I'll leave it changed to <font color=&quot;#FF0000&quot;> just so there's no confusion on that issue.[nbsp][nbsp]Any other ideas?

Shalazar
05-09-2000, 01:50 PM
You could always try closing those font tags.[nbsp][nbsp]I see two open font tags, and no closing ones.[nbsp][nbsp]Open tags are &quot;open&quot; to interpretation by the broswer, and wierd behavior can and will ensue.

One thing I'd suggest is amalgamating your font tags in a single tag. Instead of <font color=&quot;#FF0000&quot;><font face=&quot;Verdana&quot;>, go with something like <font color=&quot;#FF000&quot; face=&quot;Verdana&quot;>text</font>

That relieves you from having to close two font tags with every change of style, and constrains any changes you make to your fonts in one single tag to better avoid conflicting tags.

Dan Kaplan
05-09-2000, 01:52 PM
I think the problem is that you have:

<font face=”VERDANA”><font color=”#FF0000”>

but the quote marks are showing up as some unrecognized symbol in the source code, depending on how you view it and what you copy it into...

Dan

Dan Kaplan
05-09-2000, 01:54 PM
I looked for unclosed font tags down to the problem point, and a text search showed that everything is closed properly.[nbsp][nbsp]Anything after that shouldn't matter in terms of font tags.

Dan

Shalazar
05-09-2000, 02:02 PM
Dan, I went and checked that source code, and you're right.[nbsp][nbsp]The quotes around those particular font tags are not normal quotes.

In fact, they're showing up as wierd block symbols when I cut and paste into different editors.[nbsp][nbsp]I've seen this behavior before if you do HTML editing in something like Microsoft Word.[nbsp][nbsp]Even if you save it as plain unformatted text, quotes become altered into a block symbol exactly like that.

When I removed the blocks/quotes entirely from my pasted code, the font tags worked correctly.
[This message has been edited by Shalazar (edited 05-10-00@1:01 pm)]

pdstein
05-09-2000, 02:35 PM
Thanks for everyone's help.[nbsp][nbsp]I know there were a lot of &quot;suspects&quot; (open font tags, two font tags, etc), but the strange quotation marks turned out to be the real culprit.[nbsp][nbsp]When I looked at the source I saw quotes (rather than the blocks), but after deleting the quotes and retyping them, it worked correctly.[nbsp][nbsp]I'll have to see whether or not my client did any of the HTML editing with MSWord.

Thanks again :)

Dan Kaplan
05-09-2000, 02:47 PM
Glad that worked.[nbsp][nbsp]Unless it's just a peculiarity of this browser (NS 4.5), the problematic source code quotes were different than the other quotes -- they were angled instead of straight up and down, for lack of a better term.[nbsp][nbsp]They must have some special feature.[nbsp][nbsp];)

I've actually wondered what makes some text different than others in terms of how it is recognized by text editors.[nbsp][nbsp]Some examples:

[nbsp]- With a quasi-newsletter program I have worked with, the body of text is output between the <textarea> tags.[nbsp][nbsp]This makes it uneditable, as it is for updates straight from the database.[nbsp][nbsp]I have tried copying it into a text editor, but it remains uneditable.[nbsp][nbsp]How can a block of text be protected in such a way?

[nbsp]- If you were to copy this post straight from the browser -- as opposed to from the source code or edit screen -- in Netscape, you would get all but the first line indented with hard returns at the end of each line, due to the use of tables.[nbsp][nbsp]If you do the same in IE, there are no hard returns or indentations.[nbsp][nbsp]That may be more browser related than text related, but it seems to be a similar issue.

I'm forgetting one example...[nbsp][nbsp]Any others?

Dan

Justin
05-09-2000, 04:55 PM
That last issue is the browser. When a program places data on the clipboard, it generally puts it in as many formats as possible. Text is the worse - usually you have plain text, HTML, and Rich Text. Then when you paste, the receiving program takes whichever format it knows how to work with.

So Netscape obviously interprets the text differently. If you'll notice, IE will copy an HR as a bunch of dashes in an attempt to preserve formatting...

By the way - I've never seen what you are talking about with &quot;uneditable text&quot;... There are no provisions in the Win32 API to make text uneditable in the clipboard... and that would be kinda pointless (since the clipboard's purpose is for editing)... Can you give an example that can be reproduced (out of extreme curiosity)?

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support
[This message has been edited by Justin (edited 05-09-00@4:57 pm)]

Dan Kaplan
05-09-2000, 05:11 PM
Then when you paste, the receiving program takes whichever format it knows how to work with. If I understand you correctly, then the text formatting would be dependent on the text editor it is pasted into?[nbsp][nbsp]I don't think that's what you're saying, and it doesn't make sense... because I get the different results with IE and NS pasting into the same text editor.

As far as the uneditable text, I would need to email you the admin password for my Links SQL script.[nbsp][nbsp]It has a feature to email all users in the database a list of &quot;new&quot; links, which is generally everything added in the past two weeks.[nbsp][nbsp]The list of new links is somehow pre-formatted within the program and placed within the mailing screen via the <textarea> tags.[nbsp][nbsp]There was some discussion in the support forum as to why it's done that way and why it's uneditable, but it doesn't go into much detail:

http://gossamer-threads.com/scripts/forum/resources/Forum9/HTML/000603.html

Hmph, just as I'm about to post this, I went back and checked and it's not doing that any more with two different text editors...[nbsp][nbsp]I'll have to play around and see if I can recreate that.[nbsp][nbsp]It couldn't be operating system based, could it?[nbsp][nbsp]I'm not sure what else could have caused it.[nbsp][nbsp]I tried it several times with the same results -- I know it wasn't my imagination!!![nbsp][nbsp]:(

Dlirious

Justin
05-09-2000, 11:13 PM
I think you read my post wrong (or I wrote it wrong ;) )

The formatting of the text (converting from HTML to both Rich Text and Plain Text) is done by the browser (or the paster). The text editor (or the pastee) decides which version of the text it wants: HTML, Rich Text, or Plain Text. If the paster doesn't place the desired format on the clipboard then the pastee would have to choose to either convert what is there (if it knows how) or simply consider the clipboard empty for its purposes. So the conversion can be done by the pastee as well - but both browsers are responsible pasters and thus they will do their own conversions, resulting in the differences you experience.

Now, if that didn't confuse you, I don't know what will :P

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support

Dan Kaplan
05-10-2000, 01:31 AM
Well, I officially cannot recreate the uneditable text problem.[nbsp][nbsp]I'm pretty sure it was on my previous computer, which was an incredibly finicky Win 98 machine running Netscape 4.6.[nbsp][nbsp]Very strange.

Doubtful

Justin
05-10-2000, 04:26 PM
Gotta love problems that you can't seem to reproduce when asked (a friend of mine had intermittent problems with his stereo in a new truck - every time he'd go to the dealer it would work just fine, but just as he'd leave, the speakers would start to distort and crackle... never did get that fixed ;) )

------------------
Justin Nelson
FutureQuest (http://www.FutureQuest.net/index.php) Support

Dan Kaplan
05-10-2000, 04:50 PM
I'm just glad I figured it was un-reproduceable before giving you a whack at it.[nbsp][nbsp];)

I had a similar car problem several years back.[nbsp][nbsp]The car would intermittently die, and usually start running really rough just before it would happen.[nbsp][nbsp]After spending hundreds of dollars on it (after a couple shop visits, they stopped charging me for labor -- parts only -- because they had missed the boat so bad on the estimate and parted out nearly everything under the hood), it still would cop out halfway home...[nbsp][nbsp]I would take it back, bike home, call them the next day, and what do you know, it ran perfect for them![nbsp][nbsp]That probably happened close to a dozen times.[nbsp][nbsp]Finally, I gave up and when I was leaving the shop office for the last time, I overheard a rather heated discussion between a customer and worker.[nbsp][nbsp]The worker said something along the lines of, &quot;we couldn't recreate the problem, so you'll have to leave it here for continued testing...&quot;[nbsp][nbsp]He was none too pleased.

I could also show you a beauty of an experience with my current car after buying it new.[nbsp][nbsp]The dealer that I was taking it to for service is no longer a dealer for Mazda; I can't imagine why.[nbsp][nbsp]:P

Digress