Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > TextAttribute.CHAR_REPLACEMENT question

Reply
Thread Tools

TextAttribute.CHAR_REPLACEMENT question

 
 
Ted Hopp
Guest
Posts: n/a
 
      09-09-2003
I've used TextAttribute.CHAR_REPLACEMENT to insert in-line graphics into
text by applying it to the Unicode character U+FFFC
(OBJECT_REPLACEMENT_CHARACTER). But all the layout, measurement, bidi
analysis, etc. seems to work the same if the underlying character is
anything else.

So my question is: when I apply the CHAR_REPLACEMENT attribute to a
character, does it matter at all what character it is? Do all JVMs behave
the same in this area?

The Java documentation isn't exactly clear. The description of
TextAttribute.CHAR_REPLACEMENT ends with the following strange sentence:
"Follows the Microsoft model: the character that this is applied to should
be ?." That seems to say that I should have been using a question mark all
along instead of U+FFFC. But isn't that contrary to the Unicode standard?

Thanks,

Ted Hopp
http://www.velocityreviews.com/forums/(E-Mail Removed)


 
Reply With Quote
 
 
 
 
Steven Coco
Guest
Posts: n/a
 
      09-10-2003
Ted Hopp wrote:

> The Java documentation isn't exactly clear. The description of
> TextAttribute.CHAR_REPLACEMENT ends with the following strange sentence:
> "Follows the Microsoft model: the character that this is applied to should
> be ?." That seems to say that I should have been using a question mark all
> along instead of U+FFFC.


Though I'm not at all familiar with TextAttribute nor performing
replacements; (!); you will see the ? character used as a replacement
for characters that can't be found in any of your installed fonts. It
may also be substituted in other instances when a character is not found
though I'm not accurate on when. Indulge me for a moment:

The question mark you're seeing could have been a substitution your web
browser had made for a character it didn't find in your fonts; but it is
also possible that it was substituted at some previous time for similar
reasons.

The documentation could be referring to some other character.

.. Steven Coco .
.................................................. .......................
When you're not sure; "Confess your heart" says the Lord, "and you'll be
freed."

 
Reply With Quote
 
 
 
 
Ted Hopp
Guest
Posts: n/a
 
      09-10-2003
"Steven Coco" <(E-Mail Removed)> wrote in message
news:m5w7b.6060$(E-Mail Removed)...
> Ted Hopp wrote:
>
> > The Java documentation isn't exactly clear. The description of
> > TextAttribute.CHAR_REPLACEMENT ends with the following strange sentence:
> > "Follows the Microsoft model: the character that this is applied to

should
> > be ?." That seems to say that I should have been using a question mark

all
> > along instead of U+FFFC.

>
> Though I'm not at all familiar with TextAttribute nor performing
> replacements; (!); you will see the ? character used as a replacement
> for characters that can't be found in any of your installed fonts. It
> may also be substituted in other instances when a character is not found
> though I'm not accurate on when. Indulge me for a moment:
>
> The question mark you're seeing could have been a substitution your web
> browser had made for a character it didn't find in your fonts; but it is
> also possible that it was substituted at some previous time for similar
> reasons.
>
> The documentation could be referring to some other character.


You're right, but it's not a browser font issue. The source HTML for the
documentation page contains a question mark. But the comments in the Java
source contain "...\uFFFC.</TD></TR>". Maybe this is a javadoc issue, where
it generates a question mark for out-of-range characters?

In any event, it seems I've been doing it correctly all along, just by
accident. But I'd still like to know why it apparently works for any (base)
character at all.

Ted Hopp
(E-Mail Removed)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
question row filter (more of sql query question) =?Utf-8?B?YW5kcmV3MDA3?= ASP .Net 2 10-06-2005 01:07 PM
Quick Question - Newby Question =?Utf-8?B?UnlhbiBTbWl0aA==?= ASP .Net 4 02-16-2005 11:59 AM
Question on Transcender Question :-) eddiec MCSE 6 05-20-2004 06:59 AM
Question re: features of the 831 router (also a 924 question) Wayne Cisco 0 03-02-2004 07:57 PM
Syntax Question - Novice Question sean ASP .Net 1 10-20-2003 12:18 PM



Advertisments